rk3036 hdmi: fix HPD status reg change
authorhjc <hjc@rock-chips.com>
Wed, 9 Jul 2014 00:59:23 +0000 (08:59 +0800)
committerhjc <hjc@rock-chips.com>
Fri, 11 Jul 2014 09:45:56 +0000 (17:45 +0800)
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.h

index 7948608899a5f839cfaca2bac0591f9742e1175c..f94a1a02ec3c1b66d552ce696781d19592a3fb44 100755 (executable)
@@ -217,8 +217,12 @@ int rk616_hdmi_read_edid(struct hdmi *hdmi_drv, int block, u8 *buf)
        disable_irq(hdmi_drv->irq);
 
        /* Enable edid interrupt */
+#ifdef SOC_CONFIG_RK3036
+       hdmi_writel(hdmi_dev, INTERRUPT_MASK1, m_INT_EDID_READY);
+#else
        hdmi_writel(hdmi_dev, INTERRUPT_MASK1,
                    m_INT_HOTPLUG | m_INT_EDID_READY);
+#endif
 
        for (trytime = 0; trytime < 10; trytime++) {
                hdmi_writel(hdmi_dev, INTERRUPT_STATUS1, 0x04);
@@ -588,20 +592,22 @@ void rk616_hdmi_work(struct hdmi *hdmi_drv)
        if(interrupt){
                hdmi_writel(hdmi_dev, HDMI_STATUS, interrupt);
        }
+       if (interrupt & m_INT_HOTPLUG)
 #else
        hdmi_readl(hdmi_dev, INTERRUPT_STATUS1,&interrupt);
        if(interrupt){
                hdmi_writel(hdmi_dev, INTERRUPT_STATUS1, interrupt);
        }
+       if (interrupt & m_HOTPLUG)
 #endif
-       if (interrupt & m_HOTPLUG) {
+       {
                if (hdmi_drv->state == HDMI_SLEEP)
                        hdmi_drv->state = WAIT_HOTPLUG;
 
                queue_delayed_work(hdmi_drv->workqueue, &hdmi_drv->delay_work,
                                   msecs_to_jiffies(40));
 
-       }
+       }//plug out?
 
        if (hdmi_drv->hdcp_irq_cb)
                hdmi_drv->hdcp_irq_cb(0);
@@ -654,6 +660,7 @@ int rk616_hdmi_initial(struct hdmi *hdmi_drv)
        rk3028_hdmi_reset_pclk();
        rk616_hdmi_reset(hdmi_drv);
 #elif defined(SOC_CONFIG_RK3036)
+       rk3028_hdmi_reset_pclk();
        rk616_hdmi_reset(hdmi_drv);
 #else
        hdmi_drv->set_vif = rk616_hdmi_set_vif;
index 83dbce3725e626b96b44ad173a679337ca347eb5..1bd7e5d02ff92c3d7fd3d691baf4c518cbada107 100755 (executable)
@@ -2,7 +2,7 @@
 #define _RK616_HDMI_HW_H
 
 #define SOC_CONFIG_RK3036
-
+#include <linux/rockchip/iomap.h>
 #define RK616_HDMI_BASE 0x400
 enum PWR_MODE {
        NORMAL,
@@ -356,12 +356,12 @@ static inline int hdmi_msk_reg(struct rk_hdmi_device *hdmi_dev, u16 offset,
        writel_relaxed(temp | ((val) & (msk)), hdmi_dev->regbase + (offset) * 0x04);
        return ret;
 }
-#if defined(CONFIG_ARCH_RK3026)
+#if defined(CONFIG_ARCH_RK3026) || defined(SOC_CONFIG_RK3036)
 static inline void rk3028_hdmi_reset_pclk(void)
 {
-       writel_relaxed(0x00010001, RK2928_CRU_BASE + 0x128);
+       writel_relaxed(0x00010001, RK_CRU_VIRT+ 0x128);
        msleep(100);
-       writel_relaxed(0x00010000, RK2928_CRU_BASE + 0x128);
+       writel_relaxed(0x00010000, RK_CRU_VIRT + 0x128);
 }
 #endif
 #endif