diff options
Diffstat (limited to 'include/media/v4l2-mc.h')
-rw-r--r-- | include/media/v4l2-mc.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h index f9477b88014d..406f845034b9 100644 --- a/include/media/v4l2-mc.h +++ b/include/media/v4l2-mc.h @@ -2,6 +2,8 @@ * v4l2-mc.h - Media Controller V4L2 types and prototypes * * Copyright (C) 2016 Mauro Carvalho Chehab <mchehab@osg.samsung.com> + * Copyright (C) 2006-2010 Nokia Corporation + * Copyright (c) 2016 Intel Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +21,7 @@ #include <media/media-device.h> #include <media/v4l2-dev.h> +#include <linux/types.h> /** * enum tuner_pad_index - tuner pad index for MEDIA_ENT_F_TUNER @@ -165,6 +168,45 @@ void v4l_disable_media_source(struct video_device *vdev); */ int v4l_vb2q_enable_media_source(struct vb2_queue *q); + +/** + * v4l2_pipeline_pm_use - Update the use count of an entity + * @entity: The entity + * @use: Use (1) or stop using (0) the entity + * + * Update the use count of all entities in the pipeline and power entities on or + * off accordingly. + * + * This function is intended to be called in video node open (use == + * 1) and release (use == 0). It uses struct media_entity.use_count to + * track the power status. The use of this function should be paired + * with v4l2_pipeline_link_notify(). + * + * Return 0 on success or a negative error code on failure. Powering entities + * off is assumed to never fail. No failure can occur when the use parameter is + * set to 0. + */ +int v4l2_pipeline_pm_use(struct media_entity *entity, int use); + + +/** + * v4l2_pipeline_link_notify - Link management notification callback + * @link: The link + * @flags: New link flags that will be applied + * @notification: The link's state change notification type (MEDIA_DEV_NOTIFY_*) + * + * React to link management on powered pipelines by updating the use count of + * all entities in the source and sink sides of the link. Entities are powered + * on or off accordingly. The use of this function should be paired + * with v4l2_pipeline_pm_use(). + * + * Return 0 on success or a negative error code on failure. Powering entities + * off is assumed to never fail. This function will not fail for disconnection + * events. + */ +int v4l2_pipeline_link_notify(struct media_link *link, u32 flags, + unsigned int notification); + #else static inline int v4l2_mc_create_media_graph(struct media_device *mdev) @@ -186,6 +228,5 @@ static int v4l_vb2q_enable_media_source(struct vb2_queue *q) { return 0; } - #endif #endif /* _V4L2_MC_H */ |