OMAP3: PM: disable sys_clkreq signalling while audio is active
[pandora-kernel.git] / sound / soc / codecs / twl4030.c
index a99ac9b..1609e15 100644 (file)
@@ -38,6 +38,9 @@
 /* Register descriptions are here */
 #include <linux/mfd/twl4030-audio.h>
 
+/* HACK */
+extern void omap3_pm_alow_pmic_idle(int allow);
+
 /* Shadow register used by the audio driver */
 #define TWL4030_REG_SW_SHADOW          0x4A
 #define TWL4030_CACHEREGNUM    (TWL4030_REG_SW_SHADOW + 1)
@@ -1627,11 +1630,18 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec,
        case SND_SOC_BIAS_PREPARE:
                break;
        case SND_SOC_BIAS_STANDBY:
-               if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
+               if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
                        twl4030_codec_enable(codec, 1);
+                       /* pandora hack: there seems to be a problem when
+                        * sys_clkreq PMIC signalling is enabled, it looks like
+                        * twl does not provide stable 256fs clock in such a
+                        * case and distrupts the DAC */
+                       omap3_pm_alow_pmic_idle(0);
+               }
                break;
        case SND_SOC_BIAS_OFF:
                twl4030_codec_enable(codec, 0);
+               omap3_pm_alow_pmic_idle(1);
                break;
        }
        codec->dapm.bias_level = level;