drm: bridge: samsung-dsim: Fix init during host transfer
authorFrieder Schrempf <frieder.schrempf@kontron.de>
Mon, 24 Jul 2023 15:16:32 +0000 (17:16 +0200)
committerNeil Armstrong <neil.armstrong@linaro.org>
Fri, 18 Aug 2023 08:38:36 +0000 (10:38 +0200)
commit20c827683de05a6c7e7ae7fae586899690693251
tree0b1049d4bcd997a4c262a9addd070b3ff2176201
parent50b6f2c8297793f7f3315623db78dcff85158e96
drm: bridge: samsung-dsim: Fix init during host transfer

In case the downstream bridge or panel uses DSI transfers before the
DSI host was actually initialized through samsung_dsim_atomic_enable()
which clears the stop state (LP11) mode, all transfers will fail.

This happens with downstream bridges that are controlled by DSI
commands such as the tc358762.

As documented in [1] DSI hosts are expected to allow transfers
outside the normal bridge enable/disable flow.

To fix this make sure that stop state is cleared in
samsung_dsim_host_transfer() which restores the previous
behavior.

We also factor out the common code to enable/disable stop state
to samsung_dsim_set_stop_state().

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

Fixes: 0c14d3130654 ("drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec")
Reported-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230724151640.555490-1-frieder@fris.de
drivers/gpu/drm/bridge/samsung-dsim.c