summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorb02247 <b02247@freescale.com>2011-12-26 13:28:21 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 21:13:22 +0800
commitd20999933d76fdf6223c12ed52251697a352baa5 (patch)
tree976d1a3321b62391691904a42ee251b7b65fa27d /sound/soc
parentafacfedabc27817f09c6a0243a43db05fc96cb6c (diff)
ENGR00170999 Fix the record end, playback mute
SGTL5000_VAG_POWERUP used by record and playback. when playback and record are opened, close one of them will cause the other mute Signed-off-by: b02247 <b02247@freescale.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/sgtl5000.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index c6d067e95c0c..be219ac9e093 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -132,9 +132,6 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
SGTL5000_BIAS_R_MASK,
SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
-
- snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
- SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
break;
case SND_SOC_DAPM_PRE_PMD:
@@ -145,9 +142,6 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
SGTL5000_BIAS_R_MASK,
SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
-
- snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
- SGTL5000_VAG_POWERUP, 0);
break;
}
return 0;
@@ -163,14 +157,9 @@ static int small_pop_event(struct snd_soc_dapm_widget *w,
{
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
- SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
break;
case SND_SOC_DAPM_PRE_PMD:
- snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
- SGTL5000_VAG_POWERUP, 0);
- msleep(400);
break;
default:
break;
@@ -1139,9 +1128,24 @@ static int sgtl5000_set_bias_level(struct snd_soc_codec *codec,
int ret;
struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
+ if (codec->dapm.bias_level == level)
+ return 0;
+
switch (level) {
case SND_SOC_BIAS_ON:
+
+ ret = snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
+ SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
+ if (ret)
+ msleep(400);
+ break;
+
case SND_SOC_BIAS_PREPARE:
+ ret = snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
+ SGTL5000_VAG_POWERUP, 0);
+ if (ret)
+ msleep(600);
+
break;
case SND_SOC_BIAS_STANDBY:
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
@@ -1153,8 +1157,17 @@ static int sgtl5000_set_bias_level(struct snd_soc_codec *codec,
udelay(10);
}
+ ret = snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
+ SGTL5000_VAG_POWERUP, 0);
+ if (ret)
+ msleep(600);
break;
case SND_SOC_BIAS_OFF:
+ ret = snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
+ SGTL5000_VAG_POWERUP, 0);
+ if (ret)
+ msleep(600);
+
regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
sgtl5000->supplies);
break;