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(+)
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); };