bcm27xx: switch to kernel v6.1
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0731-media-i2c-ov7251-Do-not-reset-gain-on-mode-change.patch
1 From 46773bdd99e4ab1bd0d65931ef782122f4f4a031 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Sat, 12 Feb 2022 12:33:13 +0000
4 Subject: [PATCH] media: i2c: ov7251: Do not reset gain on mode change
5
6 There is no reaon why changing mode should reset the analogue
7 gain of the sensor, and it's not the behaviour that userspace
8 will be expecting.
9 Remove the reset.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/media/i2c/ov7251.c | 13 ++-----------
14 1 file changed, 2 insertions(+), 11 deletions(-)
15
16 --- a/drivers/media/i2c/ov7251.c
17 +++ b/drivers/media/i2c/ov7251.c
18 @@ -115,7 +115,6 @@ struct ov7251 {
19
20 struct v4l2_ctrl_handler ctrls;
21 struct v4l2_ctrl *exposure;
22 - struct v4l2_ctrl *gain;
23 struct v4l2_ctrl *hblank;
24
25 /* Cached register values */
26 @@ -1167,10 +1166,6 @@ static int ov7251_set_format(struct v4l2
27 if (ret < 0)
28 goto exit;
29
30 - ret = __v4l2_ctrl_s_ctrl(ov7251->gain, 16);
31 - if (ret < 0)
32 - goto exit;
33 -
34 ov7251->current_mode = new_mode;
35 }
36
37 @@ -1321,10 +1316,6 @@ static int ov7251_set_frame_interval(str
38 if (ret < 0)
39 goto exit;
40
41 - ret = __v4l2_ctrl_s_ctrl(ov7251->gain, 16);
42 - if (ret < 0)
43 - goto exit;
44 -
45 ov7251->current_mode = new_mode;
46 }
47
48 @@ -1550,8 +1541,8 @@ static int ov7251_probe(struct i2c_clien
49 V4L2_CID_VFLIP, 0, 1, 1, 0);
50 ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
51 V4L2_CID_EXPOSURE, 1, 32, 1, 32);
52 - ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
53 - V4L2_CID_GAIN, 16, 1023, 1, 16);
54 + v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops, V4L2_CID_GAIN,
55 + 16, 1023, 1, 16);
56 v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops,
57 V4L2_CID_TEST_PATTERN,
58 ARRAY_SIZE(ov7251_test_pattern_menu) - 1,