Skip to content

Commit

Permalink
[media] V4L: soc-camera: add helper functions for videobuf queue hand…
Browse files Browse the repository at this point in the history
…ling

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>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Mar 21, 2011
1 parent 592c2ab commit 8eb4476
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/media/soc_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8eb4476

Please sign in to comment.