rk30 hdmi:
authorZheng Yang <zhengyang@rock-chips.com>
Tue, 19 Jun 2012 08:52:47 +0000 (16:52 +0800)
committerZheng Yang <zhengyang@rock-chips.com>
Tue, 19 Jun 2012 08:52:47 +0000 (16:52 +0800)
add CONFIG_HDMI_RK30_CTL_CODEC to enable control codec:
When HDMI inserted, mute codec analog output;
When HDMI removed, unmute codec analog output.

drivers/video/rockchip/hdmi/Kconfig
drivers/video/rockchip/hdmi/rk30_hdmi_task.c

index 76ac81f3ce0f39b869f1e9f16b230bc443424439..654bfa0e67dbea656b7e2381a27eaaacbbcd13a5 100755 (executable)
@@ -1,10 +1,18 @@
-config HDMI_RK30
+menuconfig HDMI_RK30
         bool "RK30 HDMI support"
         depends on LCDC_RK30
         select FB_MODE_HELPERS
         help
            Support rk30 hdmi if you say y here
 
+config HDMI_RK30_CTL_CODEC
+               bool "Mute Codec When HDMI Actived"
+               depends on HDMI_RK30
+               default n
+               help
+                       If you say y heres, Codec will be mute when hdmi inserted,
+                       and unmute when removed. 
+
 config HDMI_RK30_DEBUG
                bool "RK30 HDMI Debugging"
         depends on HDMI_RK30 && LCDC_RK30
index cf34d457696707d9a5d7378c1e0b672a480dc1bd..fbaf507d4453b1074798c337304ee4d534708542 100755 (executable)
@@ -3,6 +3,9 @@
 #include "rk30_hdmi.h"
 #include "rk30_hdmi_hw.h"
 
+#ifdef CONFIG_HDMI_RK30_CTL_CODEC
+extern void codec_set_spk(bool on);
+#endif
 
 #define HDMI_MAX_TRY_TIMES     1
 
@@ -83,6 +86,9 @@ void hdmi_sys_remove(void)
        #ifdef CONFIG_SWITCH
        switch_set_state(&(hdmi->switch_hdmi), 0);
        #endif
+       #if CONFIG_HDMI_RK30_CTL_CODEC
+       codec_set_spk(1);
+       #endif
 }
 
 static void hdmi_sys_sleep(void)
@@ -219,6 +225,9 @@ void hdmi_work(struct work_struct *work)
                                        #ifdef CONFIG_SWITCH
                                        switch_set_state(&(hdmi->switch_hdmi), 1);
                                        #endif
+                                       #ifdef CONFIG_HDMI_RK30_CTL_CODEC
+                                       codec_set_spk(0);
+                                       #endif
                                }
                                break;
                        case SYSTEM_CONFIG: