Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1354858

[PATCH 1/4] media: add change_source handler function pointer

From Shuah Khan <shuahkh@osg.samsung.com>
Newsgroups linux.kernel
Subject [PATCH 1/4] media: add change_source handler function pointer
Date 2016-03-10 06:10 +0100
Message-ID <rb11g-2cG-7@gated-at.bofh.it> (permalink)
References <rb11f-2cG-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Add change_source handler function pointer to struct media_device. Using
the change_source handler, driver can disable current source and enable
new one in one step when user selects a new input.

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

diff --git a/include/media/media-device.h b/include/media/media-device.h
index df74cfa..d9867ed 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -309,9 +309,11 @@ struct media_entity_notify {
  * @pm_count_walk: Graph walk for power state walk. Access serialised using
  *		   graph_mutex.
  *
- * @source_priv: Driver Private data for enable/disable source handlers
+ * @source_priv: Driver Private data for enable/disable/change source
+ *		 handlers
  * @enable_source: Enable Source Handler function pointer
  * @disable_source: Disable Source Handler function pointer
+ * @change_source: Change Source Handler function pointer
  *
  * @link_notify: Link state change notification callback
  *
@@ -326,14 +328,22 @@ struct media_entity_notify {
  * be unique.
  *
  * @enable_source is a handler to find source entity for the
- * sink entity  and activate the link between them if source
+ * sink entity and activate the link between them if source
  * entity is free. Drivers should call this handler before
  * accessing the source.
  *
  * @disable_source is a handler to find source entity for the
- * sink entity  and deactivate the link between them. Drivers
+ * sink entity and deactivate the link between them. Drivers
  * should call this handler to release the source.
  *
+ * @change_source is a handler to find source entity for the
+ * sink entity and deactivate the link between them. Once the
+ * existing link is deactivated, it will find and activate the
+ * source for the sink for the newly selected input. Drivers
+ * should call this handler to change the source when user
+ * changes input. Using change_source helps not loose the hold
+ * on the media resource when a new input is selected.
+ *
  * Note: 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.
@@ -381,6 +391,8 @@ struct media_device {
 	int (*enable_source)(struct media_entity *entity,
 			     struct media_pipeline *pipe);
 	void (*disable_source)(struct media_entity *entity);
+	int (*change_source)(struct media_entity *entity,
+			     struct media_pipeline *pipe);
 
 	int (*link_notify)(struct media_link *link, u32 flags,
 			   unsigned int notification);
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] media add change_source handler support Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-10 06:10 +0100
  [PATCH 1/4] media: add change_source handler function pointer Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-10 06:10 +0100
  [PATCH 2/4] media: v4l2-mc add v4l_change_media_source() to invoke change_source Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-10 06:10 +0100
  [PATCH 4/4] media: au0828 change vidioc_s_input() to call v4l_change_media_source() Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-10 06:10 +0100
  [PATCH 3/4] media: au0828 add media device change_source handler Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-10 06:10 +0100

csiph-web