ASoC: SDCA: Create ALSA controls from DisCo
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 16 May 2025 13:10:10 +0000 (14:10 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 20 May 2025 10:15:40 +0000 (11:15 +0100)
commitc3ca24e3fcb656c6afe702b69e6e9efcc3ff1128
treeeb8a327d45c032fa29facc35dd5ffa480e5f72b5
parent2c8b3a8e6aa877583e5dc2f669a8adc896a771d4
ASoC: SDCA: Create ALSA controls from DisCo

Use the previously parsed DisCo information from ACPI to create the
ALSA controls required by an SDCA Function. This maps all User and
Application level SDCA Controls to ALSA controls. Typically controls
marked with those access levels are just volumes and mutes.

SDCA defines volume controls as an integer in 1/256ths of a dB and
then provides a mechanism to specify what values are valid (range
templates). Currently only a simple case of a single linear volume
range with a power of 2 step size is supported. This allows the code
to expose the volume control using a simple shift. This will need
expanded in the future, to support more complex ranges and probably
also some additional control types but this should be sufficient to
for a first pass.

For non-dataport terminal widgets also add a pin switch to allow
that endpoint to be turned on/off.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20250516131011.221310-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sdca_asoc.h
include/sound/sdca_function.h
sound/soc/sdca/sdca_asoc.c