039809e94edde678a4231288ca9602f759fb0d79
[openwrt/staging/stintel.git] /
1 From ea0b801a818e837e657c53687f03d62805e2e586 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 29 Apr 2020 21:47:25 +0100
4 Subject: [PATCH] media: i2c: ov5647: Neither analogue gain nor
5 exposure need EXECUTE_ON_WRITE
6
7 The controls for analogue gain and exposure were defined with
8 V4L2_CTRL_FLAG_EXECUTE_ON_WRITE. This is not required as we only need
9 to send changes to the sensor.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/media/i2c/ov5647.c | 27 ++++++++++++---------------
14 1 file changed, 12 insertions(+), 15 deletions(-)
15
16 --- a/drivers/media/i2c/ov5647.c
17 +++ b/drivers/media/i2c/ov5647.c
18 @@ -1472,7 +1472,6 @@ static int ov5647_probe(struct i2c_clien
19 struct v4l2_subdev *sd;
20 struct device_node *np = client->dev.of_node;
21 u32 xclk_freq;
22 - struct v4l2_ctrl *ctrl;
23 int hblank;
24
25 sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL);
26 @@ -1525,20 +1524,18 @@ static int ov5647_probe(struct i2c_clien
27 V4L2_EXPOSURE_MANUAL, /* max */
28 0, /* skip_mask */
29 V4L2_EXPOSURE_MANUAL); /* default */
30 - ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
31 - V4L2_CID_EXPOSURE,
32 - 4, /* min lines */
33 - 65535, /* max lines (4+8+4 bits)*/
34 - 1, /* step */
35 - 1000); /* default number of lines */
36 - ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE;
37 - ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
38 - V4L2_CID_ANALOGUE_GAIN,
39 - 16, /* min, 16 = 1.0x */
40 - 1023, /* max (10 bits) */
41 - 1, /* step */
42 - 32); /* default, 32 = 2.0x */
43 - ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE;
44 + v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
45 + V4L2_CID_EXPOSURE,
46 + 4, /* min lines */
47 + 65535, /* max lines (4+8+4 bits)*/
48 + 1, /* step */
49 + 1000); /* default number of lines */
50 + v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
51 + V4L2_CID_ANALOGUE_GAIN,
52 + 16, /* min, 16 = 1.0x */
53 + 1023, /* max (10 bits) */
54 + 1, /* step */
55 + 32); /* default, 32 = 2.0x */
56
57 /* Set the default mode before we init the subdev */
58 sensor->mode = OV5647_DEFAULT_MODE;