diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-01-29 10:44:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:15 -0400 |
commit | 592c2aba266ca5be0dce300d0400817d943d49af (patch) | |
tree | 91f36e6afca6a010ee5ac5ac2fe46a2559104e13 /include/media | |
parent | bd94f588283b167f7fa8c2dc2164dcd2f4a4a7a5 (diff) |
[media] V4L: soc-camera: extend to also support videobuf2
Extend soc-camera core to also support the videobuf2 API.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/soc_camera.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 09b827192ae7..e29ff74fbe32 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
18 | #include <linux/videodev2.h> | 18 | #include <linux/videodev2.h> |
19 | #include <media/videobuf-core.h> | 19 | #include <media/videobuf-core.h> |
20 | #include <media/videobuf2-core.h> | ||
20 | #include <media/v4l2-device.h> | 21 | #include <media/v4l2-device.h> |
21 | 22 | ||
22 | extern struct bus_type soc_camera_bus_type; | 23 | extern struct bus_type soc_camera_bus_type; |
@@ -44,7 +45,10 @@ struct soc_camera_device { | |||
44 | int use_count; | 45 | int use_count; |
45 | struct mutex video_lock; /* Protects device data */ | 46 | struct mutex video_lock; /* Protects device data */ |
46 | struct file *streamer; /* stream owner */ | 47 | struct file *streamer; /* stream owner */ |
47 | struct videobuf_queue vb_vidq; | 48 | union { |
49 | struct videobuf_queue vb_vidq; | ||
50 | struct vb2_queue vb2_vidq; | ||
51 | }; | ||
48 | }; | 52 | }; |
49 | 53 | ||
50 | struct soc_camera_host { | 54 | struct soc_camera_host { |
@@ -78,6 +82,8 @@ struct soc_camera_host_ops { | |||
78 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 82 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
79 | void (*init_videobuf)(struct videobuf_queue *, | 83 | void (*init_videobuf)(struct videobuf_queue *, |
80 | struct soc_camera_device *); | 84 | struct soc_camera_device *); |
85 | int (*init_videobuf2)(struct vb2_queue *, | ||
86 | struct soc_camera_device *); | ||
81 | int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); | 87 | int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); |
82 | int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); | 88 | int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); |
83 | int (*set_bus_param)(struct soc_camera_device *, __u32); | 89 | int (*set_bus_param)(struct soc_camera_device *, __u32); |
@@ -300,4 +306,7 @@ static inline struct video_device *soc_camera_i2c_to_vdev(struct i2c_client *cli | |||
300 | return icd->vdev; | 306 | return icd->vdev; |
301 | } | 307 | } |
302 | 308 | ||
309 | void soc_camera_lock(struct vb2_queue *vq); | ||
310 | void soc_camera_unlock(struct vb2_queue *vq); | ||
311 | |||
303 | #endif | 312 | #endif |