media: i2c: imx290: Replace V4L2_CID_GAIN with V4L2_CID_ANALOGUE_GAIN
authorDavid Plowman <david.plowman@raspberrypi.com>
Thu, 4 Feb 2021 17:29:32 +0000 (17:29 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:10 +0000 (16:04 +0000)
Most software (including libcamera) requires V4L2_CID_ANALOGUE_GAIN,
not V4L2_CID_GAIN.

The range for the control is 0 to 100 for which the sensor uses only
analogue gain; higher values would involve digital gain which this
control should not apply.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
drivers/media/i2c/imx290.c

index def5e8f..1028a33 100644 (file)
@@ -647,7 +647,7 @@ static int imx290_set_ctrl(struct v4l2_ctrl *ctrl)
                return 0;
 
        switch (ctrl->id) {
-       case V4L2_CID_GAIN:
+       case V4L2_CID_ANALOGUE_GAIN:
                ret = imx290_set_gain(imx290, ctrl->val);
                break;
        case V4L2_CID_EXPOSURE:
@@ -1327,7 +1327,7 @@ static int imx290_probe(struct i2c_client *client)
        v4l2_ctrl_handler_init(&imx290->ctrls, 4);
 
        v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
-                         V4L2_CID_GAIN, 0, 238, 1, 0);
+                         V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
 
        mode = imx290->current_mode;
        imx290->hblank = v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,