summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/sgtl5000.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 3a29c0ac5d8a..3fe5da7ce497 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -193,6 +193,12 @@ static int power_vag_event(struct snd_soc_dapm_widget *w,
case SND_SOC_DAPM_PRE_PMD:
/*
+ * Don't clear VAG_POWERUP when there is a local loop
+ * from LINE_IN to the DAC.
+ */
+ if (snd_soc_read(codec, SGTL5000_CHIP_ANA_CTRL) & (1<<6))
+ break;
+ /*
* Don't clear VAG_POWERUP, when both DAC and ADC are
* operational to prevent inadvertently starving the
* other one of them.
@@ -250,7 +256,9 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
SND_SOC_DAPM_PGA("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0),
SND_SOC_DAPM_MUX("Capture Mux", SND_SOC_NOPM, 0, 0, &adc_mux),
- SND_SOC_DAPM_MUX("Headphone Mux", SND_SOC_NOPM, 0, 0, &dac_mux),
+ SND_SOC_DAPM_MUX_E("Headphone Mux", SND_SOC_NOPM, 0, 0, &dac_mux,
+ power_vag_event,
+ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_POST_PMD),
/* aif for i2s input */
SND_SOC_DAPM_AIF_IN("AIFIN", "Playback",