summaryrefslogtreecommitdiffstats
path: root/include/media/soc_camera.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-02-07 22:09:30 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 00:32:15 +0100
commit8eb4476d44b39fe2f5829de030328223bda2abaf (patch)
treee5117628482ccefecc1555442b8b51813350e3f0 /include/media/soc_camera.h
parent[media] V4L: soc-camera: extend to also support videobuf2 (diff)
downloadlinux-8eb4476d44b39fe2f5829de030328223bda2abaf.tar.xz
linux-8eb4476d44b39fe2f5829de030328223bda2abaf.zip
[media] V4L: soc-camera: add helper functions for videobuf queue handling
Add two helper inline functions to retrieve soc-camera device context from videobuf and videobuf2 queue pointers. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/soc_camera.h')
-rw-r--r--include/media/soc_camera.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index e29ff74fbe32..6e96b2657b5c 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -306,6 +306,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);