media: ov5640: Update pixel_rate and link_freq
authorJacopo Mondi <jacopo@jmondi.org>
Fri, 13 May 2022 14:13:54 +0000 (15:13 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 14:18:11 +0000 (15:18 +0100)
commit3c28588f35d3c0a93f38a347c4727ca4bbe244bd
treeaee493b1b85b790757adbd7d387b4384bf49cb72
parent7a3b8d4bda2546ba0a29924dea2175e181dd101c
media: ov5640: Update pixel_rate and link_freq

After having set a new format re-calculate the pixel_rate and link_freq
control values and update them when in MIPI mode.

Take into account the limitation of the link frequency having to be
strictly smaller than 1GHz when computing the desired link_freq, and
adjust the resulting pixel_rate acounting for the clock tree
configuration.

[Adjust link_freq calculation]

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