Commit c9f6ef69865ede81265c808227fc4fe9c925319a
Committed by
Mauro Carvalho Chehab
1 parent
d74f841c32
Exists in
master
and in
7 other branches
soc-camera: add support for VIDIOC_S_PARM and VIDIOC_G_PARM ioctls
Just pass VIDIOC_S_PARM and VIDIOC_G_PARM down to host drivers. So far no special handling in soc-camera core. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Showing 2 changed files with 30 additions and 0 deletions Side-by-side Diff
drivers/media/video/soc_camera.c
... | ... | @@ -781,6 +781,32 @@ |
781 | 781 | return ret; |
782 | 782 | } |
783 | 783 | |
784 | +static int soc_camera_g_parm(struct file *file, void *fh, | |
785 | + struct v4l2_streamparm *a) | |
786 | +{ | |
787 | + struct soc_camera_file *icf = file->private_data; | |
788 | + struct soc_camera_device *icd = icf->icd; | |
789 | + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | |
790 | + | |
791 | + if (ici->ops->get_parm) | |
792 | + return ici->ops->get_parm(icd, a); | |
793 | + | |
794 | + return -ENOIOCTLCMD; | |
795 | +} | |
796 | + | |
797 | +static int soc_camera_s_parm(struct file *file, void *fh, | |
798 | + struct v4l2_streamparm *a) | |
799 | +{ | |
800 | + struct soc_camera_file *icf = file->private_data; | |
801 | + struct soc_camera_device *icd = icf->icd; | |
802 | + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | |
803 | + | |
804 | + if (ici->ops->set_parm) | |
805 | + return ici->ops->set_parm(icd, a); | |
806 | + | |
807 | + return -ENOIOCTLCMD; | |
808 | +} | |
809 | + | |
784 | 810 | static int soc_camera_g_chip_ident(struct file *file, void *fh, |
785 | 811 | struct v4l2_dbg_chip_ident *id) |
786 | 812 | { |
... | ... | @@ -1256,6 +1282,8 @@ |
1256 | 1282 | .vidioc_cropcap = soc_camera_cropcap, |
1257 | 1283 | .vidioc_g_crop = soc_camera_g_crop, |
1258 | 1284 | .vidioc_s_crop = soc_camera_s_crop, |
1285 | + .vidioc_g_parm = soc_camera_g_parm, | |
1286 | + .vidioc_s_parm = soc_camera_s_parm, | |
1259 | 1287 | .vidioc_g_chip_ident = soc_camera_g_chip_ident, |
1260 | 1288 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1261 | 1289 | .vidioc_g_register = soc_camera_g_register, |
include/media/soc_camera.h
... | ... | @@ -81,6 +81,8 @@ |
81 | 81 | int (*set_bus_param)(struct soc_camera_device *, __u32); |
82 | 82 | int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); |
83 | 83 | int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); |
84 | + int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | |
85 | + int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | |
84 | 86 | unsigned int (*poll)(struct file *, poll_table *); |
85 | 87 | const struct v4l2_queryctrl *controls; |
86 | 88 | int num_controls; |