[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e642fee6e443170b33a8c69fbc21b409f7be5583.1452105878.git.shuahkh@osg.samsung.com>
Date: Wed, 6 Jan 2016 13:26:57 -0700
From: Shuah Khan <shuahkh@....samsung.com>
To: mchehab@....samsung.com, tiwai@...e.com, clemens@...isch.de,
hans.verkuil@...co.com, laurent.pinchart@...asonboard.com,
sakari.ailus@...ux.intel.com, javier@....samsung.com
Cc: Shuah Khan <shuahkh@....samsung.com>, pawel@...iak.com,
m.szyprowski@...sung.com, kyungmin.park@...sung.com,
perex@...ex.cz, arnd@...db.de, dan.carpenter@...cle.com,
tvboxspy@...il.com, crope@....fi, ruchandani.tina@...il.com,
corbet@....net, chehabrafael@...il.com, k.kozlowski@...sung.com,
stefanr@...6.in-berlin.de, inki.dae@...sung.com,
jh1009.sung@...sung.com, elfring@...rs.sourceforge.net,
prabhakar.csengg@...il.com, sw0312.kim@...sung.com,
p.zabel@...gutronix.de, ricardo.ribalda@...il.com,
labbott@...oraproject.org, pierre-louis.bossart@...ux.intel.com,
ricard.wanderlof@...s.com, julian@...st.de, takamichiho@...il.com,
dominic.sacre@....de, misterpib@...il.com, daniel@...que.org,
gtmkramer@...all.nl, normalperson@...t.net, joe@...po.co.uk,
linuxbugs@...tgam.net, johan@...ud.se,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-api@...r.kernel.org, alsa-devel@...a-project.org
Subject: [PATCH 08/31] media: v4l-core add v4l_enable/disable_media_tuner() helper functions
Add a new interfaces to be used by v4l-core to invoke enable
source and disable_source handlers in the media_device. The
enable_source helper function invokes the enable_source handler
to find tuner entity connected to the decoder and check is it
is available or busy. If tuner is available, link is activated
and pipeline is started. The disable_source helper function
invokes the disable_source handler to deactivate and stop the
pipeline.
Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
---
drivers/media/v4l2-core/v4l2-dev.c | 27 +++++++++++++++++++++++++++
include/media/v4l2-dev.h | 4 ++++
2 files changed, 31 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index d8e5994..f06da6e 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -233,6 +233,33 @@ struct video_device *video_devdata(struct file *file)
}
EXPORT_SYMBOL(video_devdata);
+int v4l_enable_media_tuner(struct video_device *vdev)
+{
+#ifdef CONFIG_MEDIA_CONTROLLER
+ struct media_device *mdev = vdev->entity.graph_obj.mdev;
+ int ret;
+
+ if (!mdev || !mdev->enable_source)
+ return 0;
+ ret = mdev->enable_source(&vdev->entity, &vdev->pipe);
+ if (ret)
+ return -EBUSY;
+ return 0;
+#endif /* CONFIG_MEDIA_CONTROLLER */
+ return 0;
+}
+EXPORT_SYMBOL_GPL(v4l_enable_media_tuner);
+
+void v4l_disable_media_tuner(struct video_device *vdev)
+{
+#ifdef CONFIG_MEDIA_CONTROLLER
+ struct media_device *mdev = vdev->entity.graph_obj.mdev;
+
+ if (mdev && mdev->disable_source)
+ mdev->disable_source(&vdev->entity);
+#endif /* CONFIG_MEDIA_CONTROLLER */
+}
+EXPORT_SYMBOL_GPL(v4l_disable_media_tuner);
/* Priority handling */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index eeabf20..68999a3 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -87,6 +87,7 @@ struct video_device
#if defined(CONFIG_MEDIA_CONTROLLER)
struct media_entity entity;
struct media_intf_devnode *intf_devnode;
+ struct media_pipeline pipe;
#endif
/* device ops */
const struct v4l2_file_operations *fops;
@@ -176,6 +177,9 @@ void video_unregister_device(struct video_device *vdev);
latter can also be used for video_device->release(). */
struct video_device * __must_check video_device_alloc(void);
+int v4l_enable_media_tuner(struct video_device *vdev);
+void v4l_disable_media_tuner(struct video_device *vdev);
+
/* this release function frees the vdev pointer */
void video_device_release(struct video_device *vdev);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists