[PATCH 3/4] ASoC: wm8940: Mute also the speaker output

Charles Keepax ckeepax at opensource.cirrus.com
Wed Dec 14 14:09:12 CET 2022


On Wed, Dec 14, 2022 at 01:37:42PM +0100, Lukasz Majewski wrote:
> Without this change the BTL speaker produces some
> "distortion" noise when test program
> (speaker-test -t waw) is ended with ctrl+c.
> 
> As our design uses speaker outputs to drive BTL speaker,
> it was necessary to also mute the speaker via the codec
> internal WM8940_SPKVOL register with setting
> WM8940_SPKMUTE bit.
> 
> Signed-off-by: Lukasz Majewski <lukma at denx.de>
> ---
> +	spkvol_reg &= ~WM8940_SPKMUTE;
> +	if (mute) {
>  		mute_reg |= 0x40;
> +		spkvol_reg |= WM8940_SPKMUTE;
> +	}
> +
> +	ret = snd_soc_component_write(component, WM8940_SPKVOL, spkvol_reg);
> +	if (ret)
> +		return ret;

This bit is also controlled by the "Speaker Playback Switch" so
you probably need some locking between them to stop them
clobbering each other.

Thanks,
Charles


More information about the Alsa-devel mailing list