ASoC: codecs: tx-macro: split widgets per different LPASS versions
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 26 Feb 2024 11:59:24 +0000 (12:59 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 26 Feb 2024 13:46:13 +0000 (13:46 +0000)
commit051e887264b3e161cf2c1e163321b31191bf78a4
treedfb2893b99460983d2ac046ea2a312aaa20477d5
parent0c4ebb28b3db4f435ddb68e1f4185f8c86b149ef
ASoC: codecs: tx-macro: split widgets per different LPASS versions

TX macro codec differs slightly between different Qualcomm Low Power
Audio SubSystem (LPASS) block versions.  In LPASS version 9.2 the
register responsible for TX SMIC MUXn muxes is different, thus to
properly support it, the driver needs to register different widgets per
different LPASS version.

Prepare for supporting this register difference by refactoring existing
code:
1. Move few widgets (TX SMIC MUXn, TX SWR_ADCn, TX SWR_DMICn) out of
   common 'tx_macro_dapm_widgets[]' array to a new per-variant specific
   array 'tx_macro_dapm_widgets_v9[]'.
2. Move also related audio routes into new array.
3. Store pointers to these variant-specific arrays in new variant-data
   structure 'tx_macro_data'.
4. Add variant-specific widgets and routes in component probe, instead
   of driver probe.

The change should have no real impact, except re-shuffling code and
registering some widgets and audio routes in component probe, instead of
driver probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240226115925.53953-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/lpass-macro-common.h
sound/soc/codecs/lpass-tx-macro.c