modify hdmi some time no chean up interrupt
authorxuhuicong <xhc@rock-chips.com>
Tue, 21 May 2013 06:24:00 +0000 (14:24 +0800)
committerxuhuicong <xhc@rock-chips.com>
Tue, 21 May 2013 06:24:00 +0000 (14:24 +0800)
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c

index cf59a81d2c8650a5fb937ab27da02d5884be633c..c86a572d4acfdd4bcd4c9c34bbb942f7af48b185 100755 (executable)
@@ -88,10 +88,12 @@ static void rk616_hdmi_set_pwr_mode(int mode)
 int rk616_hdmi_detect_hotplug(void)
 {
        int value = 0;
+#if 0
        HDMIRdReg(INTERRUPT_STATUS1,&value);
        if(value){
                HDMIWrReg(INTERRUPT_STATUS1, value);
        }
+#endif
        HDMIRdReg(HDMI_STATUS,&value);
        
        hdmi_dbg(hdmi->dev, "[%s] value %02x\n", __FUNCTION__, value);
@@ -419,41 +421,22 @@ int rk616_hdmi_removed(void)
 void rk616_hdmi_work(void)
 {              
        u32 interrupt = 0;
-        static int hpd = 0;
+        int value = 0;
 
-        /* if hdmi_irq == INVALID_GPIO use irq mode, else use roll polling method */
-        if (g_rk616_hdmi->pdata->hdmi_irq == INVALID_GPIO) {
-       
-               HDMIRdReg(INTERRUPT_STATUS1,&interrupt);
-               HDMIWrReg(INTERRUPT_STATUS1, interrupt);
-
-               if(interrupt & m_HOTPLUG){
-                       if(hdmi->state == HDMI_SLEEP)
-                               hdmi->state = WAIT_HOTPLUG;
-                       if(hdmi->pwr_mode == LOWER_PWR)
-                               rk616_hdmi_set_pwr_mode(NORMAL);
-
-                       queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));   
-               }
-
-        } else {
-                int value = 0;
-                HDMIRdReg(HDMI_STATUS,&value);
-                if((value & m_HOTPLUG)&& hpd == 0){
-                       if(hdmi->state == HDMI_SLEEP)
-                               hdmi->state = WAIT_HOTPLUG;
-                       if(hdmi->pwr_mode == LOWER_PWR)
-                               rk616_hdmi_set_pwr_mode(NORMAL);
-
-                       queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));   
-                        hpd = 1;
-                } else if (((value & m_HOTPLUG)== 0) && (hpd == 1)) {
-                        queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));  
-                        hpd = 0;
-
-                }
+        HDMIRdReg(INTERRUPT_STATUS1,&interrupt);
+        if(interrupt){
+                HDMIWrReg(INTERRUPT_STATUS1, interrupt);
         }
 
+       if(interrupt & m_HOTPLUG){
+                if(hdmi->state == HDMI_SLEEP)
+                       hdmi->state = WAIT_HOTPLUG;
+               if(hdmi->pwr_mode == LOWER_PWR)
+                       rk616_hdmi_set_pwr_mode(NORMAL);
+
+               queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));   
+
+        }
 
 #if 0  
        if(hdmi->state == HDMI_SLEEP) {