phy: dphy: add support to calculate the timing based on hs_clk_rate
authorMarco Felsch <m.felsch@pengutronix.de>
Fri, 30 Sep 2022 12:48:10 +0000 (14:48 +0200)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 27 Oct 2022 11:38:04 +0000 (14:38 +0300)
commit22168675bae75e158c459ef2dee3b6ebd52a80ed
treebdb716e03686b78132b933e08f00728d55881163
parent7afa5db0eaae8f6c110690311167d5e5cd728efb
phy: dphy: add support to calculate the timing based on hs_clk_rate

For MIPI-CSI sender use-case it is common to specify the allowed
link-frequencies which should be used for the MIPI link and is
half the hs-clock rate.

This commit adds a helper to calculate the D-PHY timing based on the
hs-clock rate so we don't need to calculate the timings within the
driver.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
drivers/phy/phy-core-mipi-dphy.c
include/linux/phy/phy-mipi-dphy.h