diff mbox

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

Message ID Pine.LNX.4.64.1102180905220.1851@axis700.grange (mailing list archive)
State RFC
Headers show

Commit Message

Guennadi Liakhovetski Feb. 18, 2011, 8:13 a.m. UTC
None
diff mbox

Patch

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);