From 8d14990a463ff18da74d0727610aab8d1453ac24 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 28 Feb 2025 12:49:28 +0000 Subject: [PATCH] imx500: Fix for long exposure setup The IMX500 (unlike the IMX477/IMX708) requires two regsiters to be set for the exposure shift value to work correctly. The additional register write (which was missing) is for the integration time shift. Signed-off-by: Naushir Patuck --- drivers/media/i2c/imx500.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/media/i2c/imx500.c +++ b/drivers/media/i2c/imx500.c @@ -57,6 +57,7 @@ /* Long exposure multiplier */ #define IMX500_LONG_EXP_SHIFT_MAX 7 #define IMX500_LONG_EXP_SHIFT_REG CCI_REG8(0x3210) +#define IMX500_LONG_EXP_CIT_SHIFT_REG CCI_REG8(0x3100) /* Exposure control */ #define IMX500_REG_EXPOSURE CCI_REG16(0x0202) @@ -1772,6 +1773,11 @@ static int imx500_set_frame_length(struc if (ret) return ret; + ret = cci_write(imx500->regmap, IMX500_LONG_EXP_CIT_SHIFT_REG, + imx500->long_exp_shift, NULL); + if (ret) + return ret; + return cci_write(imx500->regmap, IMX500_LONG_EXP_SHIFT_REG, imx500->long_exp_shift, NULL); }