summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-05-31 10:37:26 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:43:04 +0900
commitdfe5bb1fae8f9829bf857097214bbf69e9e067d1 (patch)
tree77e72d086a7c7798e0b2b071575a68d634ffadb7 /include
parent8ec51b5f0782939d124856aa9555f1de88acd9df (diff)
downloadlinux-3.10-dfe5bb1fae8f9829bf857097214bbf69e9e067d1.tar.gz
linux-3.10-dfe5bb1fae8f9829bf857097214bbf69e9e067d1.tar.bz2
linux-3.10-dfe5bb1fae8f9829bf857097214bbf69e9e067d1.zip
[media] media: Change media device link_notify behaviour
Currently the media device link_notify callback is invoked before the actual change of state of a link when the link is being enabled, and after the actual change of state when the link is being disabled. This doesn't allow a media device driver to perform any operations on a full graph before a link is disabled, as well as performing any tasks on a modified graph right after a link's state is changed. This patch modifies signature of the link_notify callback. This callback is now called always before and after a link's state change. To distinguish the notifications a 'notification' argument is added to the link_notify callback: MEDIA_DEV_NOTIFY_PRE_LINK_CH indicates notification before link's state change and MEDIA_DEV_NOTIFY_POST_LINK_CH corresponds to a notification after link flags change. [mchehab@redhat.com: whitespace cleanups] Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/media-device.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index eaade9815bb..12155a9596c 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -45,6 +45,7 @@ struct device;
* @entities: List of registered entities
* @lock: Entities list lock
* @graph_mutex: Entities graph operation lock
+ * @link_notify: Link state change notification callback
*
* This structure represents an abstract high-level media device. It allows easy
* access to entities and provides basic media device-level support. The
@@ -75,10 +76,14 @@ struct media_device {
/* Serializes graph operations. */
struct mutex graph_mutex;
- int (*link_notify)(struct media_pad *source,
- struct media_pad *sink, u32 flags);
+ int (*link_notify)(struct media_link *link, u32 flags,
+ unsigned int notification);
};
+/* Supported link_notify @notification values. */
+#define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0
+#define MEDIA_DEV_NOTIFY_POST_LINK_CH 1
+
/* media_devnode to media_device */
#define to_media_device(node) container_of(node, struct media_device, devnode)