summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vsp1
diff options
context:
space:
mode:
authorLaurent Pinchart2014-05-22 00:00:05 +0200
committerMauro Carvalho Chehab2014-07-17 17:44:54 +0200
commita1606102dafe6942905e97a88ceea9a60e1a2c7d (patch)
treeda87134f4639e60064f0567c2dd2807821837efb /drivers/media/platform/vsp1
parent[media] v4l: vsp1: Setup control handler automatically at stream on time (diff)
downloadkernel-qcow2-linux-a1606102dafe6942905e97a88ceea9a60e1a2c7d.tar.gz
kernel-qcow2-linux-a1606102dafe6942905e97a88ceea9a60e1a2c7d.tar.xz
kernel-qcow2-linux-a1606102dafe6942905e97a88ceea9a60e1a2c7d.zip
[media] v4l: vsp1: sru: Fix the intensity control default value
The default value isn't set and defaults to 0, which isn't in the 1-6 min-max range. Fix it by setting the default value to 1. This shoud have been caught when checking the control handler error field at initialization time, but the check was missing. Add it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/vsp1')
-rw-r--r--drivers/media/platform/vsp1/vsp1_sru.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c
index aa0e04c56f3f..18e127accf25 100644
--- a/drivers/media/platform/vsp1/vsp1_sru.c
+++ b/drivers/media/platform/vsp1/vsp1_sru.c
@@ -67,6 +67,7 @@ static const struct v4l2_ctrl_config sru_intensity_control = {
.type = V4L2_CTRL_TYPE_INTEGER,
.min = 1,
.max = 6,
+ .def = 1,
.step = 1,
};
@@ -348,8 +349,17 @@ struct vsp1_sru *vsp1_sru_create(struct vsp1_device *vsp1)
/* Initialize the control handler. */
v4l2_ctrl_handler_init(&sru->ctrls, 1);
v4l2_ctrl_new_custom(&sru->ctrls, &sru_intensity_control, NULL);
- v4l2_ctrl_handler_setup(&sru->ctrls);
+
sru->entity.subdev.ctrl_handler = &sru->ctrls;
+ if (sru->ctrls.error) {
+ dev_err(vsp1->dev, "sru: failed to initialize controls\n");
+ ret = sru->ctrls.error;
+ vsp1_entity_destroy(&sru->entity);
+ return ERR_PTR(ret);
+ }
+
+ v4l2_ctrl_handler_setup(&sru->ctrls);
+
return sru;
}