media: ov5640: Rework timings programming
authorJacopo Mondi <jacopo@jmondi.org>
Fri, 13 May 2022 14:13:56 +0000 (15:13 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 14:21:41 +0000 (15:21 +0100)
commit3145efcdb4d0eb3f4045d45c55a3963ed4f735c4
tree3b48c439962cffa31f540d12366976bb1ffe35b2
parent6c957ed73e5bb908c8d33471671290e93b41ebc1
media: ov5640: Rework timings programming

The current definition of a sensor mode defines timings as follows:

- hact, vact: Visible width and height
- htot, vtot: Total sizes including blankings

This makes difficult to clearly separate the visible sizes from the
blankings and to make the vertical blanking programmable.

Rework the sensor modes sizes definition to:
- Report the analog crop sizes
- Report the visible crop size
- Report the total pixels per line as HBLANK is fixed
- Report the VBLANK value to make it programmable

Also modify the ov5640_set_timings() function to program all the
windowing registers are remove them from the per-mode register-value
tables.

Do not change the timing values from the ones reported in the register
tables to maintain bisectability.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov5640.c