Re: [PATCH] ASoC: rt722-sdca: add FU06 Playback Switch for speaker mute control

Pierre-Louis Bossart
2026-04-23T13:01:32Z

On 4/23/26 12:13, Aaron Ma wrote:
> The rt722-sdca codec driver exposes FU06 Playback Volume but no
> corresponding mute switch. Without a user-facing ALSA switch, UCM
> cannot attach the speaker mute LED via snd_ctl_led, and PipeWire
> cannot drive hardware mute.
>
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
> sound/soc/codecs/rt722-sdca.c | 77 ++++++++++++++++++++++++++++-------
> sound/soc/codecs/rt722-sdca.h | 4 ++
> 2 files changed, 67 insertions(+), 14 deletions(-)
>
> diff --git a/sound/soc/codecs/rt722-sdca.c b/sound/soc/codecs/rt722-sdca.c
> index 79b8b7e70a334..23d2f63d68ef3 100644
> --- a/sound/soc/codecs/rt722-sdca.c
> +++ b/sound/soc/codecs/rt722-sdca.c
> @@ -517,6 +517,61 @@ static int rt722_sdca_fu1e_capture_put(struct snd_kcontrol *kcontrol,
> return changed;
> }
>
> +static int rt722_sdca_set_fu06_playback_ctl(struct rt722_sdca_priv *rt722)
> +{
> + int err;
> + unsigned int ch_l, ch_r;
> +
> + ch_l = (rt722->fu06_dapm_mute || rt722->fu06_mixer_l_mute) ? 0x01 : 0x00;
> + ch_r = (rt722->fu06_dapm_mute || rt722->fu06_mixer_r_mute) ? 0x01 : 0x00;
> +
> + err = regmap_write(rt722->regmap,
> + SDW_SDCA_CTL(FUNC_NUM_AMP, RT722_SDCA_ENT_USER_FU06,
> + RT722_SDCA_CTL_FU_MUTE, CH_L), ch_l);
> + if (err < 0)
> + return err;
> +
> + err = regmap_write(rt722->regmap,
> + SDW_SDCA_CTL(FUNC_NUM_AMP, RT722_SDCA_ENT_USER_FU06,
> + RT722_SDCA_CTL_FU_MUTE, CH_R), ch_r);

IIRC you can mute all channels at once in a FU (Feature Unit) using Control Number 0.

If both channels need to be muted/unmuted it's better to do so in a single command.