drm: bridge: samsung-dsim: Dynamically configure DPHY timing
authorAdam Ford <aford173@gmail.com>
Fri, 26 May 2023 03:05:57 +0000 (22:05 -0500)
committerNeil Armstrong <neil.armstrong@linaro.org>
Fri, 26 May 2023 07:20:41 +0000 (09:20 +0200)
commit89691775f5735fca9dc40e119edcbb52a25b9612
tree80c43dbd5bab7d8e54f178f1c6e24710e68ac7c7
parent171b3b1e0f8b8c894f2388e1cf765a56f831ee5e
drm: bridge: samsung-dsim: Dynamically configure DPHY timing

The DPHY timings are currently hard coded. Since the input
clock can be variable, the phy timings need to be variable
too.  To facilitate this, we need to cache the hs_clock
based on what is generated from the PLL.

The phy_mipi_dphy_get_default_config_for_hsclk function
configures the DPHY timings in pico-seconds, and a small macro
converts those timings into clock cycles based on the hs_clk.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Michael Walle <michael@walle.cc>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> # imx8mm-icore
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230526030559.326566-6-aford173@gmail.com
drivers/gpu/drm/bridge/samsung-dsim.c
include/drm/bridge/samsung-dsim.h