[PATCH 3/3] ASoC: qcom: fix VA CDC DMA DAI range handling

From: wangdich9700

Date: Wed Sep 02 2026 - 03:25:50 EST


From: wangdicheng <wangdicheng@xxxxxxxxxx>

Several switch statements used "LPASS_CDC_DMA_VA_TX0 ...
LPASS_CDC_DMA_VA_TX0" which only matches VA_TX0, leaving VA_TX1
through VA_TX8 to hit the default case and print a spurious error.
In lpass-cdc-dma.c this also meant the va_mem0 clock was not
prepared for those DAIs. Use LPASS_CDC_DMA_VA_TX8 as the upper bound
to match the rest of the driver.

Signed-off-by: wangdicheng <wangdicheng@xxxxxxxxxx>
---
sound/soc/qcom/lpass-cdc-dma.c | 8 ++++----
sound/soc/qcom/lpass-platform.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index 5be13dd59517..dc645fcfd33b 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -180,12 +180,12 @@ static int lpass_cdc_dma_daiops_startup(struct snd_pcm_substream *substream,
clk_set_rate(drvdata->codec_mem0, CODEC_MEM_HZ_NORMAL);
clk_prepare_enable(drvdata->codec_mem0);
break;
- case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
+ case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
clk_set_rate(drvdata->va_mem0, CODEC_MEM_HZ_NORMAL);
clk_prepare_enable(drvdata->va_mem0);
break;
default:
- dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
+ dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
break;
}
return 0;
@@ -202,11 +202,11 @@ static void lpass_cdc_dma_daiops_shutdown(struct snd_pcm_substream *substream,
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
clk_disable_unprepare(drvdata->codec_mem0);
break;
- case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
+ case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
clk_disable_unprepare(drvdata->va_mem0);
break;
default:
- dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
+ dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai->id);
break;
}
}
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index b335b2c8bb16..2f65e6a589bc 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -490,10 +490,10 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
break;
case LPASS_CDC_DMA_RX0 ... LPASS_CDC_DMA_RX9:
case LPASS_CDC_DMA_TX0 ... LPASS_CDC_DMA_TX8:
- case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0:
+ case LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX8:
break;
default:
- dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai_id);
+ dev_err(soc_runtime->dev, "%s: invalid interface: %d\n", __func__, dai_id);
break;
}
switch (bitwidth) {
--
2.25.1