diff options
Diffstat (limited to 'drivers/media/video/soc_camera.c')
-rw-r--r-- | drivers/media/video/soc_camera.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 6b3fbcca7747..80f6bfa2632b 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
@@ -781,6 +781,32 @@ static int soc_camera_s_crop(struct file *file, void *fh, | |||
781 | return ret; | 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 | static int soc_camera_g_chip_ident(struct file *file, void *fh, | 810 | static int soc_camera_g_chip_ident(struct file *file, void *fh, |
785 | struct v4l2_dbg_chip_ident *id) | 811 | struct v4l2_dbg_chip_ident *id) |
786 | { | 812 | { |
@@ -846,10 +872,8 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd, | |||
846 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 872 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
847 | struct i2c_adapter *adap = i2c_get_adapter(icl->i2c_adapter_id); | 873 | struct i2c_adapter *adap = i2c_get_adapter(icl->i2c_adapter_id); |
848 | struct v4l2_subdev *subdev; | 874 | struct v4l2_subdev *subdev; |
849 | int ret; | ||
850 | 875 | ||
851 | if (!adap) { | 876 | if (!adap) { |
852 | ret = -ENODEV; | ||
853 | dev_err(&icd->dev, "Cannot get I2C adapter #%d. No driver?\n", | 877 | dev_err(&icd->dev, "Cannot get I2C adapter #%d. No driver?\n", |
854 | icl->i2c_adapter_id); | 878 | icl->i2c_adapter_id); |
855 | goto ei2cga; | 879 | goto ei2cga; |
@@ -859,10 +883,8 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd, | |||
859 | 883 | ||
860 | subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, | 884 | subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, |
861 | icl->module_name, icl->board_info, NULL); | 885 | icl->module_name, icl->board_info, NULL); |
862 | if (!subdev) { | 886 | if (!subdev) |
863 | ret = -ENOMEM; | ||
864 | goto ei2cnd; | 887 | goto ei2cnd; |
865 | } | ||
866 | 888 | ||
867 | client = subdev->priv; | 889 | client = subdev->priv; |
868 | 890 | ||
@@ -873,7 +895,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd, | |||
873 | ei2cnd: | 895 | ei2cnd: |
874 | i2c_put_adapter(adap); | 896 | i2c_put_adapter(adap); |
875 | ei2cga: | 897 | ei2cga: |
876 | return ret; | 898 | return -ENODEV; |
877 | } | 899 | } |
878 | 900 | ||
879 | static void soc_camera_free_i2c(struct soc_camera_device *icd) | 901 | static void soc_camera_free_i2c(struct soc_camera_device *icd) |
@@ -1260,6 +1282,8 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = { | |||
1260 | .vidioc_cropcap = soc_camera_cropcap, | 1282 | .vidioc_cropcap = soc_camera_cropcap, |
1261 | .vidioc_g_crop = soc_camera_g_crop, | 1283 | .vidioc_g_crop = soc_camera_g_crop, |
1262 | .vidioc_s_crop = soc_camera_s_crop, | 1284 | .vidioc_s_crop = soc_camera_s_crop, |
1285 | .vidioc_g_parm = soc_camera_g_parm, | ||
1286 | .vidioc_s_parm = soc_camera_s_parm, | ||
1263 | .vidioc_g_chip_ident = soc_camera_g_chip_ident, | 1287 | .vidioc_g_chip_ident = soc_camera_g_chip_ident, |
1264 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1288 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1265 | .vidioc_g_register = soc_camera_g_register, | 1289 | .vidioc_g_register = soc_camera_g_register, |