]> git.ipfire.org Git - thirdparty/openwrt.git/blob
818f95f7c3b5dca45dc43bfc5de48593c0751497
[thirdparty/openwrt.git] /
1 From b3dd7e8947cddec41864e8d3ce5f5d8b81033d6a Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 20 Nov 2024 19:17:03 +0000
4 Subject: [PATCH] media: i2c: imx290: Limit analogue gain according to module
5
6 Commit ec75fd952b0b5cdab7b606cdacba237c57c1fdda upstream.
7
8 The imx327 only supports up to 29.4dB of analogue gain, vs
9 the imx290 going up to 30dB. Both are in 0.3dB steps.
10
11 As we now have model specific config, fix this mismatch,
12 and delete the comment referencing it.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
16 Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
17 Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
18 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
19 ---
20 drivers/media/i2c/imx290.c | 12 ++++++------
21 1 file changed, 6 insertions(+), 6 deletions(-)
22
23 --- a/drivers/media/i2c/imx290.c
24 +++ b/drivers/media/i2c/imx290.c
25 @@ -178,6 +178,7 @@ struct imx290_model_info {
26 enum imx290_colour_variant colour_variant;
27 const struct cci_reg_sequence *init_regs;
28 size_t init_regs_num;
29 + unsigned int max_analog_gain;
30 const char *name;
31 };
32
33 @@ -879,14 +880,10 @@ static int imx290_ctrl_init(struct imx29
34 * up to 72.0dB (240) add further digital gain. Limit the range to
35 * analog gain only, support for digital gain can be added separately
36 * if needed.
37 - *
38 - * The IMX327 and IMX462 are largely compatible with the IMX290, but
39 - * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital
40 - * gain. When support for those sensors gets added to the driver, the
41 - * gain control should be adjusted accordingly.
42 */
43 v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
44 - V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
45 + V4L2_CID_ANALOGUE_GAIN, 0,
46 + imx290->model->max_analog_gain, 1, 0);
47
48 /*
49 * Correct range will be determined through imx290_ctrl_update setting
50 @@ -1437,18 +1434,21 @@ static const struct imx290_model_info im
51 .colour_variant = IMX290_VARIANT_COLOUR,
52 .init_regs = imx290_global_init_settings_290,
53 .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
54 + .max_analog_gain = 100,
55 .name = "imx290",
56 },
57 [IMX290_MODEL_IMX290LLR] = {
58 .colour_variant = IMX290_VARIANT_MONO,
59 .init_regs = imx290_global_init_settings_290,
60 .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
61 + .max_analog_gain = 100,
62 .name = "imx290",
63 },
64 [IMX290_MODEL_IMX327LQR] = {
65 .colour_variant = IMX290_VARIANT_COLOUR,
66 .init_regs = imx290_global_init_settings_327,
67 .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327),
68 + .max_analog_gain = 98,
69 .name = "imx327",
70 },
71 };