From 2917061c498a97e3c3b99ac616b6f3202f8a0499 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Thu, 3 Apr 2014 20:36:55 +0800 Subject: ENGR00306875-2 video: mxc_hdmi: Set hdmi cable state a bit earilier During hdmi hotplug test, there's a possibility that X-server unblanks the frame buffer while HDMI-audio just gets the signal to start playback. Then audio would get an unblanked state right before the playback and bypassed the DMA enabling code. So this issue is caused by the race between unblank and set_cable_state(). This patch sets the hdmi cable state a bit earilier so as to let audio play first. If unblank happens later, the hdmi core and hdmi audio would be robust enough to handle that case as long as it's not racing with the other parts. Acked-by: Sandor Yu Signed-off-by: Nicolin Chen --- drivers/video/mxc/mxc_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c index 127bfb659f44..e510025f7bad 100644 --- a/drivers/video/mxc/mxc_hdmi.c +++ b/drivers/video/mxc/mxc_hdmi.c @@ -2004,13 +2004,13 @@ static void hotplug_worker(struct work_struct *work) val &= ~HDMI_PHY_HPD; hdmi_writeb(val, HDMI_PHY_POL0); + hdmi_set_cable_state(1); + sprintf(event_string, "EVENT=plugin"); kobject_uevent_env(&hdmi->pdev->dev.kobj, KOBJ_CHANGE, envp); #ifdef CONFIG_MXC_HDMI_CEC mxc_hdmi_cec_handle(0x80); #endif - hdmi_set_cable_state(1); - } else if (!(phy_int_pol & HDMI_PHY_HPD)) { /* Plugout event */ dev_dbg(&hdmi->pdev->dev, "EVENT=plugout\n"); -- cgit v1.2.3