aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 10:46:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:19:07 -0400
commitc9c1f1c0dbe90b82939917fdc3e4c9ccad42342d (patch)
tree0a6605999055710b88c71c546f6b2507e675e845 /drivers/media/video
parent08590b9613f7f624fe3a052586eea2dbb3584b38 (diff)
V4L/DVB (12530): soc-camera: switch to using v4l2_subdev_call()
Use v4l2_subdev_call() instead of v4l2_device_call_until_err() in all host drivers and in soc-camera core. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/mx1_camera.c12
-rw-r--r--drivers/media/video/mx3_camera.c10
-rw-r--r--drivers/media/video/pxa_camera.c9
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c17
-rw-r--r--drivers/media/video/soc_camera.c30
5 files changed, 38 insertions, 40 deletions
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index add496fca4d3..ed7856bdad48 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -465,9 +465,7 @@ static void mx1_camera_remove_device(struct soc_camera_device *icd)
465static int mx1_camera_set_crop(struct soc_camera_device *icd, 465static int mx1_camera_set_crop(struct soc_camera_device *icd,
466 struct v4l2_crop *a) 466 struct v4l2_crop *a)
467{ 467{
468 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 468 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
469 struct device *control = to_soc_camera_control(icd);
470 struct v4l2_subdev *sd = dev_get_drvdata(control);
471 469
472 return v4l2_subdev_call(sd, video, s_crop, a); 470 return v4l2_subdev_call(sd, video, s_crop, a);
473} 471}
@@ -539,7 +537,7 @@ static int mx1_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
539static int mx1_camera_set_fmt(struct soc_camera_device *icd, 537static int mx1_camera_set_fmt(struct soc_camera_device *icd,
540 struct v4l2_format *f) 538 struct v4l2_format *f)
541{ 539{
542 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 540 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
543 const struct soc_camera_format_xlate *xlate; 541 const struct soc_camera_format_xlate *xlate;
544 struct v4l2_pix_format *pix = &f->fmt.pix; 542 struct v4l2_pix_format *pix = &f->fmt.pix;
545 int ret; 543 int ret;
@@ -550,7 +548,7 @@ static int mx1_camera_set_fmt(struct soc_camera_device *icd,
550 return -EINVAL; 548 return -EINVAL;
551 } 549 }
552 550
553 ret = v4l2_device_call_until_err(&ici->v4l2_dev, 0, video, s_fmt, f); 551 ret = v4l2_subdev_call(sd, video, s_fmt, f);
554 if (!ret) { 552 if (!ret) {
555 icd->buswidth = xlate->buswidth; 553 icd->buswidth = xlate->buswidth;
556 icd->current_fmt = xlate->host_fmt; 554 icd->current_fmt = xlate->host_fmt;
@@ -562,11 +560,11 @@ static int mx1_camera_set_fmt(struct soc_camera_device *icd,
562static int mx1_camera_try_fmt(struct soc_camera_device *icd, 560static int mx1_camera_try_fmt(struct soc_camera_device *icd,
563 struct v4l2_format *f) 561 struct v4l2_format *f)
564{ 562{
565 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 563 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
566 /* TODO: limit to mx1 hardware capabilities */ 564 /* TODO: limit to mx1 hardware capabilities */
567 565
568 /* limit to sensor capabilities */ 566 /* limit to sensor capabilities */
569 return v4l2_device_call_until_err(&ici->v4l2_dev, 0, video, try_fmt, f); 567 return v4l2_subdev_call(sd, video, try_fmt, f);
570} 568}
571 569
572static int mx1_camera_reqbufs(struct soc_camera_file *icf, 570static int mx1_camera_reqbufs(struct soc_camera_file *icf,
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index de7ebfbf0397..f7888f30da51 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -786,8 +786,7 @@ static int mx3_camera_set_crop(struct soc_camera_device *icd,
786 struct v4l2_rect *rect = &a->c; 786 struct v4l2_rect *rect = &a->c;
787 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 787 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
788 struct mx3_camera_dev *mx3_cam = ici->priv; 788 struct mx3_camera_dev *mx3_cam = ici->priv;
789 struct device *control = to_soc_camera_control(icd); 789 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
790 struct v4l2_subdev *sd = dev_get_drvdata(control);
791 790
792 /* 791 /*
793 * We now know pixel formats and can decide upon DMA-channel(s) 792 * We now know pixel formats and can decide upon DMA-channel(s)
@@ -809,6 +808,7 @@ static int mx3_camera_set_fmt(struct soc_camera_device *icd,
809{ 808{
810 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 809 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
811 struct mx3_camera_dev *mx3_cam = ici->priv; 810 struct mx3_camera_dev *mx3_cam = ici->priv;
811 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
812 const struct soc_camera_format_xlate *xlate; 812 const struct soc_camera_format_xlate *xlate;
813 struct v4l2_pix_format *pix = &f->fmt.pix; 813 struct v4l2_pix_format *pix = &f->fmt.pix;
814 struct v4l2_rect rect = { 814 struct v4l2_rect rect = {
@@ -837,7 +837,7 @@ static int mx3_camera_set_fmt(struct soc_camera_device *icd,
837 837
838 configure_geometry(mx3_cam, &rect); 838 configure_geometry(mx3_cam, &rect);
839 839
840 ret = v4l2_device_call_until_err(&ici->v4l2_dev, 0, video, s_fmt, f); 840 ret = v4l2_subdev_call(sd, video, s_fmt, f);
841 if (!ret) { 841 if (!ret) {
842 icd->buswidth = xlate->buswidth; 842 icd->buswidth = xlate->buswidth;
843 icd->current_fmt = xlate->host_fmt; 843 icd->current_fmt = xlate->host_fmt;
@@ -849,7 +849,7 @@ static int mx3_camera_set_fmt(struct soc_camera_device *icd,
849static int mx3_camera_try_fmt(struct soc_camera_device *icd, 849static int mx3_camera_try_fmt(struct soc_camera_device *icd,
850 struct v4l2_format *f) 850 struct v4l2_format *f)
851{ 851{
852 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 852 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
853 const struct soc_camera_format_xlate *xlate; 853 const struct soc_camera_format_xlate *xlate;
854 struct v4l2_pix_format *pix = &f->fmt.pix; 854 struct v4l2_pix_format *pix = &f->fmt.pix;
855 __u32 pixfmt = pix->pixelformat; 855 __u32 pixfmt = pix->pixelformat;
@@ -875,7 +875,7 @@ static int mx3_camera_try_fmt(struct soc_camera_device *icd,
875 /* camera has to see its format, but the user the original one */ 875 /* camera has to see its format, but the user the original one */
876 pix->pixelformat = xlate->cam_fmt->fourcc; 876 pix->pixelformat = xlate->cam_fmt->fourcc;
877 /* limit to sensor capabilities */ 877 /* limit to sensor capabilities */
878 ret = v4l2_device_call_until_err(&ici->v4l2_dev, 0, video, try_fmt, f); 878 ret = v4l2_subdev_call(sd, video, try_fmt, f);
879 pix->pixelformat = xlate->host_fmt->fourcc; 879 pix->pixelformat = xlate->host_fmt->fourcc;
880 880
881 field = pix->field; 881 field = pix->field;
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index c38ce84b944d..4bc2a4f81f79 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -1286,8 +1286,7 @@ static int pxa_camera_set_crop(struct soc_camera_device *icd,
1286 struct v4l2_rect *rect = &a->c; 1286 struct v4l2_rect *rect = &a->c;
1287 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1287 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
1288 struct pxa_camera_dev *pcdev = ici->priv; 1288 struct pxa_camera_dev *pcdev = ici->priv;
1289 struct device *control = to_soc_camera_control(icd); 1289 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1290 struct v4l2_subdev *sd = dev_get_drvdata(control);
1291 struct soc_camera_sense sense = { 1290 struct soc_camera_sense sense = {
1292 .master_clock = pcdev->mclk, 1291 .master_clock = pcdev->mclk,
1293 .pixel_clock_max = pcdev->ciclk / 4, 1292 .pixel_clock_max = pcdev->ciclk / 4,
@@ -1323,6 +1322,7 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
1323{ 1322{
1324 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1323 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
1325 struct pxa_camera_dev *pcdev = ici->priv; 1324 struct pxa_camera_dev *pcdev = ici->priv;
1325 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1326 const struct soc_camera_data_format *cam_fmt = NULL; 1326 const struct soc_camera_data_format *cam_fmt = NULL;
1327 const struct soc_camera_format_xlate *xlate = NULL; 1327 const struct soc_camera_format_xlate *xlate = NULL;
1328 struct soc_camera_sense sense = { 1328 struct soc_camera_sense sense = {
@@ -1346,7 +1346,7 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
1346 icd->sense = &sense; 1346 icd->sense = &sense;
1347 1347
1348 cam_f.fmt.pix.pixelformat = cam_fmt->fourcc; 1348 cam_f.fmt.pix.pixelformat = cam_fmt->fourcc;
1349 ret = v4l2_device_call_until_err(&ici->v4l2_dev, 0, video, s_fmt, f); 1349 ret = v4l2_subdev_call(sd, video, s_fmt, f);
1350 1350
1351 icd->sense = NULL; 1351 icd->sense = NULL;
1352 1352
@@ -1375,6 +1375,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
1375 struct v4l2_format *f) 1375 struct v4l2_format *f)
1376{ 1376{
1377 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1377 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
1378 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1378 const struct soc_camera_format_xlate *xlate; 1379 const struct soc_camera_format_xlate *xlate;
1379 struct v4l2_pix_format *pix = &f->fmt.pix; 1380 struct v4l2_pix_format *pix = &f->fmt.pix;
1380 __u32 pixfmt = pix->pixelformat; 1381 __u32 pixfmt = pix->pixelformat;
@@ -1404,7 +1405,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
1404 /* camera has to see its format, but the user the original one */ 1405 /* camera has to see its format, but the user the original one */
1405 pix->pixelformat = xlate->cam_fmt->fourcc; 1406 pix->pixelformat = xlate->cam_fmt->fourcc;
1406 /* limit to sensor capabilities */ 1407 /* limit to sensor capabilities */
1407 ret = v4l2_device_call_until_err(&ici->v4l2_dev, 0, video, try_fmt, f); 1408 ret = v4l2_subdev_call(sd, video, try_fmt, f);
1408 pix->pixelformat = xlate->host_fmt->fourcc; 1409 pix->pixelformat = xlate->host_fmt->fourcc;
1409 1410
1410 field = pix->field; 1411 field = pix->field;
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 726cf0e4dc23..28c3affe8828 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -854,8 +854,7 @@ static int sh_mobile_ceu_set_crop(struct soc_camera_device *icd,
854 struct v4l2_crop cam_crop; 854 struct v4l2_crop cam_crop;
855 struct v4l2_rect *cam_rect = &cam_crop.c, target, cam_max; 855 struct v4l2_rect *cam_rect = &cam_crop.c, target, cam_max;
856 struct sh_mobile_ceu_cam *cam = icd->host_priv; 856 struct sh_mobile_ceu_cam *cam = icd->host_priv;
857 struct device *control = to_soc_camera_control(icd); 857 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
858 struct v4l2_subdev *sd = dev_get_drvdata(control);
859 unsigned int hscale = pcdev->cflcr & 0xffff; 858 unsigned int hscale = pcdev->cflcr & 0xffff;
860 unsigned int vscale = (pcdev->cflcr >> 16) & 0xffff; 859 unsigned int vscale = (pcdev->cflcr >> 16) & 0xffff;
861 unsigned short width, height; 860 unsigned short width, height;
@@ -1016,6 +1015,7 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
1016 struct sh_mobile_ceu_dev *pcdev = ici->priv; 1015 struct sh_mobile_ceu_dev *pcdev = ici->priv;
1017 struct sh_mobile_ceu_cam *cam = icd->host_priv; 1016 struct sh_mobile_ceu_cam *cam = icd->host_priv;
1018 struct v4l2_pix_format *pix = &f->fmt.pix; 1017 struct v4l2_pix_format *pix = &f->fmt.pix;
1018 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1019 __u32 pixfmt = pix->pixelformat; 1019 __u32 pixfmt = pix->pixelformat;
1020 const struct soc_camera_format_xlate *xlate; 1020 const struct soc_camera_format_xlate *xlate;
1021 unsigned int width = pix->width, height = pix->height, tmp_w, tmp_h; 1021 unsigned int width = pix->width, height = pix->height, tmp_w, tmp_h;
@@ -1042,7 +1042,7 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
1042 } 1042 }
1043 1043
1044 pix->pixelformat = xlate->cam_fmt->fourcc; 1044 pix->pixelformat = xlate->cam_fmt->fourcc;
1045 ret = v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, video, s_fmt, f); 1045 ret = v4l2_subdev_call(sd, video, s_fmt, f);
1046 pix->pixelformat = pixfmt; 1046 pix->pixelformat = pixfmt;
1047 dev_dbg(&icd->dev, "Camera %d fmt %ux%u, requested %ux%u, max %ux%u\n", 1047 dev_dbg(&icd->dev, "Camera %d fmt %ux%u, requested %ux%u, max %ux%u\n",
1048 ret, pix->width, pix->height, width, height, 1048 ret, pix->width, pix->height, width, height,
@@ -1082,8 +1082,7 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
1082 pix->width = tmp_w; 1082 pix->width = tmp_w;
1083 pix->height = tmp_h; 1083 pix->height = tmp_h;
1084 pix->pixelformat = xlate->cam_fmt->fourcc; 1084 pix->pixelformat = xlate->cam_fmt->fourcc;
1085 ret = v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, 1085 ret = v4l2_subdev_call(sd, video, s_fmt, f);
1086 video, s_fmt, f);
1087 pix->pixelformat = pixfmt; 1086 pix->pixelformat = pixfmt;
1088 dev_dbg(&icd->dev, "Camera scaled to %ux%u\n", 1087 dev_dbg(&icd->dev, "Camera scaled to %ux%u\n",
1089 pix->width, pix->height); 1088 pix->width, pix->height);
@@ -1140,6 +1139,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
1140 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1139 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
1141 const struct soc_camera_format_xlate *xlate; 1140 const struct soc_camera_format_xlate *xlate;
1142 struct v4l2_pix_format *pix = &f->fmt.pix; 1141 struct v4l2_pix_format *pix = &f->fmt.pix;
1142 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1143 __u32 pixfmt = pix->pixelformat; 1143 __u32 pixfmt = pix->pixelformat;
1144 int width, height; 1144 int width, height;
1145 int ret; 1145 int ret;
@@ -1165,8 +1165,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
1165 pix->pixelformat = xlate->cam_fmt->fourcc; 1165 pix->pixelformat = xlate->cam_fmt->fourcc;
1166 1166
1167 /* limit to sensor capabilities */ 1167 /* limit to sensor capabilities */
1168 ret = v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, video, 1168 ret = v4l2_subdev_call(sd, video, try_fmt, f);
1169 try_fmt, f);
1170 pix->pixelformat = pixfmt; 1169 pix->pixelformat = pixfmt;
1171 if (ret < 0) 1170 if (ret < 0)
1172 return ret; 1171 return ret;
@@ -1182,9 +1181,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
1182 int tmp_w = pix->width, tmp_h = pix->height; 1181 int tmp_w = pix->width, tmp_h = pix->height;
1183 pix->width = 2560; 1182 pix->width = 2560;
1184 pix->height = 1920; 1183 pix->height = 1920;
1185 ret = v4l2_device_call_until_err(&ici->v4l2_dev, 1184 ret = v4l2_subdev_call(sd, video, try_fmt, f);
1186 (__u32)icd, video,
1187 try_fmt, f);
1188 if (ret < 0) { 1185 if (ret < 0) {
1189 /* Shouldn't actually happen... */ 1186 /* Shouldn't actually happen... */
1190 dev_err(&icd->dev, 1187 dev_err(&icd->dev,
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index d9ccc2866592..dd023bdb189e 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -152,9 +152,9 @@ static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)
152{ 152{
153 struct soc_camera_file *icf = file->private_data; 153 struct soc_camera_file *icf = file->private_data;
154 struct soc_camera_device *icd = icf->icd; 154 struct soc_camera_device *icd = icf->icd;
155 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 155 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
156 156
157 return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, s_std, *a); 157 return v4l2_subdev_call(sd, core, s_std, *a);
158} 158}
159 159
160static int soc_camera_reqbufs(struct file *file, void *priv, 160static int soc_camera_reqbufs(struct file *file, void *priv,
@@ -589,7 +589,7 @@ static int soc_camera_streamon(struct file *file, void *priv,
589{ 589{
590 struct soc_camera_file *icf = file->private_data; 590 struct soc_camera_file *icf = file->private_data;
591 struct soc_camera_device *icd = icf->icd; 591 struct soc_camera_device *icd = icf->icd;
592 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 592 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
593 int ret; 593 int ret;
594 594
595 WARN_ON(priv != file->private_data); 595 WARN_ON(priv != file->private_data);
@@ -599,7 +599,7 @@ static int soc_camera_streamon(struct file *file, void *priv,
599 599
600 mutex_lock(&icd->video_lock); 600 mutex_lock(&icd->video_lock);
601 601
602 v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, video, s_stream, 1); 602 v4l2_subdev_call(sd, video, s_stream, 1);
603 603
604 /* This calls buf_queue from host driver's videobuf_queue_ops */ 604 /* This calls buf_queue from host driver's videobuf_queue_ops */
605 ret = videobuf_streamon(&icf->vb_vidq); 605 ret = videobuf_streamon(&icf->vb_vidq);
@@ -614,7 +614,7 @@ static int soc_camera_streamoff(struct file *file, void *priv,
614{ 614{
615 struct soc_camera_file *icf = file->private_data; 615 struct soc_camera_file *icf = file->private_data;
616 struct soc_camera_device *icd = icf->icd; 616 struct soc_camera_device *icd = icf->icd;
617 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 617 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
618 618
619 WARN_ON(priv != file->private_data); 619 WARN_ON(priv != file->private_data);
620 620
@@ -627,7 +627,7 @@ static int soc_camera_streamoff(struct file *file, void *priv,
627 * remaining buffers. When the last buffer is freed, stop capture */ 627 * remaining buffers. When the last buffer is freed, stop capture */
628 videobuf_streamoff(&icf->vb_vidq); 628 videobuf_streamoff(&icf->vb_vidq);
629 629
630 v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, video, s_stream, 0); 630 v4l2_subdev_call(sd, video, s_stream, 0);
631 631
632 mutex_unlock(&icd->video_lock); 632 mutex_unlock(&icd->video_lock);
633 633
@@ -672,6 +672,7 @@ static int soc_camera_g_ctrl(struct file *file, void *priv,
672 struct soc_camera_file *icf = file->private_data; 672 struct soc_camera_file *icf = file->private_data;
673 struct soc_camera_device *icd = icf->icd; 673 struct soc_camera_device *icd = icf->icd;
674 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 674 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
675 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
675 int ret; 676 int ret;
676 677
677 WARN_ON(priv != file->private_data); 678 WARN_ON(priv != file->private_data);
@@ -695,7 +696,7 @@ static int soc_camera_g_ctrl(struct file *file, void *priv,
695 return ret; 696 return ret;
696 } 697 }
697 698
698 return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, g_ctrl, ctrl); 699 return v4l2_subdev_call(sd, core, g_ctrl, ctrl);
699} 700}
700 701
701static int soc_camera_s_ctrl(struct file *file, void *priv, 702static int soc_camera_s_ctrl(struct file *file, void *priv,
@@ -704,6 +705,7 @@ static int soc_camera_s_ctrl(struct file *file, void *priv,
704 struct soc_camera_file *icf = file->private_data; 705 struct soc_camera_file *icf = file->private_data;
705 struct soc_camera_device *icd = icf->icd; 706 struct soc_camera_device *icd = icf->icd;
706 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 707 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
708 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
707 int ret; 709 int ret;
708 710
709 WARN_ON(priv != file->private_data); 711 WARN_ON(priv != file->private_data);
@@ -714,7 +716,7 @@ static int soc_camera_s_ctrl(struct file *file, void *priv,
714 return ret; 716 return ret;
715 } 717 }
716 718
717 return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, s_ctrl, ctrl); 719 return v4l2_subdev_call(sd, core, s_ctrl, ctrl);
718} 720}
719 721
720static int soc_camera_cropcap(struct file *file, void *fh, 722static int soc_camera_cropcap(struct file *file, void *fh,
@@ -812,9 +814,9 @@ static int soc_camera_g_chip_ident(struct file *file, void *fh,
812{ 814{
813 struct soc_camera_file *icf = file->private_data; 815 struct soc_camera_file *icf = file->private_data;
814 struct soc_camera_device *icd = icf->icd; 816 struct soc_camera_device *icd = icf->icd;
815 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 817 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
816 818
817 return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, g_chip_ident, id); 819 return v4l2_subdev_call(sd, core, g_chip_ident, id);
818} 820}
819 821
820#ifdef CONFIG_VIDEO_ADV_DEBUG 822#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -823,9 +825,9 @@ static int soc_camera_g_register(struct file *file, void *fh,
823{ 825{
824 struct soc_camera_file *icf = file->private_data; 826 struct soc_camera_file *icf = file->private_data;
825 struct soc_camera_device *icd = icf->icd; 827 struct soc_camera_device *icd = icf->icd;
826 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 828 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
827 829
828 return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, g_register, reg); 830 return v4l2_subdev_call(sd, core, g_register, reg);
829} 831}
830 832
831static int soc_camera_s_register(struct file *file, void *fh, 833static int soc_camera_s_register(struct file *file, void *fh,
@@ -833,9 +835,9 @@ static int soc_camera_s_register(struct file *file, void *fh,
833{ 835{
834 struct soc_camera_file *icf = file->private_data; 836 struct soc_camera_file *icf = file->private_data;
835 struct soc_camera_device *icd = icf->icd; 837 struct soc_camera_device *icd = icf->icd;
836 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 838 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
837 839
838 return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, s_register, reg); 840 return v4l2_subdev_call(sd, core, s_register, reg);
839} 841}
840#endif 842#endif
841 843