]> git.baikalelectronics.ru Git - kernel.git/commit
drm: bridge: dw-hdmi: Fix the PHY power down sequence
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 5 Mar 2017 23:35:39 +0000 (01:35 +0200)
committerArchit Taneja <architt@codeaurora.org>
Fri, 10 Mar 2017 08:54:50 +0000 (14:24 +0530)
commitc33696b99c9e7b4c79f5e586a1dcc425b5f4a0d0
treedc376a2a82153652b01cbc953b7f13aec71ab9b1
parent2f18750cc4f275851f2cb7fa1ef4b358bef309e0
drm: bridge: dw-hdmi: Fix the PHY power down sequence

The PHY requires us to wait for the PHY to switch to low power mode
after deasserting TXPWRON and before asserting PDDQ in the power down
sequence, otherwise power down will fail.

The PHY power down can be monitored though the TX_READY bit, available
through I2C in the PHY registers, or the TX_PHY_LOCK bit, available
through the HDMI TX registers. As the two are equivalent, let's pick the
easier solution of polling the TX_PHY_LOCK bit.

The power down code is currently duplicated in multiple places. To avoid
spreading multiple calls to a TX_PHY_LOCK poll function, we have to
refactor the power down code and group it all in a single function.

Tests showed that one poll iteration was enough for TX_PHY_LOCK to
become low, without requiring any additional delay. Retrying the read
five times with a 1ms to 2ms delay between each attempt should thus be
more than enough.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170305233539.11898-1-laurent.pinchart+renesas@ideasonboard.com
drivers/gpu/drm/bridge/dw-hdmi.c