diff options
author | Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | 2012-05-06 06:03:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-20 11:47:54 -0400 |
commit | 06b491fb9a8a13225d6c9fd798b5feb92f26d126 (patch) | |
tree | 91093a912ef58f45a1be42f94573597062f56937 /drivers | |
parent | b8cc8d7a5719754d39a9f3b4d9752389651df58a (diff) |
[media] smiapp: Use v4l2_ctrl_new_int_menu() instead of v4l2_ctrl_new_custom()
Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/smiapp/smiapp-core.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c index ffc6eb71fe06..f518026cb67b 100644 --- a/drivers/media/video/smiapp/smiapp-core.c +++ b/drivers/media/video/smiapp/smiapp-core.c | |||
@@ -508,7 +508,7 @@ static const struct v4l2_ctrl_ops smiapp_ctrl_ops = { | |||
508 | static int smiapp_init_controls(struct smiapp_sensor *sensor) | 508 | static int smiapp_init_controls(struct smiapp_sensor *sensor) |
509 | { | 509 | { |
510 | struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); | 510 | struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); |
511 | struct v4l2_ctrl_config cfg; | 511 | unsigned int max; |
512 | int rval; | 512 | int rval; |
513 | 513 | ||
514 | rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 7); | 514 | rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 7); |
@@ -572,17 +572,12 @@ static int smiapp_init_controls(struct smiapp_sensor *sensor) | |||
572 | goto error; | 572 | goto error; |
573 | sensor->src->ctrl_handler.lock = &sensor->mutex; | 573 | sensor->src->ctrl_handler.lock = &sensor->mutex; |
574 | 574 | ||
575 | memset(&cfg, 0, sizeof(cfg)); | 575 | for (max = 0; sensor->platform_data->op_sys_clock[max + 1]; max++); |
576 | 576 | ||
577 | cfg.ops = &smiapp_ctrl_ops; | 577 | sensor->link_freq = v4l2_ctrl_new_int_menu( |
578 | cfg.id = V4L2_CID_LINK_FREQ; | 578 | &sensor->src->ctrl_handler, &smiapp_ctrl_ops, |
579 | cfg.type = V4L2_CTRL_TYPE_INTEGER_MENU; | 579 | V4L2_CID_LINK_FREQ, max, 0, |
580 | while (sensor->platform_data->op_sys_clock[cfg.max + 1]) | 580 | sensor->platform_data->op_sys_clock); |
581 | cfg.max++; | ||
582 | cfg.qmenu_int = sensor->platform_data->op_sys_clock; | ||
583 | |||
584 | sensor->link_freq = v4l2_ctrl_new_custom( | ||
585 | &sensor->src->ctrl_handler, &cfg, NULL); | ||
586 | 581 | ||
587 | sensor->pixel_rate_csi = v4l2_ctrl_new_std( | 582 | sensor->pixel_rate_csi = v4l2_ctrl_new_std( |
588 | &sensor->src->ctrl_handler, &smiapp_ctrl_ops, | 583 | &sensor->src->ctrl_handler, &smiapp_ctrl_ops, |