From: Eric Anholt Date: Tue, 31 Oct 2017 18:33:10 +0000 (-0700) Subject: drm/vc4: Skip ULPS latching when we're in that ULPS state already. X-Git-Tag: archive/raspbian/4.9.82-1+deb9u3+rpi1_jessie~5^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=82f5162e44f8556a08dccd222cf32098e1190021;p=linux-4.9.git drm/vc4: Skip ULPS latching when we're in that ULPS state already. It seems that trying to go from unlatched to unlatched will time out waiting for STOP, and we can just skip that. Signed-off-by: Eric Anholt --- diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index 16af8d2d629c..f5cf11dff45b 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -838,6 +838,11 @@ static void vc4_dsi_ulps(struct vc4_dsi *dsi, bool ulps) (dsi->lanes > 2 ? DSI1_STAT_PHY_D2_STOP : 0) | (dsi->lanes > 3 ? DSI1_STAT_PHY_D3_STOP : 0)); int ret; + bool ulps_currently_enabled = (DSI_PORT_READ(PHY_AFEC0) & + DSI_PORT_BIT(PHY_AFEC0_LATCH_ULPS)); + + if (ulps == ulps_currently_enabled) + return; DSI_PORT_WRITE(STAT, stat_ulps); DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) | phyc_ulps);