[PATCH 4/5] media: i2c: it6625: fix the second-field vertical timings
From: Hermes Wu via B4 Relay
Date: Wed Oct 21 2026 - 02:10:33 EST
From: Hermes Wu <Hermes.wu@xxxxxxxxxx>
For interlaced input, the driver reported the second field with a
vertical sync of vsync + 1 lines and zero front and back porches. A
1080i frame then totalled 1108 lines instead of 1125, and any rate
derived from the detected timings was wrong.
The vertical active, total and porch/sync registers hold the values of
the first field: on 1080i input they read 540 active and 562 total
lines, with a 2/5/15 line front porch/sync/back porch.
Derive the second field the way the CEA-861 interlaced formats define
it, and as the interlaced presets in v4l2-dv-timings.h describe it:
the same front porch and sync as the first field, and one more
back-porch line. Without V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE, the extra
line of an odd frame total belongs to the second field. The detected
1080i50 and 1080i60 vertical timings now equal those of the CEA
presets, 1125 lines per frame.
Fixes: 142e5f00bd57 ("media: i2c: add driver for ITE IT6625/IT6626")
Assisted-by: LLM
Signed-off-by: Hermes Wu <Hermes.wu@xxxxxxxxxx>
---
drivers/media/i2c/it6625.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/it6625.c b/drivers/media/i2c/it6625.c
index 85f10d10337130565a0799daa32311510e312a68..75bcb8304c02c7c0c5feeb02af6c93378fcfa5d7 100644
--- a/drivers/media/i2c/it6625.c
+++ b/drivers/media/i2c/it6625.c
@@ -839,8 +839,15 @@ static int it6625_get_detected_timings(struct it6625 *it6625,
bt->pixelclock = it6625_get_pclk(it6625);
if (bt->interlaced == V4L2_DV_INTERLACED) {
+ /*
+ * The vertical registers hold the first field. As in the
+ * CEA-861 interlaced formats, the second field has the same
+ * front porch and sync, and one more back-porch line.
+ */
bt->height *= 2;
- bt->il_vsync = bt->vsync + 1;
+ bt->il_vfrontporch = bt->vfrontporch;
+ bt->il_vsync = bt->vsync;
+ bt->il_vbackporch = bt->vbackporch + 1;
}
return 0;
--
2.34.1