[PATCH 3/3] media: i2c: ov08d10: fix analogue gain step
From: Matthias Fend
Date: Wed Dec 02 2026 - 03:40:42 EST
The gain value is down-shifted by 3 when written to the gain register, so
the effective granularity is 8. Respect this by reporting a step size of 8
instead of 1 and adjust the maximum value accordingly.
Fixes: 7be91e02ed57 ("media: i2c: Add ov08d10 camera sensor driver")
Signed-off-by: Matthias Fend <matthias.fend@xxxxxxxxx>
---
drivers/media/i2c/ov08d10.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/ov08d10.c b/drivers/media/i2c/ov08d10.c
index 4a6ec91d0b9f60501882a4458ca15d3ef90df996..d2213719909ad0c660bf9de8cbaf122958d56e61 100644
--- a/drivers/media/i2c/ov08d10.c
+++ b/drivers/media/i2c/ov08d10.c
@@ -45,8 +45,8 @@
/* Analog gain controls from sensor */
#define OV08D10_REG_ANALOG_GAIN 0x24
#define OV08D10_ANAL_GAIN_MIN 128
-#define OV08D10_ANAL_GAIN_MAX 2047
-#define OV08D10_ANAL_GAIN_STEP 1
+#define OV08D10_ANAL_GAIN_MAX 2040
+#define OV08D10_ANAL_GAIN_STEP 8
/* Digital gain controls from sensor */
#define OV08D10_REG_MWB_DGAIN_C 0x21
--
2.34.1