media: ov5640: Rework CSI-2 clock tree
authorJacopo Mondi <jacopo@jmondi.org>
Fri, 13 May 2022 14:13:55 +0000 (15:13 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 14:20:12 +0000 (15:20 +0100)
commit6c957ed73e5bb908c8d33471671290e93b41ebc1
treec7249c8dc17c2dbafa4e00238488b37868ab3f29
parent3c28588f35d3c0a93f38a347c4727ca4bbe244bd
media: ov5640: Rework CSI-2 clock tree

Re-work the ov5640_set_mipi_pclk() function to calculate the
PLL configuration using the pixel_rate and link_freq values set at
s_fmt time.

Rework the DVP clock mode settings to calculate the pixel clock
internally and remove the assumption on the 16bpp format.

Tested in MIPI CSI-2 mode with 1 and 2 data lanes with:
- all the sensor supported resolutions in UYVY, RGB565 and MJPEG formats.
- resolutions >= 1280x720 in RAW Bayer format.
- resolutions < 1280x720 in RGB888 format.

[Rework pclk_period and link_freq computation]

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.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