Re: [PATCH] ASoC: codecs: wsa884x: Add mute control knob

From: Sebastian Reichel

Date: Sat Oct 17 2026 - 15:45:48 EST


Hello Mark,

On Thu, Oct 15, 2026 at 07:10:58PM +0100, Mark Brown wrote:
> On Wed, Oct 14, 2026 at 07:02:54PM +0200, Sebastian Reichel wrote:
>
> > This codec is typically used with ALSA UCM, which right now falls back
> > to handling mute in software. Expose proper hardware mute control
> > considering the driver already handles it internally anyways, which
> > allows UCM to bind speaker mute LED to the new control knob.
>
> > + wsa884x->user_mute = mute;
> > + if (wsa884x->pa_on)
> > + wsa884x_set_mute(component, mute || wsa884x->trigger_mute);
>
> This is checking for pa_on but...
>
> > static int wsa884x_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
> > {
>
> > + guard(mutex)(&wsa884x->sp_lock);
> > + wsa884x->trigger_mute = mute;
> > + wsa884x_set_mute(component, mute || wsa884x->user_mute);
>
> ...I can't see what guarantees that pa_on is set here. It looks like
> these are mono speakers with multiple speakers connected to a stream,
> someone could fiddle with the routing on an active stream and power up a
> speaker. We should probably recheck in the speaker event.

pa_on is set via SND_SOC_DAPM_POST_PMU/SND_SOC_DAPM_PRE_PMD. My
rationale was, that mute update is not needed with the widget
powered down and at startup the .mute_stream handler will update
the mute state automatically.

Greetings,

-- Sebastian

Attachment: signature.asc
Description: PGP signature