ASoC: Intel: avs: Improve topology parsing of dynamic strings
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Thu, 12 Oct 2023 08:35:01 +0000 (10:35 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 12 Oct 2023 12:04:39 +0000 (13:04 +0100)
commite6d50e474e45862096932edc31932fbbd5e8f1c7
treee6d7a68a5c6fce6f5ca89bc7f7a9727fe3ef596a
parent7a6debe0478596ac892ecf3cc336aacf09a9e4d8
ASoC: Intel: avs: Improve topology parsing of dynamic strings

Current mechanism replaces "%d" present in some routes and widget names
with SSP number. However there are also configurations which make use of
TDM number, in which case expected behavior would be to have string in
form of SSP:TDM - see implementation of avs_i2s_platform_register() in
sound/soc/intel/avs/pcm.c.

Implement custom function, which parses string and make use of it when
parsing topology. While at it make sure that we generate dynamic names
only if there is no multiple SSPs or TDMs defined.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/topology.c