mfd:rk616 hdmi:fix irq respond err
authoryzq <yzq@rock-chips.com>
Mon, 6 May 2013 06:22:00 +0000 (14:22 +0800)
committeryzq <yzq@rock-chips.com>
Mon, 6 May 2013 07:08:12 +0000 (15:08 +0800)
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi.c
drivers/video/rockchip/hdmi/chips/rk616/rk616_hdmi_hw.c
drivers/video/rockchip/hdmi/rk_hdmi_sysfs.c

index ed92cecf2366ffd2d673fc3dc3c68cea704aa99c..4a715487ddaa9e7428439e145e7ceeda744cbd4e 100755 (executable)
@@ -147,8 +147,9 @@ static void hdmi_early_resume(struct early_suspend *h)
        rk616_hdmi_initial();
        if(hdmi->enable) {
                enable_irq(hdmi->irq);
-               queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, 0);
+               hdmi_irq();
        }
+       queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));   
        mutex_unlock(&hdmi->enable_mutex);
        return;
 }
@@ -260,8 +261,8 @@ static int __devinit rk616_hdmi_probe (struct platform_device *pdev)
                debugfs_create_file("hdmi", S_IRUSR,rk616->debugfs_dir,rk616,&rk616_hdmi_reg_fops);
        }
 #endif
-       //rk616_irq_work_func(NULL);
-       queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10));   
+       rk616_irq_work_func(NULL);
+       //queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, msecs_to_jiffies(10)); 
        dev_info(hdmi->dev, "rk616 hdmi probe success.\n");
        return 0;
 err1:
index 6f6b286ba6561e2c9a113af746fc5f41b0a4b423..5398cb856ed0167b5e85b05de77d3c7990fbe63d 100755 (executable)
@@ -83,6 +83,10 @@ static void rk616_hdmi_set_pwr_mode(int mode)
 int rk616_hdmi_detect_hotplug(void)
 {
        int value = 0;
+       HDMIRdReg(INTERRUPT_STATUS1,&value);
+       if(value){
+               HDMIWrReg(INTERRUPT_STATUS1, value);
+       }
        HDMIRdReg(HDMI_STATUS,&value);
        
        hdmi_dbg(hdmi->dev, "[%s] value %02x\n", __FUNCTION__, value);
@@ -353,14 +357,15 @@ static int rk616_hdmi_config_audio(struct hdmi_audio *audio)
                        return -ENOENT;
        }
 
+       //set_audio source I2S
        if(HDMI_CODEC_SOURCE_SELECT == INPUT_IIS){
-               //set_audio source I2S
+               HDMIWrReg(AUDIO_CTRL1, 0x00); 
                HDMIWrReg(AUDIO_SAMPLE_RATE, rate);
                HDMIWrReg(AUDIO_I2S_MODE, v_I2S_MODE(I2S_STANDARD) | v_I2S_CHANNEL(channel) );  
                HDMIWrReg(AUDIO_I2S_MAP, 0x00); 
                HDMIWrReg(AUDIO_I2S_SWAPS_SPDIF, 0); // no swap 
        }else{
-               HDMIWrReg(AUDIO_CTRL1, 0x08); //internal CTS, disable down sample, i2s input, disable MCLK
+               HDMIWrReg(AUDIO_CTRL1, 0x08);
                HDMIWrReg(AUDIO_I2S_SWAPS_SPDIF, 0); // no swap 
        }
                
@@ -423,11 +428,12 @@ void hdmi_irq(void)
                        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) {
 //             hdmi_dbg(hdmi->dev, "hdmi return to sleep mode\n");
                rk616_hdmi_set_pwr_mode(LOWER_PWR);
        }
+#endif
 #if 0
        if(hdmi->hdcp_irq_cb)
                hdmi->hdcp_irq_cb(interrupt2);
index a6b1fcdfa571ae6ad06c4e61dd2aae72d91f0580..971f16810c5ff1cf954acdf5ef4e14341614294f 100755 (executable)
@@ -42,7 +42,7 @@ static int hdmi_set_enable(struct rk_display_device *device, int enable)
        else {
                if(hdmi->irq)
                        enable_irq(hdmi->irq);
-               #if defined(CONFIG_HDMI_RK610) || defined(CONFIG_HDMI_RK2928) || defined(CONFIG_HDMI_CAT66121)
+               #if defined(CONFIG_HDMI_RK610) || defined(CONFIG_HDMI_RK2928) || defined(CONFIG_HDMI_CAT66121) || defined(CONFIG_HDMI_RK616)
                        queue_delayed_work(hdmi->workqueue, &hdmi->delay_work, 0);
                #endif
                mutex_unlock(&hdmi->enable_mutex);