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


Groups > linux.kernel > #1303054 > unrolled thread

[PATCH 09/31] media: v4l2-core add v4l_vb2q_enable_media_tuner() helper

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2016-01-06 21:40 +0100
Last post2016-01-06 21:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 09/31] media: v4l2-core add v4l_vb2q_enable_media_tuner() helper Shuah Khan <shuahkh@osg.samsung.com> - 2016-01-06 21:40 +0100

#1303054 — [PATCH 09/31] media: v4l2-core add v4l_vb2q_enable_media_tuner() helper

FromShuah Khan <shuahkh@osg.samsung.com>
Date2016-01-06 21:40 +0100
Subject[PATCH 09/31] media: v4l2-core add v4l_vb2q_enable_media_tuner() helper
Message-ID<qO32a-63K-27@gated-at.bofh.it>
Add a new v4l_vb2q_enable_media_tuner() wrapper function
to be called from v4l2-core to enable the media tuner with
videobuf2 queue, when the calling frunction has the videobuf2
queue and doesn't have the struct video_device associated with
the queue handy as in the case of vb2_core_streamon(). This
function simply calls v4l_enable_media_tuner() passing in the
pointer to struct video_device.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 drivers/media/v4l2-core/v4l2-dev.c | 21 +++++++++++++++++++++
 include/media/v4l2-dev.h           |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index f06da6e..9ef675a 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -30,6 +30,7 @@
 #include <media/v4l2-common.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
+#include <media/videobuf2-core.h>
 
 #define VIDEO_NUM_DEVICES	256
 #define VIDEO_NAME              "video4linux"
@@ -261,6 +262,26 @@ void v4l_disable_media_tuner(struct video_device *vdev)
 }
 EXPORT_SYMBOL_GPL(v4l_disable_media_tuner);
 
+/**
+ * v4l_vb2q_enable_media_tuner - Wrapper for v4l_enable_media_tuner()
+ * @q:         videobuf2 queue
+ *
+ * This function is intended to be called from v4l2-core
+ * to enable the media tuner with videobuf2 queue, when
+ * the calling frunction has the videobuf2 queue and doesn't
+ * have the struct video_device associated with the
+ * queue handy as in the case of vb2_core_streamon(). This
+ * function simply calls v4l_enable_media_tuner() passing
+ * in the pointer to struct video_device.
+ */
+int v4l_vb2q_enable_media_tuner(struct vb2_queue *q)
+{
+	struct v4l2_fh *fh = q->owner;
+
+	return v4l_enable_media_tuner(fh->vdev);
+}
+EXPORT_SYMBOL_GPL(v4l_vb2q_enable_media_tuner);
+
 /* Priority handling */
 
 static inline bool prio_is_valid(enum v4l2_priority prio)
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 68999a3..1948097 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -179,6 +179,7 @@ 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);
+int v4l_vb2q_enable_media_tuner(struct vb2_queue *q);
 
 /* 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web