aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/soc_camera
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-09-05 04:10:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-26 10:02:25 -0400
commit4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86 (patch)
treef2ba0120024627256917dc05a2d7c509ac056011 /drivers/media/i2c/soc_camera
parent3f70e1f598a6be4277e71516a98457fd3bddfbd0 (diff)
[media] v4l2: make vidioc_s_crop const
Write-only ioctls should have a const argument in the ioctl op. Do this conversion for vidioc_s_crop. Adding const for write-only ioctls was decided during the 2012 Media Workshop. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/i2c/soc_camera')
-rw-r--r--drivers/media/i2c/soc_camera/mt9m001.c2
-rw-r--r--drivers/media/i2c/soc_camera/mt9m111.c2
-rw-r--r--drivers/media/i2c/soc_camera/mt9t031.c2
-rw-r--r--drivers/media/i2c/soc_camera/mt9t112.c4
-rw-r--r--drivers/media/i2c/soc_camera/mt9v022.c2
-rw-r--r--drivers/media/i2c/soc_camera/ov5642.c20
-rw-r--r--drivers/media/i2c/soc_camera/ov6650.c32
-rw-r--r--drivers/media/i2c/soc_camera/rj54n1cb0c.c4
8 files changed, 34 insertions, 34 deletions
diff --git a/drivers/media/i2c/soc_camera/mt9m001.c b/drivers/media/i2c/soc_camera/mt9m001.c
index d85be41ffa1d..19f8a07764f9 100644
--- a/drivers/media/i2c/soc_camera/mt9m001.c
+++ b/drivers/media/i2c/soc_camera/mt9m001.c
@@ -171,7 +171,7 @@ static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable)
171 return 0; 171 return 0;
172} 172}
173 173
174static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 174static int mt9m001_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
175{ 175{
176 struct i2c_client *client = v4l2_get_subdevdata(sd); 176 struct i2c_client *client = v4l2_get_subdevdata(sd);
177 struct mt9m001 *mt9m001 = to_mt9m001(client); 177 struct mt9m001 *mt9m001 = to_mt9m001(client);
diff --git a/drivers/media/i2c/soc_camera/mt9m111.c b/drivers/media/i2c/soc_camera/mt9m111.c
index 938c5c390eec..62fd94af599b 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -383,7 +383,7 @@ static int mt9m111_reset(struct mt9m111 *mt9m111)
383 return ret; 383 return ret;
384} 384}
385 385
386static int mt9m111_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 386static int mt9m111_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
387{ 387{
388 struct v4l2_rect rect = a->c; 388 struct v4l2_rect rect = a->c;
389 struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev); 389 struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev);
diff --git a/drivers/media/i2c/soc_camera/mt9t031.c b/drivers/media/i2c/soc_camera/mt9t031.c
index d74607adc585..40800b10a080 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -294,7 +294,7 @@ static int mt9t031_set_params(struct i2c_client *client,
294 return ret < 0 ? ret : 0; 294 return ret < 0 ? ret : 0;
295} 295}
296 296
297static int mt9t031_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 297static int mt9t031_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
298{ 298{
299 struct v4l2_rect rect = a->c; 299 struct v4l2_rect rect = a->c;
300 struct i2c_client *client = v4l2_get_subdevdata(sd); 300 struct i2c_client *client = v4l2_get_subdevdata(sd);
diff --git a/drivers/media/i2c/soc_camera/mt9t112.c b/drivers/media/i2c/soc_camera/mt9t112.c
index 9ba428ede516..de7cd836b0a2 100644
--- a/drivers/media/i2c/soc_camera/mt9t112.c
+++ b/drivers/media/i2c/soc_camera/mt9t112.c
@@ -907,11 +907,11 @@ static int mt9t112_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
907 return 0; 907 return 0;
908} 908}
909 909
910static int mt9t112_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 910static int mt9t112_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
911{ 911{
912 struct i2c_client *client = v4l2_get_subdevdata(sd); 912 struct i2c_client *client = v4l2_get_subdevdata(sd);
913 struct mt9t112_priv *priv = to_mt9t112(client); 913 struct mt9t112_priv *priv = to_mt9t112(client);
914 struct v4l2_rect *rect = &a->c; 914 const struct v4l2_rect *rect = &a->c;
915 915
916 return mt9t112_set_params(priv, rect, priv->format->code); 916 return mt9t112_set_params(priv, rect, priv->format->code);
917} 917}
diff --git a/drivers/media/i2c/soc_camera/mt9v022.c b/drivers/media/i2c/soc_camera/mt9v022.c
index 350d0d854447..13057b966ee9 100644
--- a/drivers/media/i2c/soc_camera/mt9v022.c
+++ b/drivers/media/i2c/soc_camera/mt9v022.c
@@ -237,7 +237,7 @@ static int mt9v022_s_stream(struct v4l2_subdev *sd, int enable)
237 return 0; 237 return 0;
238} 238}
239 239
240static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 240static int mt9v022_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
241{ 241{
242 struct i2c_client *client = v4l2_get_subdevdata(sd); 242 struct i2c_client *client = v4l2_get_subdevdata(sd);
243 struct mt9v022 *mt9v022 = to_mt9v022(client); 243 struct mt9v022 *mt9v022 = to_mt9v022(client);
diff --git a/drivers/media/i2c/soc_camera/ov5642.c b/drivers/media/i2c/soc_camera/ov5642.c
index d886c0b9ce44..8577e0cfb7fe 100644
--- a/drivers/media/i2c/soc_camera/ov5642.c
+++ b/drivers/media/i2c/soc_camera/ov5642.c
@@ -865,24 +865,24 @@ static int ov5642_g_chip_ident(struct v4l2_subdev *sd,
865 return 0; 865 return 0;
866} 866}
867 867
868static int ov5642_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 868static int ov5642_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
869{ 869{
870 struct i2c_client *client = v4l2_get_subdevdata(sd); 870 struct i2c_client *client = v4l2_get_subdevdata(sd);
871 struct ov5642 *priv = to_ov5642(client); 871 struct ov5642 *priv = to_ov5642(client);
872 struct v4l2_rect *rect = &a->c; 872 struct v4l2_rect rect = a->c;
873 int ret; 873 int ret;
874 874
875 v4l_bound_align_image(&rect->width, 48, OV5642_MAX_WIDTH, 1, 875 v4l_bound_align_image(&rect.width, 48, OV5642_MAX_WIDTH, 1,
876 &rect->height, 32, OV5642_MAX_HEIGHT, 1, 0); 876 &rect.height, 32, OV5642_MAX_HEIGHT, 1, 0);
877 877
878 priv->crop_rect.width = rect->width; 878 priv->crop_rect.width = rect.width;
879 priv->crop_rect.height = rect->height; 879 priv->crop_rect.height = rect.height;
880 priv->total_width = rect->width + BLANKING_EXTRA_WIDTH; 880 priv->total_width = rect.width + BLANKING_EXTRA_WIDTH;
881 priv->total_height = max_t(int, rect->height + 881 priv->total_height = max_t(int, rect.height +
882 BLANKING_EXTRA_HEIGHT, 882 BLANKING_EXTRA_HEIGHT,
883 BLANKING_MIN_HEIGHT); 883 BLANKING_MIN_HEIGHT);
884 priv->crop_rect.width = rect->width; 884 priv->crop_rect.width = rect.width;
885 priv->crop_rect.height = rect->height; 885 priv->crop_rect.height = rect.height;
886 886
887 ret = ov5642_write_array(client, ov5642_default_regs_init); 887 ret = ov5642_write_array(client, ov5642_default_regs_init);
888 if (!ret) 888 if (!ret)
diff --git a/drivers/media/i2c/soc_camera/ov6650.c b/drivers/media/i2c/soc_camera/ov6650.c
index 65b031f333b7..e87feb0881e3 100644
--- a/drivers/media/i2c/soc_camera/ov6650.c
+++ b/drivers/media/i2c/soc_camera/ov6650.c
@@ -451,42 +451,42 @@ static int ov6650_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
451 return 0; 451 return 0;
452} 452}
453 453
454static int ov6650_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 454static int ov6650_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
455{ 455{
456 struct i2c_client *client = v4l2_get_subdevdata(sd); 456 struct i2c_client *client = v4l2_get_subdevdata(sd);
457 struct ov6650 *priv = to_ov6650(client); 457 struct ov6650 *priv = to_ov6650(client);
458 struct v4l2_rect *rect = &a->c; 458 struct v4l2_rect rect = a->c;
459 int ret; 459 int ret;
460 460
461 if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 461 if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
462 return -EINVAL; 462 return -EINVAL;
463 463
464 rect->left = ALIGN(rect->left, 2); 464 rect.left = ALIGN(rect.left, 2);
465 rect->width = ALIGN(rect->width, 2); 465 rect.width = ALIGN(rect.width, 2);
466 rect->top = ALIGN(rect->top, 2); 466 rect.top = ALIGN(rect.top, 2);
467 rect->height = ALIGN(rect->height, 2); 467 rect.height = ALIGN(rect.height, 2);
468 soc_camera_limit_side(&rect->left, &rect->width, 468 soc_camera_limit_side(&rect.left, &rect.width,
469 DEF_HSTRT << 1, 2, W_CIF); 469 DEF_HSTRT << 1, 2, W_CIF);
470 soc_camera_limit_side(&rect->top, &rect->height, 470 soc_camera_limit_side(&rect.top, &rect.height,
471 DEF_VSTRT << 1, 2, H_CIF); 471 DEF_VSTRT << 1, 2, H_CIF);
472 472
473 ret = ov6650_reg_write(client, REG_HSTRT, rect->left >> 1); 473 ret = ov6650_reg_write(client, REG_HSTRT, rect.left >> 1);
474 if (!ret) { 474 if (!ret) {
475 priv->rect.left = rect->left; 475 priv->rect.left = rect.left;
476 ret = ov6650_reg_write(client, REG_HSTOP, 476 ret = ov6650_reg_write(client, REG_HSTOP,
477 (rect->left + rect->width) >> 1); 477 (rect.left + rect.width) >> 1);
478 } 478 }
479 if (!ret) { 479 if (!ret) {
480 priv->rect.width = rect->width; 480 priv->rect.width = rect.width;
481 ret = ov6650_reg_write(client, REG_VSTRT, rect->top >> 1); 481 ret = ov6650_reg_write(client, REG_VSTRT, rect.top >> 1);
482 } 482 }
483 if (!ret) { 483 if (!ret) {
484 priv->rect.top = rect->top; 484 priv->rect.top = rect.top;
485 ret = ov6650_reg_write(client, REG_VSTOP, 485 ret = ov6650_reg_write(client, REG_VSTOP,
486 (rect->top + rect->height) >> 1); 486 (rect.top + rect.height) >> 1);
487 } 487 }
488 if (!ret) 488 if (!ret)
489 priv->rect.height = rect->height; 489 priv->rect.height = rect.height;
490 490
491 return ret; 491 return ret;
492} 492}
diff --git a/drivers/media/i2c/soc_camera/rj54n1cb0c.c b/drivers/media/i2c/soc_camera/rj54n1cb0c.c
index 32226c9024f9..02f0400051d9 100644
--- a/drivers/media/i2c/soc_camera/rj54n1cb0c.c
+++ b/drivers/media/i2c/soc_camera/rj54n1cb0c.c
@@ -536,11 +536,11 @@ static int rj54n1_commit(struct i2c_client *client)
536static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h, 536static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
537 s32 *out_w, s32 *out_h); 537 s32 *out_w, s32 *out_h);
538 538
539static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) 539static int rj54n1_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
540{ 540{
541 struct i2c_client *client = v4l2_get_subdevdata(sd); 541 struct i2c_client *client = v4l2_get_subdevdata(sd);
542 struct rj54n1 *rj54n1 = to_rj54n1(client); 542 struct rj54n1 *rj54n1 = to_rj54n1(client);
543 struct v4l2_rect *rect = &a->c; 543 const struct v4l2_rect *rect = &a->c;
544 int dummy = 0, output_w, output_h, 544 int dummy = 0, output_w, output_h,
545 input_w = rect->width, input_h = rect->height; 545 input_w = rect->width, input_h = rect->height;
546 int ret; 546 int ret;