[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>
This commit is contained in:
Guennadi Liakhovetski
2011-01-29 12:44:51 -03:00
committed by Mauro Carvalho Chehab
父節點 bd94f58828
當前提交 592c2aba26
共有 3 個文件被更改,包括 84 次插入18 次删除

查看文件

@@ -17,6 +17,7 @@
#include <linux/pm.h>
#include <linux/videodev2.h>
#include <media/videobuf-core.h>
#include <media/videobuf2-core.h>
#include <media/v4l2-device.h>
extern struct bus_type soc_camera_bus_type;
@@ -44,7 +45,10 @@ struct soc_camera_device {
int use_count;
struct mutex video_lock; /* Protects device data */
struct file *streamer; /* stream owner */
struct videobuf_queue vb_vidq;
union {
struct videobuf_queue vb_vidq;
struct vb2_queue vb2_vidq;
};
};
struct soc_camera_host {
@@ -78,6 +82,8 @@ struct soc_camera_host_ops {
int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
void (*init_videobuf)(struct videobuf_queue *,
struct soc_camera_device *);
int (*init_videobuf2)(struct vb2_queue *,
struct soc_camera_device *);
int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
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
return icd->vdev;
}
void soc_camera_lock(struct vb2_queue *vq);
void soc_camera_unlock(struct vb2_queue *vq);
#endif