* [PATCH] ASoC: Simplify WM9081 speaker startup by using widgets for spaker output
@ 2011-03-08 18:52 Mark Brown
2011-03-09 11:55 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-03-08 18:52 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
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>
---
sound/soc/codecs/wm9081.c | 32 ++++++--------------------------
1 files changed, 6 insertions(+), 26 deletions(-)
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index effaf75..55cdf29 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -389,27 +389,6 @@ SOC_DAPM_SINGLE("IN2 Switch", WM9081_ANALOGUE_MIXER, 2, 1, 0),
SOC_DAPM_SINGLE("Playback Switch", WM9081_ANALOGUE_MIXER, 4, 1, 0),
};
-static int speaker_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- struct snd_soc_codec *codec = w->codec;
- unsigned int reg = snd_soc_read(codec, WM9081_POWER_MANAGEMENT);
-
- switch (event) {
- case SND_SOC_DAPM_POST_PMU:
- reg |= WM9081_SPK_ENA;
- break;
-
- case SND_SOC_DAPM_PRE_PMD:
- reg &= ~WM9081_SPK_ENA;
- break;
- }
-
- snd_soc_write(codec, WM9081_POWER_MANAGEMENT, reg);
-
- return 0;
-}
-
struct _fll_div {
u16 fll_fratio;
u16 fll_outdiv;
@@ -747,9 +726,8 @@ SND_SOC_DAPM_MIXER_NAMED_CTL("Mixer", SND_SOC_NOPM, 0, 0,
SND_SOC_DAPM_PGA("LINEOUT PGA", WM9081_POWER_MANAGEMENT, 4, 0, NULL, 0),
-SND_SOC_DAPM_PGA_E("Speaker PGA", WM9081_POWER_MANAGEMENT, 2, 0, NULL, 0,
- speaker_event,
- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+SND_SOC_DAPM_PGA("Speaker PGA", WM9081_POWER_MANAGEMENT, 2, 0, NULL, 0),
+SND_SOC_DAPM_PGA("Speaker", WM9081_POWER_MANAGEMENT, 1, 0, NULL, 0),
SND_SOC_DAPM_OUTPUT("LINEOUT"),
SND_SOC_DAPM_OUTPUT("SPKN"),
@@ -780,8 +758,10 @@ static const struct snd_soc_dapm_route wm9081_audio_paths[] = {
{ "Speaker PGA", NULL, "TOCLK" },
{ "Speaker PGA", NULL, "CLK_SYS" },
- { "SPKN", NULL, "Speaker PGA" },
- { "SPKP", NULL, "Speaker PGA" },
+ { "Speaker", NULL, "Speaker PGA" },
+
+ { "SPKN", NULL, "Speaker" },
+ { "SPKP", NULL, "Speaker" },
};
static int wm9081_set_bias_level(struct snd_soc_codec *codec,
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: Simplify WM9081 speaker startup by using widgets for spaker output
2011-03-08 18:52 [PATCH] ASoC: Simplify WM9081 speaker startup by using widgets for spaker output Mark Brown
@ 2011-03-09 11:55 ` Liam Girdwood
0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2011-03-09 11:55 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches
On Tue, 2011-03-08 at 18:52 +0000, Mark Brown wrote:
> 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@ti.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-09 11:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 18:52 [PATCH] ASoC: Simplify WM9081 speaker startup by using widgets for spaker output Mark Brown
2011-03-09 11:55 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).