media/i2c: ov7251: Switch from V4L2_CID_GAIN to V4L2_CID_ANALOGUE_GAIN
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Tue, 14 Nov 2023 18:36:19 +0000 (18:36 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:15 +0000 (11:35 +0000)
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

index 949d01e..fc26f2b 100644 (file)
@@ -1063,7 +1063,7 @@ static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl)
        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:
@@ -1588,7 +1588,7 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251)
        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,