drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec
authorFrieder Schrempf <frieder.schrempf@kontron.de>
Wed, 3 May 2023 16:33:06 +0000 (18:33 +0200)
committerNeil Armstrong <neil.armstrong@linaro.org>
Thu, 25 May 2023 16:16:32 +0000 (18:16 +0200)
commit0c14d3130654fe459fca3067d2d4317fc607bc71
tree53b3d5154e3065a4ac23ee16c8464bf9e73623a4
parentabd686b8c38a094631884aa7b8cb04cc32b6608a
drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec

According to the documentation [1] the proper enable flow is:

1. Enable DSI link and keep data lanes in LP-11 (stop state)
2. Disable stop state to bring data lanes into HS mode

Currently we do this all at once within enable(), which doesn't
allow to meet the requirements of some downstream bridges.

To fix this we now enable the DSI in pre_enable() and force it
into stop state using the FORCE_STOP_STATE bit in the ESCMODE
register until enable() is called where we reset the bit.

We currently do this only for i.MX8M as Exynos uses a different
init flow where samsung_dsim_init() is called from
samsung_dsim_host_transfer().

[1] https://docs.kernel.org/gpu/drm-kms-helpers.html#mipi-dsi-bridge-operation

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> #TQMa8MxML/MBa8Mx
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230503163313.2640898-2-frieder@fris.de
drivers/gpu/drm/bridge/samsung-dsim.c