diff mbox series

[v8,03/14] media: ov02c10: Fix hts for 2 lane mode

Message ID 20250313184314.91410-4-hdegoede@redhat.com (mailing list archive)
State New
Headers show
Series media: i2c: Add Omnivision OV02C10 sensor driver | expand

Commit Message

Hans de Goede March 13, 2025, 6:43 p.m. UTC
Using half the hts value when using 2 lanes results in hts < width,
which results in reporting a negative hblank value to userspace.

The hts value in the mode struct is only used for reporting the hblank
control to userspace so this change does not result in any different
register settings being written to the sensor.

After this change the register-lists are still writing 1140 to the HTS
register of the sensor in 2 lane mode, which seems to be a too low value
for HTS. But maybe the value of this register is multiplied by 2 internally
by the sensor when 2 lanes are used ?

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/i2c/ov02c10.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index f18b48fe8c0d..a33f9d4033e6 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -26,6 +26,8 @@ 
 
 #define OV02C10_REG_STREAM_CONTROL	CCI_REG8(0x0100)
 
+#define OV02C10_REG_HTS			CCI_REG16(0x380c)
+
 /* vertical-timings from sensor */
 #define OV02C10_REG_VTS			CCI_REG16(0x380e)
 #define OV02C10_VTS_MAX			0xffff
@@ -372,7 +374,7 @@  static const struct ov02c10_mode supported_modes[] = {
 	{
 		.width = 1928,
 		.height = 1092,
-		.hts = 1140,
+		.hts = 2280,
 		.vts_def = 2328,
 		.vts_min = 2328,
 		.mipi_lanes = 2,