ASoC: Intel: cirrus-common: Use UID to map correct amp to prefix
authorStefan Binding <sbinding@opensource.cirrus.com>
Mon, 1 Aug 2022 09:40:34 +0000 (10:40 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 15 Aug 2022 00:20:02 +0000 (01:20 +0100)
commit1ca726424a12962f2c2656cc9cdd0b8668117e8f
treec8dd256c447ac18f3351c71a21371916b62cdaf7
parent1b5efeabf75a74043f1eb509ca3ac183b3ffaf89
ASoC: Intel: cirrus-common: Use UID to map correct amp to prefix

Since the order of the amps in the ACPI determines the device name,
and the ACPI order may change depending on hardware configuration,
use UID to dynamically compute the dai links, allowing dynamic
assignment of the name_prefix.

The UIDs for these amps in ACPI are fixed, and map to a name_prefix,
where:
UID 0x0 -> WL
UID 0x1 -> WR
UID 0x2 -> TL
UID 0x3 -> TR

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220801094034.3927841-1-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_cirrus_common.c