Skip to content

Commit

Permalink
ASoC: codecs: tx-macro: split widgets per different LPASS versions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Feb 26, 2024
1 parent 0c4ebb2 commit 051e887
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 151 deletions.
6 changes: 6 additions & 0 deletions sound/soc/codecs/lpass-macro-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
/* The soundwire block should be internally reset at probe */
#define LPASS_MACRO_FLAG_RESET_SWR BIT(1)

enum lpass_version {
LPASS_VER_9_0_0,
LPASS_VER_10_0_0,
LPASS_VER_11_0_0,
};

struct lpass_macro {
struct device *macro_pd;
struct device *dcodec_pd;
Expand Down
Loading

0 comments on commit 051e887

Please sign in to comment.