Re: [PATCH v4 01/15] media: ov8858: Extract digital gain programming
From: Andy Shevchenko
Date: Mon Aug 31 2026 - 06:01:08 EST
On Fri, Aug 28, 2026 at 06:14:43PM +0200, Maurizio Casciano wrote:
> Move the existing packed digital-gain register programming into a helper so
> clock-specific gain handling can be added separately.
My comment was ignored, I am not sure why...
...
> +static int ov8858_set_long_digital_gain(struct ov8858 *ov8858, u32 gain)
> +{
> + u16 long_gain;
> +
> + /*
> + * Digital gain is assembled as:
> + * 0x350a[7:0] = dgain[13:6]
> + * 0x350b[5:0] = dgain[5:0]
This comment most likely has a typo as I pointed out earlier.
> + * Reassemble the control value to write it in one go.
> + */
> + long_gain = (gain & OV8858_LONG_DIGIGAIN_L_MASK) |
> + ((gain & OV8858_LONG_DIGIGAIN_H_MASK) <<
> + OV8858_LONG_DIGIGAIN_H_SHIFT);
> +
> + return ov8858_write(ov8858, OV8858_REG_LONG_DIGIGAIN, long_gain, NULL);
> +}
--
With Best Regards,
Andy Shevchenko