Skip to content

Commit cf96783

Browse files
committed
media: imx290: Limit analogue gain according to module
The imx327 only supports up to 29.4dB of analogue gain, vs the imx290 going up to 30dB. Both are in 0.3dB steps. As we now have model specific config, fix this mismatch, and delete the comment referencing it. Signed-off-by: Dave Stevenson <[email protected]>
1 parent dcb1e1b commit cf96783

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/media/i2c/imx290.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ struct imx290_model_info {
186186
enum imx290_colour_variant colour_variant;
187187
const struct cci_reg_sequence *init_regs;
188188
size_t init_regs_num;
189+
unsigned int max_analog_gain;
189190
const char *name;
190191
};
191192

@@ -887,14 +888,10 @@ static int imx290_ctrl_init(struct imx290 *imx290)
887888
* up to 72.0dB (240) add further digital gain. Limit the range to
888889
* analog gain only, support for digital gain can be added separately
889890
* if needed.
890-
*
891-
* The IMX327 and IMX462 are largely compatible with the IMX290, but
892-
* have an analog gain range of 0.0dB to 29.4dB and 42dB of digital
893-
* gain. When support for those sensors gets added to the driver, the
894-
* gain control should be adjusted accordingly.
895891
*/
896892
v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
897-
V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
893+
V4L2_CID_ANALOGUE_GAIN, 0,
894+
imx290->model->max_analog_gain, 1, 0);
898895

899896
/*
900897
* Correct range will be determined through imx290_ctrl_update setting
@@ -1445,18 +1442,21 @@ static const struct imx290_model_info imx290_models[] = {
14451442
.colour_variant = IMX290_VARIANT_COLOUR,
14461443
.init_regs = imx290_global_init_settings_290,
14471444
.init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
1445+
.max_analog_gain = 100,
14481446
.name = "imx290",
14491447
},
14501448
[IMX290_MODEL_IMX290LLR] = {
14511449
.colour_variant = IMX290_VARIANT_MONO,
14521450
.init_regs = imx290_global_init_settings_290,
14531451
.init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
1452+
.max_analog_gain = 100,
14541453
.name = "imx290",
14551454
},
14561455
[IMX290_MODEL_IMX327LQR] = {
14571456
.colour_variant = IMX290_VARIANT_COLOUR,
14581457
.init_regs = imx290_global_init_settings_327,
14591458
.init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327),
1459+
.max_analog_gain = 98,
14601460
.name = "imx327",
14611461
},
14621462
};

0 commit comments

Comments
 (0)