Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: i2c: imx290: Fix max gain value

The gain is expressed in multiple of 0.3dB, as a value between 0.0dB
and 72.0dB. Gains between 0.0dB and 30.0dB (included) apply analog gain
only, higher gains from 30.3dB to 72dB apply additional digital gain.

The maximum gain value is erroneously set to 72. Increase it to 100 to
cover the whole analog gain range. Support for digital gain can be added
separately if needed.

The IMX327 and IMX462 are largely compatible with the IMX290, but have
an analog gain range of 0.0dB to 29.4dB and 42dB of digital gain. When
support for those sensors gets added to the driver, the gain control
should be adjusted accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

authored by

Laurent Pinchart and committed by
Sakari Ailus
6d7a87f2 827c7e69

+14 -1
+14 -1
drivers/media/i2c/imx290.c
··· 1019 1019 v4l2_ctrl_handler_init(&imx290->ctrls, 5); 1020 1020 imx290->ctrls.lock = &imx290->lock; 1021 1021 1022 + /* 1023 + * The sensor has an analog gain and a digital gain, both controlled 1024 + * through a single gain value, expressed in 0.3dB increments. Values 1025 + * from 0.0dB (0) to 30.0dB (100) apply analog gain only, higher values 1026 + * up to 72.0dB (240) add further digital gain. Limit the range to 1027 + * analog gain only, support for digital gain can be added separately 1028 + * if needed. 1029 + * 1030 + * The IMX327 and IMX462 are largely compatible with the IMX290, but 1031 + * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital 1032 + * gain. When support for those sensors gets added to the driver, the 1033 + * gain control should be adjusted accordingly. 1034 + */ 1022 1035 v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, 1023 - V4L2_CID_GAIN, 0, 72, 1, 0); 1036 + V4L2_CID_GAIN, 0, 100, 1, 0); 1024 1037 1025 1038 v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, 1026 1039 V4L2_CID_EXPOSURE, 1, IMX290_VMAX_DEFAULT - 2, 1,