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

Pierre-Louis Bossart
2026-04-24T13:25:11Z

On 4/24/26 05:52, Aaron Ma wrote:
> On Thu, Apr 23, 2026 at 9:01 PM Pierre-Louis Bossart
> <pierre-louis.bossart@linux.dev> wrote:
>>
>> 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.
>>
>
> Thanks for the review.
>
> The per-channel mute writes are unchanged from the existing DAPM
> handler, just moved into a helper.
> All rt711/rt712/rt722 drivers use per-channel writes for FU_MUTE — no
> CN0 precedent exists.

Fair enough, something to do in the future...

While I am at it, in theory those registers are Dual-Ranked, with a 'commit' mechanism to deal with all volume changes at the same time. We'll need to add support for Dual-Ranked registers at some point, not sure how this can be bolted in regmap support... Cc: Charles for future SDCA improvements...

For now, here's a

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>