difos/target/linux/bcm27xx/patches-6.12/950-0820-imx500-Fix-for-long-exposure-setup.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

36 lines
1.2 KiB
Diff

From 8d14990a463ff18da74d0727610aab8d1453ac24 Mon Sep 17 00:00:00 2001
From: Naushir Patuck <naush@raspberrypi.com>
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 <naush@raspberrypi.com>
---
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);
}