aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2012-08-24 10:36:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-22 08:33:18 -0500
commit1438be56ade16653584f70a2e2a1c11197291271 (patch)
tree33a9d9fc6da17135ea4788f40edf63132a382181 /drivers/media/platform
parent0dc2d8496191510ab237bff969480d8318705625 (diff)
[media] V4L: soc_camera: allow reading from video device if supported
Try reading on video device. If the camera bus driver supports reading we can try it and return the result. Also add a debug line. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 6f76ada1b2d8..4e3735679f17 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -645,11 +645,17 @@ static ssize_t soc_camera_read(struct file *file, char __user *buf,
645 size_t count, loff_t *ppos) 645 size_t count, loff_t *ppos)
646{ 646{
647 struct soc_camera_device *icd = file->private_data; 647 struct soc_camera_device *icd = file->private_data;
648 int err = -EINVAL; 648 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
649
650 dev_dbg(icd->pdev, "read called, buf %p\n", buf);
651
652 if (ici->ops->init_videobuf2 && icd->vb2_vidq.io_modes & VB2_READ)
653 return vb2_read(&icd->vb2_vidq, buf, count, ppos,
654 file->f_flags & O_NONBLOCK);
649 655
650 dev_err(icd->pdev, "camera device read not implemented\n"); 656 dev_err(icd->pdev, "camera device read not implemented\n");
651 657
652 return err; 658 return -EINVAL;
653} 659}
654 660
655static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma) 661static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma)