Re: [PATCH 3/5] media: i2c: vd55g1: Fix manual digital gain on color variant

From: Jacopo Mondi

Date: Mon Jun 22 2026 - 06:10:18 EST


Hi Benjamin

On Tue, Apr 28, 2026 at 10:40:57AM +0200, Benjamin Mugnier wrote:
> Apply digital gain to all channels, each channel representing a color.
>
> Fixes: e138e7f00042 ("media: i2c: vd55g1: Add support for vd65g4 RGB variant")

Also cc stable here

>
> Signed-off-by: Benjamin Mugnier <benjamin.mugnier@xxxxxxxxxxx>

Reviewed-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>

Thanks
j

> ---
> drivers/media/i2c/vd55g1.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
> index e44174056ace..2c962fcb41d2 100644
> --- a/drivers/media/i2c/vd55g1.c
> +++ b/drivers/media/i2c/vd55g1.c
> @@ -60,7 +60,10 @@
> #define VD55G1_PATGEN_ENABLE BIT(0)
> #define VD55G1_REG_MANUAL_ANALOG_GAIN CCI_REG8(0x0501)
> #define VD55G1_REG_MANUAL_COARSE_EXPOSURE CCI_REG16_LE(0x0502)
> -#define VD55G1_REG_MANUAL_DIGITAL_GAIN CCI_REG16_LE(0x0504)
> +#define VD55G1_REG_MANUAL_DIGITAL_GAIN_CH0 CCI_REG16_LE(0x0504)
> +#define VD55G1_REG_MANUAL_DIGITAL_GAIN_CH1 CCI_REG16_LE(0x0506)
> +#define VD55G1_REG_MANUAL_DIGITAL_GAIN_CH2 CCI_REG16_LE(0x0508)
> +#define VD55G1_REG_MANUAL_DIGITAL_GAIN_CH3 CCI_REG16_LE(0x050a)
> #define VD55G1_REG_APPLIED_COARSE_EXPOSURE CCI_REG16_LE(0x00e8)
> #define VD55G1_REG_APPLIED_ANALOG_GAIN CCI_REG16_LE(0x00ea)
> #define VD55G1_REG_APPLIED_DIGITAL_GAIN CCI_REG16_LE(0x00ec)
> @@ -850,9 +853,16 @@ static int vd55g1_update_expo_cluster(struct vd55g1 *sensor, bool is_auto)
> vd55g1_write(sensor, VD55G1_REG_MANUAL_ANALOG_GAIN,
> sensor->again_ctrl->val, &ret);
>
> - if (!is_auto && sensor->dgain_ctrl->is_new)
> - vd55g1_write(sensor, VD55G1_REG_MANUAL_DIGITAL_GAIN,
> + if (!is_auto && sensor->dgain_ctrl->is_new) {
> + vd55g1_write(sensor, VD55G1_REG_MANUAL_DIGITAL_GAIN_CH0,
> sensor->dgain_ctrl->val, &ret);
> + vd55g1_write(sensor, VD55G1_REG_MANUAL_DIGITAL_GAIN_CH1,
> + sensor->dgain_ctrl->val, &ret);
> + vd55g1_write(sensor, VD55G1_REG_MANUAL_DIGITAL_GAIN_CH2,
> + sensor->dgain_ctrl->val, &ret);
> + vd55g1_write(sensor, VD55G1_REG_MANUAL_DIGITAL_GAIN_CH3,
> + sensor->dgain_ctrl->val, &ret);
> + }
>
> return ret;
> }
>
> --
> 2.43.0
>
>