public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Aaron Ma <aaron.ma@canonical.com>,
	oder_chiou@realtek.com, lgirdwood@gmail.com, broonie@kernel.org,
	perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: rt722-sdca: add FU06 Playback Switch for speaker mute control
Date: Thu, 23 Apr 2026 15:01:07 +0200	[thread overview]
Message-ID: <76827f27-1a27-422f-8e83-5f5e5ae0f7ef@linux.dev> (raw)
In-Reply-To: <20260423101338.1040131-1-aaron.ma@canonical.com>

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.


  reply	other threads:[~2026-04-23 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 10:13 [PATCH] ASoC: rt722-sdca: add FU06 Playback Switch for speaker mute control Aaron Ma
2026-04-23 13:01 ` Pierre-Louis Bossart [this message]
2026-04-24  3:52   ` Aaron Ma
2026-04-24 13:09     ` Pierre-Louis Bossart
2026-04-24 15:53       ` Charles Keepax
2026-04-26 23:23 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76827f27-1a27-422f-8e83-5f5e5ae0f7ef@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=aaron.ma@canonical.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox