Skip to content

Commit 5fee9ed

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: SDCA: Align mute controls to ALSA expectations
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> Link: https://patch.msgid.link/20251127163426.2500633-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c45d5d9 commit 5fee9ed

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

include/sound/sdca_function.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ enum sdca_entity0_controls {
611611
#define SDCA_CTL_NDAI_PACKETTYPE_NAME "NDAI Packet Type"
612612
#define SDCA_CTL_MIXER_NAME "Mixer"
613613
#define SDCA_CTL_SELECTOR_NAME "Selector"
614-
#define SDCA_CTL_MUTE_NAME "Mute"
614+
#define SDCA_CTL_MUTE_NAME "Channel"
615615
#define SDCA_CTL_CHANNEL_VOLUME_NAME "Channel Volume"
616616
#define SDCA_CTL_AGC_NAME "AGC"
617617
#define SDCA_CTL_BASS_BOOST_NAME "Bass Boost"

sound/soc/sdca/sdca_asoc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,9 @@ static int populate_control(struct device *dev,
886886
mc->min = 0;
887887
mc->max = clamp((0x1ull << control->nbits) - 1, 0, type_max(mc->max));
888888

889+
if (SDCA_CTL_TYPE(entity->type, control->sel) == SDCA_CTL_TYPE_S(FU, MUTE))
890+
mc->invert = true;
891+
889892
(*kctl)->name = control_name;
890893
(*kctl)->private_value = (unsigned long)mc;
891894
(*kctl)->iface = SNDRV_CTL_ELEM_IFACE_MIXER;

0 commit comments

Comments
 (0)