bcm27xx: update 6.1 patches to latest version
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-1160-media-i2c-ov7251-Switch-from-V4L2_CID_GAIN-to-V4L2_C.patch
1 From e60fbc34aa98b3ba2c9338ad628fc8d8137e9065 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 14 Nov 2023 18:36:19 +0000
4 Subject: [PATCH] media/i2c: ov7251: Switch from V4L2_CID_GAIN to
5 V4L2_CID_ANALOGUE_GAIN
6
7 The mainline driver has implemented analogue gain using the control
8 V4L2_CID_GAIN instead of V4L2_CID_ANALOGUE_GAIN.
9
10 libcamera requires V4L2_CID_ANALOGUE_GAIN, and therefore fails.
11
12 Update the driver to use V4L2_CID_ANALOGUE_GAIN.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 drivers/media/i2c/ov7251.c | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19 --- a/drivers/media/i2c/ov7251.c
20 +++ b/drivers/media/i2c/ov7251.c
21 @@ -1063,7 +1063,7 @@ static int ov7251_s_ctrl(struct v4l2_ctr
22 case V4L2_CID_EXPOSURE:
23 ret = ov7251_set_exposure(ov7251, ctrl->val);
24 break;
25 - case V4L2_CID_GAIN:
26 + case V4L2_CID_ANALOGUE_GAIN:
27 ret = ov7251_set_gain(ov7251, ctrl->val);
28 break;
29 case V4L2_CID_TEST_PATTERN:
30 @@ -1588,7 +1588,7 @@ static int ov7251_init_ctrls(struct ov72
31 ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
32 V4L2_CID_EXPOSURE, 1, 32, 1, 32);
33 ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
34 - V4L2_CID_GAIN, 16, 1023, 1, 16);
35 + V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1, 16);
36 v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops,
37 V4L2_CID_TEST_PATTERN,
38 ARRAY_SIZE(ov7251_test_pattern_menu) - 1,