[PATCH 1/4] V4L: soc-camera: add helper functions for videobuf queue handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add two helper inline functions to retrieve soc-camera device context
from videobuf and videobuf2 queue pointers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
---

This patch shall go in before sh-mobile-ceu conversion to vb2. It is 
already in my vb2 branch on git.linuxtv.org.

 include/media/soc_camera.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 9f10921..8aec72d 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -305,6 +305,16 @@ static inline struct video_device *soc_camera_i2c_to_vdev(struct i2c_client *cli
 	return icd->vdev;
 }
 
+static inline struct soc_camera_device *soc_camera_from_vb2q(struct vb2_queue *vq)
+{
+	return container_of(vq, struct soc_camera_device, vb2_vidq);
+}
+
+static inline struct soc_camera_device *soc_camera_from_vbq(struct videobuf_queue *vq)
+{
+	return container_of(vq, struct soc_camera_device, vb_vidq);
+}
+
 void soc_camera_lock(struct vb2_queue *vq);
 void soc_camera_unlock(struct vb2_queue *vq);
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux