{
WM8900_DBG("Enter::wm8900 work, power down wm8900\n");
- snd_soc_write(wm8900_codec, WM8900_REG_RESET, 0);
-
#ifdef SPK_CON
gpio_set_value(SPK_CON, GPIO_LOW);
#endif
+ snd_soc_write(wm8900_codec, WM8900_REG_RESET, 0);
wm8900_current_status = WM8900_IS_SHUTDOWN;
}
snd_soc_write(codec, WM8900_REG_DACCTRL, 0x00);
snd_soc_write(codec, WM8900_REG_LOUTMIXCTL1, 0x150);
snd_soc_write(codec, WM8900_REG_ROUTMIXCTL1, 0x150);
- snd_soc_write(codec, WM8900_REG_LOUT2CTL, 0x133);
- snd_soc_write(codec, WM8900_REG_ROUT2CTL, 0x133);
snd_soc_write(codec, WM8900_REG_HPCTL1, 0xB0);
snd_soc_write(codec, WM8900_REG_HPCTL1, 0xF0);
snd_soc_write(codec, WM8900_REG_HPCTL1, 0xC0);
- //for SPK out
- snd_soc_write(codec, WM8900_REG_LOUT1CTL, 0x130);
- snd_soc_write(codec, WM8900_REG_ROUT1CTL, 0x130);
-
//for recorder
snd_soc_write(codec, WM8900_REG_POWER1, 0x211D);
snd_soc_write(codec, WM8900_REG_POWER2, 0xC1AF);
struct snd_soc_codec *codec = codec_dai->codec;
u16 reg;
- WM8900_DBG("Enter:%s, %d \n", __FUNCTION__, __LINE__);
-
- reg = snd_soc_read(codec, WM8900_REG_DACCTRL);
+ WM8900_DBG("Enter:%s, %d , mute = %d \n", __FUNCTION__, __LINE__, mute);
if (mute)
- reg |= WM8900_REG_DACCTRL_MUTE;
- else
- reg &= ~WM8900_REG_DACCTRL_MUTE;
+ return 0;
+ reg = snd_soc_read(codec, WM8900_REG_DACCTRL);
+
+ reg &= ~WM8900_REG_DACCTRL_MUTE;
snd_soc_write(codec, WM8900_REG_DACCTRL, reg);
+ /* Turn up vol slowly, for SPK out pop */
+ for (reg = 0; reg <= 0x30; reg += 0x10) {
+ if (snd_soc_read(codec, WM8900_REG_LOUT1CTL) < 0x30)
+ snd_soc_write(codec, WM8900_REG_LOUT1CTL, 0x100 + reg);
+
+ if (snd_soc_read(codec, WM8900_REG_ROUT1CTL) < 0x30)
+ snd_soc_write(codec, WM8900_REG_ROUT1CTL, 0x100 + reg);
+ }
+ snd_soc_write(codec, WM8900_REG_LOUT1CTL, 0x130);
+ snd_soc_write(codec, WM8900_REG_ROUT1CTL, 0x130);
+
+ /* Turn up vol slowly, for HP out pop */
+ for (reg = 0; reg <= 0x33; reg += 0x10) {
+ if (snd_soc_read(codec, WM8900_REG_LOUT2CTL) < 0x33)
+ snd_soc_write(codec, WM8900_REG_LOUT2CTL, 0x100 + reg);
+
+ if (snd_soc_read(codec, WM8900_REG_ROUT2CTL) < 0x33)
+ snd_soc_write(codec, WM8900_REG_ROUT2CTL, 0x100 + reg);
+ }
+ snd_soc_write(codec, WM8900_REG_LOUT2CTL, 0x133);
+ snd_soc_write(codec, WM8900_REG_ROUT2CTL, 0x133);
+
return 0;
}