ASoC: Simplify WM9081 speaker startup by using widgets for spaker output

Now we have a register write minimisation code in DAPM we don't need to
worry about the ordering of the enable and disable of the PGA and the
output stage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

+6 -26
+6 -26
sound/soc/codecs/wm9081.c
··· 389 389 SOC_DAPM_SINGLE("Playback Switch", WM9081_ANALOGUE_MIXER, 4, 1, 0), 390 390 }; 391 391 392 - static int speaker_event(struct snd_soc_dapm_widget *w, 393 - struct snd_kcontrol *kcontrol, int event) 394 - { 395 - struct snd_soc_codec *codec = w->codec; 396 - unsigned int reg = snd_soc_read(codec, WM9081_POWER_MANAGEMENT); 397 - 398 - switch (event) { 399 - case SND_SOC_DAPM_POST_PMU: 400 - reg |= WM9081_SPK_ENA; 401 - break; 402 - 403 - case SND_SOC_DAPM_PRE_PMD: 404 - reg &= ~WM9081_SPK_ENA; 405 - break; 406 - } 407 - 408 - snd_soc_write(codec, WM9081_POWER_MANAGEMENT, reg); 409 - 410 - return 0; 411 - } 412 - 413 392 struct _fll_div { 414 393 u16 fll_fratio; 415 394 u16 fll_outdiv; ··· 726 747 727 748 SND_SOC_DAPM_PGA("LINEOUT PGA", WM9081_POWER_MANAGEMENT, 4, 0, NULL, 0), 728 749 729 - SND_SOC_DAPM_PGA_E("Speaker PGA", WM9081_POWER_MANAGEMENT, 2, 0, NULL, 0, 730 - speaker_event, 731 - SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 750 + SND_SOC_DAPM_PGA("Speaker PGA", WM9081_POWER_MANAGEMENT, 2, 0, NULL, 0), 751 + SND_SOC_DAPM_PGA("Speaker", WM9081_POWER_MANAGEMENT, 1, 0, NULL, 0), 732 752 733 753 SND_SOC_DAPM_OUTPUT("LINEOUT"), 734 754 SND_SOC_DAPM_OUTPUT("SPKN"), ··· 758 780 { "Speaker PGA", NULL, "TOCLK" }, 759 781 { "Speaker PGA", NULL, "CLK_SYS" }, 760 782 761 - { "SPKN", NULL, "Speaker PGA" }, 762 - { "SPKP", NULL, "Speaker PGA" }, 783 + { "Speaker", NULL, "Speaker PGA" }, 784 + 785 + { "SPKN", NULL, "Speaker" }, 786 + { "SPKP", NULL, "Speaker" }, 763 787 }; 764 788 765 789 static int wm9081_set_bias_level(struct snd_soc_codec *codec,