[alsa-devel] [PATCH] ASoC: WM8770: Initial driver

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Nov 5 18:21:01 CET 2010


On Fri, Nov 05, 2010 at 03:31:45PM +0000, Dimitris Papastamos wrote:

> +	SND_SOC_DAPM_MIXER_E("VOUT1 Mixer", SND_SOC_NOPM, 0, 0,
> +		vout1_mix_controls, ARRAY_SIZE(vout1_mix_controls),
> +		vout12mixer_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
> +	SND_SOC_DAPM_MIXER_E("VOUT2 Mixer", SND_SOC_NOPM, 0, 0,
> +		vout2_mix_controls, ARRAY_SIZE(vout2_mix_controls),
> +		vout12mixer_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),

Both of these use this event:

> +static int vout12mixer_event(struct snd_soc_dapm_widget *w,
> +	struct snd_kcontrol *kcontrol, int event)
> +{
> +	struct snd_soc_codec *codec;
> +
> +	codec = w->codec;
> +
> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		snd_soc_update_bits(codec, WM8770_OUTMUX1, 0x180, 0);
> +		break;
> +	case SND_SOC_DAPM_PRE_PMD:
> +		snd_soc_update_bits(codec, WM8770_OUTMUX1, 0x180, 0x180);
> +		break;
> +	}

If one widget is powered down while the other is kept active then this
will power down both which probably isn't what was wanted.  This can be
handled by attaching the event to a _SUPPLY widget which feeds into both
mixers, or by explicit reference counting in the event.


More information about the Alsa-devel mailing list