Re: [PATCH 3/3] media: i2c: ov9282: fix analogue gain maximum
From: Richard Leitner
Date: Wed Feb 26 2025 - 06:10:49 EST
Hi Laurent,
On Tue, Feb 25, 2025 at 05:46:07PM +0200, Laurent Pinchart wrote:
> On Tue, Feb 25, 2025 at 03:30:16PM +0000, Dave Stevenson wrote:
> > On Tue, 25 Feb 2025 at 13:09, Richard Leitner wrote:
...
> > > @@ -605,7 +604,11 @@ static int ov9282_update_exp_gain(struct ov9282 *ov9282, u32 exposure, u32 gain)
> > > if (ret)
> > > goto error_release_group_hold;
> > >
> > > - ret = ov9282_write_reg(ov9282, OV9282_REG_AGAIN, 1, gain);
> > > + ret = ov9282_write_reg(ov9282, OV9282_REG_AGAIN, 1, (gain >> 8) & 0x1f);
> > > + if (ret)
> > > + goto error_release_group_hold;
> > > +
> > > + ret = ov9282_write_reg(ov9282, OV9282_REG_AGAIN + 1, 1, gain & 0xff);
>
> Ignoring Dave's functional review for a moment to focus on the code:
> 16-bit registers should ideally use the v4l2-cci helpers. It would be
> nice to convert the driver to them.
Thanks for the feedback! I will take a look at the v4l2-cci helpers.
regards;rl
>
> > >
> > > error_release_group_hold:
> > > ov9282_write_reg(ov9282, OV9282_REG_HOLD, 1, 0);
> > >
>
> --
> Regards,
>
> Laurent Pinchart