]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix AIC23 sleep power consumption on N770
authorJarkko Nikula <jarkko.nikula@nokia.com>
Thu, 23 Mar 2006 14:35:59 +0000 (10:35 -0400)
committerJuha Yrjola <juha.yrjola@nokia.com>
Thu, 23 Mar 2006 14:35:59 +0000 (10:35 -0400)
If power down command to AIC23 is sent after the clocks are stopped,
the chip remains in a state where it's consuming some extra milliamps.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Juha Yrjola <juha.yrjola@nokia.com>
arch/arm/mach-omap1/board-nokia770.c

index 912025f698df855d2035aea5786450631102009d..02b980d77b12d2079e84d23a27eea010005707be 100644 (file)
@@ -194,6 +194,7 @@ static void codec_delayed_power_down(void *arg)
        down(&audio_pwr_sem);
        if (audio_pwr_state == -1)
                tlv320aic23_power_down();
+       clk_disable(dspxor_ck);
        up(&audio_pwr_sem);
 }
 
@@ -201,8 +202,6 @@ static DECLARE_WORK(codec_power_down_work, codec_delayed_power_down, NULL);
 
 static void nokia770_audio_pwr_down(void)
 {
-       clk_disable(dspxor_ck);
-
        /* Turn off amplifier */
        omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0);
 
@@ -224,16 +223,16 @@ void nokia770_audio_pwr_down_request(int stage)
 {
        down(&audio_pwr_sem);
        switch (stage) {
-               case 1:
-                       if (audio_pwr_state == 0)
-                               audio_pwr_state = 1;
-                       break;
-               case 2:
-                       if (audio_pwr_state == 1) {
-                               nokia770_audio_pwr_down();
-                               audio_pwr_state = -1;
-                       }
-                       break;
+       case 1:
+               if (audio_pwr_state == 0)
+                       audio_pwr_state = 1;
+               break;
+       case 2:
+               if (audio_pwr_state == 1) {
+                       nokia770_audio_pwr_down();
+                       audio_pwr_state = -1;
+               }
+               break;
        }
        up(&audio_pwr_sem);
 }