[v2,14/19] media: Add enable_source handler field to struct media_device
diff mbox

Message ID 352c24377393df058cf5e72dc988a02029e3bbda.1437599281.git.shuahkh@osg.samsung.com
State New
Headers show

Commit Message

Shuah Khan July 22, 2015, 10:42 p.m. UTC
Add a new field to enable_source handler to find source entity
for the sink entity and check if it is available, and activate
the link using media_entity_setup_link() interface. Bridge driver
is expected to implement and set the handler when media_device is
registered or when bridge driver finds the media_device during
probe. This is to enable the use-case to find tuner entity
connected to the decoder entity and check if it is available,
and activate the using media_entity_setup_link() if it is available.
This hanlder can be invoked from media core (v4l-core, dvb-core)
as well as other drivers such as ALSA that control the media device.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 include/media/media-device.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch
diff mbox

diff --git a/include/media/media-device.h b/include/media/media-device.h
index e73642c..377102b 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -84,6 +84,18 @@  struct media_device {
 	/* Serializes graph operations. */
 	spinlock_t graph_lock;
 
+	/* Handler to find source entity for the sink entity and
+	 * check if it is available, and activate the link using
+	 * media_entity_setup_link() interface.
+	 * Bridge driver is expected to implement and set the
+	 * handler when media_device is registered or when
+	 * bridge driver finds the media_device during probe.
+	 *
+	 * Use-case: find tuner entity connected to the decoder
+	 * entity and check if it is available, and activate the
+	 * using media_entity_setup_link() if it is available.
+	*/
+	int (*enable_source)(struct media_entity *sink);
 	int (*link_notify)(struct media_link *link, u32 flags,
 			   unsigned int notification);
 };