Re: [PATCH 01/11] media: i2c: ov5640: Set default WB gains

From: Jacopo Mondi

Date: Thu May 14 2026 - 03:44:40 EST


Hi Kieran

On Fri, May 01, 2026 at 04:39:03PM +0100, Kieran Bingham wrote:
> The default values for the Blue and Red balance should be
> the same as the Green balance (0x400/1024).
>
> Update the values to ensure no change is applied by default.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/i2c/ov5640.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
> index 85ecc23b3587..01ea6b2bfeeb 100644
> --- a/drivers/media/i2c/ov5640.c
> +++ b/drivers/media/i2c/ov5640.c
> @@ -3470,9 +3470,9 @@ static int ov5640_init_controls(struct ov5640_dev *sensor)
> V4L2_CID_AUTO_WHITE_BALANCE,
> 0, 1, 1, 1);
> ctrls->blue_balance = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_BLUE_BALANCE,
> - 0, 4095, 1, 0);
> + 0, 4095, 1, 1024);
> ctrls->red_balance = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_RED_BALANCE,
> - 0, 4095, 1, 0);
> + 0, 4095, 1, 1024);

The register format is not documented, but 0x400 is indeed the
default. Looking at the control max value and the register default which
is reasonable to assume represents x1.0, I presume it is safe to
assume unsigned Q2.10 for the WB gains.

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

> /* Auto/manual exposure */
> ctrls->auto_exp = v4l2_ctrl_new_std_menu(hdl, ops,
> V4L2_CID_EXPOSURE_AUTO,
>
> --
> 2.52.0
>
>