difos/target/linux/bcm27xx/patches-6.12/950-0403-media-i2c-ov7251-Switch-from-V4L2_CID_GAIN-to-V4L2_C.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

38 lines
1.4 KiB
Diff

From 7b0d137dbd27de7c393c403622e0409ef1553cc2 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 14 Nov 2023 18:36:19 +0000
Subject: [PATCH] media/i2c: ov7251: Switch from V4L2_CID_GAIN to
V4L2_CID_ANALOGUE_GAIN
The mainline driver has implemented analogue gain using the control
V4L2_CID_GAIN instead of V4L2_CID_ANALOGUE_GAIN.
libcamera requires V4L2_CID_ANALOGUE_GAIN, and therefore fails.
Update the driver to use V4L2_CID_ANALOGUE_GAIN.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/ov7251.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1065,7 +1065,7 @@ static int ov7251_s_ctrl(struct v4l2_ctr
case V4L2_CID_EXPOSURE:
ret = ov7251_set_exposure(ov7251, ctrl->val);
break;
- case V4L2_CID_GAIN:
+ case V4L2_CID_ANALOGUE_GAIN:
ret = ov7251_set_gain(ov7251, ctrl->val);
break;
case V4L2_CID_TEST_PATTERN:
@@ -1611,7 +1611,7 @@ static int ov7251_init_ctrls(struct ov72
ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
V4L2_CID_EXPOSURE, 1, 32, 1, 32);
ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
- V4L2_CID_GAIN, 16, 1023, 1, 16);
+ V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1, 16);
v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops,
V4L2_CID_TEST_PATTERN,
ARRAY_SIZE(ov7251_test_pattern_menu) - 1,