]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: lpass: Drop unused AIF_INVALID first DAI identifier
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 23 May 2025 12:18:12 +0000 (14:18 +0200)
committerMark Brown <broonie@kernel.org>
Sun, 8 Jun 2025 22:34:48 +0000 (23:34 +0100)
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>
sound/soc/codecs/lpass-rx-macro.c
sound/soc/codecs/lpass-tx-macro.c
sound/soc/codecs/lpass-va-macro.c
sound/soc/codecs/lpass-wsa-macro.c

index 45a6b83808b277344f17d35a70cd1e3bb89cbaea..238dbdb46c18d4d5325d284f64184ca6e701d6cd 100644 (file)
@@ -619,7 +619,6 @@ static struct interp_sample_rate sr_val_tbl[] = {
 };
 
 enum {
-       RX_MACRO_AIF_INVALID = 0,
        RX_MACRO_AIF1_PB,
        RX_MACRO_AIF2_PB,
        RX_MACRO_AIF3_PB,
index 27bae58f40725317682411f4cc97b8b456dd6676..40d79bee45844fb3692dcd770ea73d081e8fedd3 100644 (file)
 #define MCLK_FREQ              19200000
 
 enum {
-       TX_MACRO_AIF_INVALID = 0,
        TX_MACRO_AIF1_CAP,
        TX_MACRO_AIF2_CAP,
        TX_MACRO_AIF3_CAP,
index 74ada6e77526005d05e200d958f14f260d1c0e08..a49551f3fb29a61a6d3884d3845d6b8f4973bdbd 100644 (file)
 static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400);
 
 enum {
-       VA_MACRO_AIF_INVALID = 0,
        VA_MACRO_AIF1_CAP,
        VA_MACRO_AIF2_CAP,
        VA_MACRO_AIF3_CAP,
index c1fb71cfb5d0777ef90945a018451aae97f934f9..da6adb3de21d77c91c2bc227685d4322ae560353 100644 (file)
@@ -369,7 +369,6 @@ static struct interp_sample_rate int_mix_sample_rate_val[] = {
 };
 
 enum {
-       WSA_MACRO_AIF_INVALID = 0,
        WSA_MACRO_AIF1_PB,
        WSA_MACRO_AIF_MIX1_PB,
        WSA_MACRO_AIF_VI,