7195802624e9ec5ba68b20dfd650a47ebe822fe2
[openwrt/staging/stintel.git] /
1 From 4a7aa2079f074dc7c2767bfa98eafb1a387f5129 Mon Sep 17 00:00:00 2001
2 From: David Plowman <david.plowman@raspberrypi.com>
3 Date: Thu, 4 Feb 2021 17:29:32 +0000
4 Subject: [PATCH] media: i2c: imx290: Replace V4L2_CID_GAIN with
5 V4L2_CID_ANALOGUE_GAIN
6
7 Most software (including libcamera) requires V4L2_CID_ANALOGUE_GAIN,
8 not V4L2_CID_GAIN.
9
10 The range for the control is 0 to 100 for which the sensor uses only
11 analogue gain; higher values would involve digital gain which this
12 control should not apply.
13
14 Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
15 ---
16 drivers/media/i2c/imx290.c | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19 --- a/drivers/media/i2c/imx290.c
20 +++ b/drivers/media/i2c/imx290.c
21 @@ -647,7 +647,7 @@ static int imx290_set_ctrl(struct v4l2_c
22 return 0;
23
24 switch (ctrl->id) {
25 - case V4L2_CID_GAIN:
26 + case V4L2_CID_ANALOGUE_GAIN:
27 ret = imx290_set_gain(imx290, ctrl->val);
28 break;
29 case V4L2_CID_EXPOSURE:
30 @@ -1331,7 +1331,7 @@ static int imx290_probe(struct i2c_clien
31 v4l2_ctrl_handler_init(&imx290->ctrls, 4);
32
33 v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
34 - V4L2_CID_GAIN, 0, 238, 1, 0);
35 + V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
36
37 mode = imx290->current_mode;
38 imx290->hblank = v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,