rk3036 hdmi: fix edid read faile lead to error
authorhjc <hjc@rock-chips.com>
Wed, 8 Oct 2014 06:20:35 +0000 (14:20 +0800)
committerhjc <hjc@rock-chips.com>
Wed, 8 Oct 2014 06:20:53 +0000 (14:20 +0800)
drivers/video/rockchip/hdmi/chips/rk3036/rk3036_hdmi_hw.c

index df65daa3c4cbbec4ea3b063149141e8e59815937..4940df82028444aabeec437cfb38a4883ec8b321 100755 (executable)
@@ -202,10 +202,6 @@ int rk3036_hdmi_read_edid(struct hdmi *hdmi_drv, int block, u8 *buf)
 #endif
                        }
 
-                       /* clear EDID interrupt reg */
-                       hdmi_writel(hdmi_dev, INTERRUPT_STATUS1,
-                                   m_INT_EDID_READY);
-
                        if ((checksum & 0xff) == 0) {
                                ret = 0;
                                hdmi_dbg(hdmi_drv->dev,
@@ -216,6 +212,10 @@ int rk3036_hdmi_read_edid(struct hdmi *hdmi_drv, int block, u8 *buf)
        }
        /*close edid irq*/
        hdmi_writel(hdmi_dev, INTERRUPT_MASK1, 0);
+       /* clear EDID interrupt reg */
+       hdmi_writel(hdmi_dev, INTERRUPT_STATUS1,
+                   m_INT_EDID_READY);
+
        enable_irq(hdmi_drv->irq);
 
        return ret;
@@ -763,6 +763,12 @@ void rk3036_hdmi_irq(struct hdmi *hdmi_drv)
        struct rk_hdmi_device *hdmi_dev = container_of(hdmi_drv,
                                                       struct rk_hdmi_device,
                                                       driver);
+       hdmi_readl(hdmi_dev, INTERRUPT_STATUS1, &interrupt);
+       if(interrupt) {
+               hdmi_writel(hdmi_dev, INTERRUPT_STATUS1, interrupt);
+               dev_info(hdmi_drv->dev, "Clear edid irq.\n");
+       }
+
        hdmi_readl(hdmi_dev, HDMI_STATUS, &interrupt);
        if(interrupt) {
                hdmi_writel(hdmi_dev, HDMI_STATUS, interrupt);