Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org
Cc: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev,
	lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com
Subject: [PATCH 1/7] ASoC: SDCA: Align mute controls to ALSA expectations
Date: Thu, 27 Nov 2025 16:34:20 +0000	[thread overview]
Message-ID: <20251127163426.2500633-2-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20251127163426.2500633-1-ckeepax@opensource.cirrus.com>

Currently mute controls will be called "FU xx Mute Switch" (note
the switch is added programmatically outside the coverage of this
patch) and the accompanying volume control would be called "FU xx
Channel Volume".  These names are taken from the SDCA specification,
however, this does not mesh well with the ALSA naming system. ALSA
generally expects enables rather than mutes and expects that mutes
and volumes have matching names.

Update the names and invert the mute controls to make them more
standard "FU XX Channel Switch", this does slightly deviate from
the SDCA specification but it makes the rest of the Linux ecosystem
a lot happier.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 include/sound/sdca_function.h | 2 +-
 sound/soc/sdca/sdca_asoc.c    | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/sound/sdca_function.h b/include/sound/sdca_function.h
index c97861508a158..2564fad33fd46 100644
--- a/include/sound/sdca_function.h
+++ b/include/sound/sdca_function.h
@@ -611,7 +611,7 @@ enum sdca_entity0_controls {
 #define SDCA_CTL_NDAI_PACKETTYPE_NAME			"NDAI Packet Type"
 #define SDCA_CTL_MIXER_NAME				"Mixer"
 #define SDCA_CTL_SELECTOR_NAME				"Selector"
-#define SDCA_CTL_MUTE_NAME				"Mute"
+#define SDCA_CTL_MUTE_NAME				"Channel"
 #define SDCA_CTL_CHANNEL_VOLUME_NAME			"Channel Volume"
 #define SDCA_CTL_AGC_NAME				"AGC"
 #define SDCA_CTL_BASS_BOOST_NAME			"Bass Boost"
diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c
index 4e3f193c75eff..0e21ed1091720 100644
--- a/sound/soc/sdca/sdca_asoc.c
+++ b/sound/soc/sdca/sdca_asoc.c
@@ -886,6 +886,9 @@ static int populate_control(struct device *dev,
 	mc->min = 0;
 	mc->max = clamp((0x1ull << control->nbits) - 1, 0, type_max(mc->max));
 
+	if (SDCA_CTL_TYPE(entity->type, control->sel) == SDCA_CTL_TYPE_S(FU, MUTE))
+		mc->invert = true;
+
 	(*kctl)->name = control_name;
 	(*kctl)->private_value = (unsigned long)mc;
 	(*kctl)->iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-- 
2.47.3


  reply	other threads:[~2025-11-27 16:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27 16:34 [PATCH 0/7] Add support for cs42l45 into the Intel machine driver Charles Keepax
2025-11-27 16:34 ` Charles Keepax [this message]
2025-11-27 19:16   ` [PATCH 1/7] ASoC: SDCA: Align mute controls to ALSA expectations Mark Brown
2025-11-28  9:23     ` Charles Keepax
2025-11-27 16:34 ` [PATCH 2/7] ASoC: SDCA: Add terminal type into input/output widget name Charles Keepax
2025-11-27 16:34 ` [PATCH 3/7] ASoC: sdw_utils: Add codec_conf for every DAI Charles Keepax
2025-11-27 16:34 ` [PATCH 4/7] ASoC: sdw_utils: Move codec_name to dai info Charles Keepax
2025-11-27 16:34 ` [PATCH 5/7] ASoC: intel: sof_sdw: Add ability to have auxiliary devices Charles Keepax
2025-11-27 16:34 ` [PATCH 6/7] ASoC: sdw_utils: Add cs42l45 support functions Charles Keepax
2025-11-27 16:34 ` [PATCH 7/7] ASoC: intel: sof_sdw: Add codec_info for cs42l45 Charles Keepax
2025-11-28 18:01 ` [PATCH 0/7] Add support for cs42l45 into the Intel machine driver 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=20251127163426.2500633-2-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=yung-chuan.liao@linux.intel.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