Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: lpass: Drop unused AIF_INVALID first DAI identifier

All four Qualcomm SoC macro codecs define DAI IDs in an enum starting
with AIF_INVALID=0, which is nowhere used in the code thus actual DAI
IDs start from 1. Drivers do not have their own of_xlate_dai_name(),
thus snd_soc_get_dlc() expects the DTS to start numbering DAIs from 0,
which creates confusing debugging scenario, e.g. DTS should use
<&lpass_wsamacro 2> for WSA_MACRO_AIF_VI with dai->id=3.

This also wastes some space, because drivers allocate few arrays for all
DAIs and basically the [0] is never used.

Drop the confusing first AIF_INVALID DAI identifier so the enum with DAI
IDs will start from 0. This has little functional impact and does not
affect the ABI, except saving a few bytes of memory per driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250523121811.380045-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
bb4a0f49 19272b37

-4
-1
sound/soc/codecs/lpass-rx-macro.c
··· 619 619 }; 620 620 621 621 enum { 622 - RX_MACRO_AIF_INVALID = 0, 623 622 RX_MACRO_AIF1_PB, 624 623 RX_MACRO_AIF2_PB, 625 624 RX_MACRO_AIF3_PB,
-1
sound/soc/codecs/lpass-tx-macro.c
··· 208 208 #define MCLK_FREQ 19200000 209 209 210 210 enum { 211 - TX_MACRO_AIF_INVALID = 0, 212 211 TX_MACRO_AIF1_CAP, 213 212 TX_MACRO_AIF2_CAP, 214 213 TX_MACRO_AIF3_CAP,
-1
sound/soc/codecs/lpass-va-macro.c
··· 165 165 static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400); 166 166 167 167 enum { 168 - VA_MACRO_AIF_INVALID = 0, 169 168 VA_MACRO_AIF1_CAP, 170 169 VA_MACRO_AIF2_CAP, 171 170 VA_MACRO_AIF3_CAP,
-1
sound/soc/codecs/lpass-wsa-macro.c
··· 369 369 }; 370 370 371 371 enum { 372 - WSA_MACRO_AIF_INVALID = 0, 373 372 WSA_MACRO_AIF1_PB, 374 373 WSA_MACRO_AIF_MIX1_PB, 375 374 WSA_MACRO_AIF_VI,