ASoC: qcom: misc fixes for LPASS driver
Subsystems (3)
cover ASoC: qcom: misc fixes for LPASS driver
From: wangdicheng <[email protected]>
A few small fixes for the Qualcomm LPASS ASoC driver:
- Fix "LPASS_CDC_DMA_VA_TX0 ... LPASS_CDC_DMA_VA_TX0" case ranges that only matched VA_TX0, so VA_TX1..VA_TX8 hit the default case. In lpass-cdc-dma.c the va_mem0 clock was also not prepared for those DAIs.
- Fix a misleading error message in lpass-hdmi.c that reported an invalid bit width when an unsupported sample rate was given.
- Fix stray double spaces and blank lines.
wangdicheng (3):
ASoC: qcom: fix assorted whitespace issues
ASoC: qcom: lpass-hdmi: fix invalid rate error message
ASoC: qcom: fix VA CDC DMA DAI range handling
sound/soc/qcom/common.c | 1 - sound/soc/qcom/lpass-cdc-dma.c | 10 +++++----- sound/soc/qcom/lpass-cpu.c | 2 +- sound/soc/qcom/lpass-hdmi.c | 5 ++--- sound/soc/qcom/lpass-platform.c | 6 +++--- sound/soc/qcom/sdw.c | 3 +-- 6 files changed, 12 insertions(+), 15 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/3 ASoC: qcom: fix assorted whitespace issues
From: wangdicheng <[email protected]>
Fix stray double spaces and blank lines across the qcom ASoC driver.
--- sound/soc/qcom/common.c | 1 - sound/soc/qcom/lpass-cdc-dma.c | 2 +- sound/soc/qcom/lpass-cpu.c | 2 +- sound/soc/qcom/lpass-hdmi.c | 1 - sound/soc/qcom/lpass-platform.c | 2 +- sound/soc/qcom/sdw.c | 3 +-- 6 files changed, 4 insertions(+), 7 deletions(-)
sound/soc/qcom/common.c +0 -1
@@ -389,7 +389,6 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,break ; } -return 0 ; }EXPORT_SYMBOL_GPL (qcom_snd_wcd_jack_setup);
sound/soc/qcom/lpass-cdc-dma.c +1 -1
@@ -111,7 +111,7 @@ static int __lpass_get_codec_dma_intf_type(int dai_id) ret =LPASS_CDC_DMA_INTERFACE9 ;break ;case LPASS_CDC_DMA_RX9 : - ret =LPASS_CDC_DMA_INTERFACE10 ; + ret =LPASS_CDC_DMA_INTERFACE10 ;break ;default : ret = -EINVAL ;
sound/soc/qcom/lpass-cpu.c +1 -1
@@ -468,7 +468,7 @@ static int asoc_qcom_of_xlate_dai_name(struct snd_soc_component *component,int ret = -EINVAL ;int i; -for (i =0 ; i < variant->num_dai; i++) { +for (i =0 ; i < variant->num_dai; i++) {if (variant->dai_driver[i].id == id) { *dai_name = variant->dai_driver[i].name; ret =0 ;
sound/soc/qcom/lpass-hdmi.c +0 -1
@@ -5,7 +5,6 @@* lpass-hdmi.c -- ALSA SoC HDMI-CPU DAI driver for QTi LPASS HDMI */ -#include <linux/kernel.h> #include <linux/module.h> #include <sound/pcm_params.h>
sound/soc/qcom/lpass-platform.c +1 -1
@@ -19,7 +19,7 @@#define DRV_NAME "lpass-platform" -#define LPASS_PLATFORM_BUFFER_SIZE (24 * 2 * 1024) +#define LPASS_PLATFORM_BUFFER_SIZE (24 * 2 * 1024)#define LPASS_PLATFORM_PERIODS 2#define LPASS_RXTX_CDC_DMA_LPM_BUFF_SIZE (8 * 1024)#define LPASS_VA_CDC_DMA_LPM_BUFF_SIZE (12 * 1024)
sound/soc/qcom/sdw.c +1 -2
@@ -131,7 +131,6 @@ int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,struct sdw_stream_runtime *sruntime;int ret; -if (!qcom_snd_is_sdw_dai (cpu_dai->id))return 0 ;
@@ -159,7 +158,7 @@ int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,sdw_deprepare_stream (sruntime);return ret; } - *stream_prepared = true; + *stream_prepared = true;return ret; }
Signature · 1 line
2.25.1
PATCH 2/3 ASoC: qcom: lpass-hdmi: fix invalid rate error message
In reply to [email protected]From: wangdicheng <[email protected]>
The sampling rate switch reused the bitwidth error path, so an unsupported rate logged "invalid bit width" with the bitwidth value. Print the rate instead.
--- sound/soc/qcom/lpass-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/qcom/lpass-hdmi.c +2 -2
@@ -64,8 +64,8 @@ static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substream, sampling_freq =LPASS_SAMPLING_FREQ48 ;break ;default : -dev_err (dai->dev,"%s invalid bit width given : %d\n" , - __func__, bitwidth); +dev_err (dai->dev,"%s invalid sampling rate given : %d\n" , + __func__, rate);return -EINVAL ; } data_format =LPASS_DATA_FORMAT_LINEAR ;
Signature · 1 line
2.25.1
Mark Brown
maintainerRe: [PATCH 2/3] ASoC: qcom: lpass-hdmi: fix invalid rate error message
sound/soc/qcom/lpass-hdmi.c static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substream, · line 67
Quoted 10 lines · On Wed, Sep 02, 2026 at 03:19:42PM +0800, [email protected] wrote:
From: wangdicheng <[email protected]>
The sampling rate switch reused the bitwidth error path, so an unsupported rate logged "invalid bit width" with the bitwidth value. Print the rate instead.
sound/soc/qcom/lpass-hdmi.c +1
-2default : -dev_err (dai->dev,"%s invalid bit width given : %d\n" , - __func__, bitwidth); + dev_err(dai->dev, "%s invalid sampling rate given : %d\n",
rate is unsigned; I am surprised you don't get compiler warnings about that.
PATCH 3/3 ASoC: qcom: fix VA CDC DMA DAI range handling
In reply to [email protected]From: wangdicheng <[email protected]>
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.
--- sound/soc/qcom/lpass-cdc-dma.c | 8 ++++---- sound/soc/qcom/lpass-platform.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
sound/soc/qcom/lpass-cdc-dma.c +4 -4
@@ -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 ; } }
sound/soc/qcom/lpass-platform.c +2 -2
@@ -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) {
Signature · 1 line
2.25.1