drm: bridge: dw-hdmi: Reorder HDMI Initialization Step
authorZheng Yang <zhengyang@rock-chips.com>
Fri, 28 Apr 2017 03:21:34 +0000 (11:21 +0800)
committerZheng Yang <zhengyang@rock-chips.com>
Tue, 2 May 2017 07:30:08 +0000 (15:30 +0800)
commit508e51e0b2bde78fc82e2668df440c08859abc06
treea02d692301392f1c2530e028824479441c05f88a
parenteeceae5505103b98f146dd8984b5a76dc67ba941
drm: bridge: dw-hdmi: Reorder HDMI Initialization Step

There is a bug of pll lock detection in previous code.

/* Wait for PHY PLL lock */
msec = 5;
do {
val = hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK;
if (!val)
break;
...
} while (1)

while is break if pll is not lock yet, the real lock status may
be after the dw_hdmi_enable_video_path.

This bug is fixed in commit <a479fa5417b12fdf7aef8e41fdb99393e1c28581>
(FROMLIST: drm: bridge: dw-hdmi: Fix the PHY power up sequence)

But it introduced an new bug: hdmi output timing may be not stable,
the format shown on some TV is not a standard hdmi timing. For example,
1080P will be shown as 1922x1080 on LEADSTAR LD-1088.

After reorder the HDMI Initialization Step, phy initialization is
moved after the dw_hdmi_enable_video_path, this bug is fixed.

Change-Id: Id996978ceabcf1cce4bf83ddb84528c04fbb7583
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
drivers/gpu/drm/bridge/dw-hdmi.c