diff options
| -rw-r--r-- | sound/soc/codecs/twl4030.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index ccaeb366eb7c..277e99ce5558 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
| @@ -620,6 +620,20 @@ static int vibramux_event(struct snd_soc_dapm_widget *w, | |||
| 620 | return 0; | 620 | return 0; |
| 621 | } | 621 | } |
| 622 | 622 | ||
| 623 | static int apll_event(struct snd_soc_dapm_widget *w, | ||
| 624 | struct snd_kcontrol *kcontrol, int event) | ||
| 625 | { | ||
| 626 | switch (event) { | ||
| 627 | case SND_SOC_DAPM_PRE_PMU: | ||
| 628 | twl4030_apll_enable(w->codec, 1); | ||
| 629 | break; | ||
| 630 | case SND_SOC_DAPM_POST_PMD: | ||
| 631 | twl4030_apll_enable(w->codec, 0); | ||
| 632 | break; | ||
| 633 | } | ||
| 634 | return 0; | ||
| 635 | } | ||
| 636 | |||
| 623 | static void headset_ramp(struct snd_soc_codec *codec, int ramp) | 637 | static void headset_ramp(struct snd_soc_codec *codec, int ramp) |
| 624 | { | 638 | { |
| 625 | struct snd_soc_device *socdev = codec->socdev; | 639 | struct snd_soc_device *socdev = codec->socdev; |
| @@ -1185,6 +1199,9 @@ static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = { | |||
| 1185 | SND_SOC_DAPM_MIXER("Analog Voice Playback Mixer", | 1199 | SND_SOC_DAPM_MIXER("Analog Voice Playback Mixer", |
| 1186 | TWL4030_REG_VDL_APGA_CTL, 0, 0, NULL, 0), | 1200 | TWL4030_REG_VDL_APGA_CTL, 0, 0, NULL, 0), |
| 1187 | 1201 | ||
| 1202 | SND_SOC_DAPM_SUPPLY("APLL Enable", SND_SOC_NOPM, 0, 0, apll_event, | ||
| 1203 | SND_SOC_DAPM_PRE_PMU|SND_SOC_DAPM_POST_PMD), | ||
| 1204 | |||
| 1188 | /* Output MIXER controls */ | 1205 | /* Output MIXER controls */ |
| 1189 | /* Earpiece */ | 1206 | /* Earpiece */ |
| 1190 | SND_SOC_DAPM_MIXER("Earpiece Mixer", SND_SOC_NOPM, 0, 0, | 1207 | SND_SOC_DAPM_MIXER("Earpiece Mixer", SND_SOC_NOPM, 0, 0, |
| @@ -1312,6 +1329,13 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
| 1312 | {"Digital R2 Playback Mixer", NULL, "DAC Right2"}, | 1329 | {"Digital R2 Playback Mixer", NULL, "DAC Right2"}, |
| 1313 | {"Digital Voice Playback Mixer", NULL, "DAC Voice"}, | 1330 | {"Digital Voice Playback Mixer", NULL, "DAC Voice"}, |
| 1314 | 1331 | ||
| 1332 | /* Supply for the digital part (APLL) */ | ||
| 1333 | {"Digital R1 Playback Mixer", NULL, "APLL Enable"}, | ||
| 1334 | {"Digital L1 Playback Mixer", NULL, "APLL Enable"}, | ||
| 1335 | {"Digital R2 Playback Mixer", NULL, "APLL Enable"}, | ||
| 1336 | {"Digital L2 Playback Mixer", NULL, "APLL Enable"}, | ||
| 1337 | {"Digital Voice Playback Mixer", NULL, "APLL Enable"}, | ||
| 1338 | |||
| 1315 | {"Analog L1 Playback Mixer", NULL, "Digital L1 Playback Mixer"}, | 1339 | {"Analog L1 Playback Mixer", NULL, "Digital L1 Playback Mixer"}, |
| 1316 | {"Analog R1 Playback Mixer", NULL, "Digital R1 Playback Mixer"}, | 1340 | {"Analog R1 Playback Mixer", NULL, "Digital R1 Playback Mixer"}, |
| 1317 | {"Analog L2 Playback Mixer", NULL, "Digital L2 Playback Mixer"}, | 1341 | {"Analog L2 Playback Mixer", NULL, "Digital L2 Playback Mixer"}, |
| @@ -1472,14 +1496,12 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec, | |||
| 1472 | { | 1496 | { |
| 1473 | switch (level) { | 1497 | switch (level) { |
| 1474 | case SND_SOC_BIAS_ON: | 1498 | case SND_SOC_BIAS_ON: |
| 1475 | twl4030_apll_enable(codec, 1); | ||
| 1476 | break; | 1499 | break; |
| 1477 | case SND_SOC_BIAS_PREPARE: | 1500 | case SND_SOC_BIAS_PREPARE: |
| 1478 | break; | 1501 | break; |
| 1479 | case SND_SOC_BIAS_STANDBY: | 1502 | case SND_SOC_BIAS_STANDBY: |
| 1480 | if (codec->bias_level == SND_SOC_BIAS_OFF) | 1503 | if (codec->bias_level == SND_SOC_BIAS_OFF) |
| 1481 | twl4030_power_up(codec); | 1504 | twl4030_power_up(codec); |
| 1482 | twl4030_apll_enable(codec, 0); | ||
| 1483 | break; | 1505 | break; |
| 1484 | case SND_SOC_BIAS_OFF: | 1506 | case SND_SOC_BIAS_OFF: |
| 1485 | twl4030_power_down(codec); | 1507 | twl4030_power_down(codec); |
