Linux Sound subsystem development
 help / color / mirror / Atom feed
* [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface
@ 2025-09-11  6:36 Mohammad Rafi Shaik
  2025-09-11  6:36 ` [RESEND PATCH v4 1/3] ASoC: qcom: audioreach: Fix lpaif_type configuration for the " Mohammad Rafi Shaik
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Mohammad Rafi Shaik @ 2025-09-11  6:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Pierre-Louis Bossart
  Cc: linux-sound, linux-arm-msm, linux-kernel, kernel, prasad.kumpatla,
	ajay.nandam

Fix the lpaif_type configuration for the I2S interface.
The proper lpaif interface type required to allow DSP to vote
appropriate clock setting for I2S interface and also Add support
for configuring the DAI format on MI2S interfaces to allow setting
the appropriate bit clock and frame clock polarity, ensuring correct
audio data transmissionover MI2S.

changes in [v4]:
	- Updated commit message in patch v4-0003, suggested by Srinivas Kandagatla.
	- Link to V3: https://lore.kernel.org/linux-sound/20250905150445.2596140-1-mohammad.rafi.shaik@oss.qualcomm.com/

changes in [v3]:
	- Added Cc: <stable@vger.kernel.org>, suggested by Srinivas Kandagatla.
	- Added QUINARY MI2S case in patch 3, suggested by Konrad.
	- Link to V2: https://lore.kernel.org/lkml/20250905104020.2463473-1-mohammad.rafi.shaik@oss.qualcomm.com/

changes in [v2]:
	- Used snd_soc_dai_set_fmt() API to set the current clock settings,
	  instead of the default WS source setting, as suggested by Srinivas Kandagatla.
	- Link to V1: https://lore.kernel.org/lkml/20250822171440.2040324-1-mohammad.rafi.shaik@oss.qualcomm.com/

Mohammad Rafi Shaik (3):
  ASoC: qcom: audioreach: Fix lpaif_type configuration for the I2S
    interface
  ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S
  ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S
    interfaces

 sound/soc/qcom/qdsp6/audioreach.c       | 1 +
 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 1 +
 sound/soc/qcom/sc8280xp.c               | 4 ++++
 3 files changed, 6 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RESEND PATCH v4 1/3] ASoC: qcom: audioreach: Fix lpaif_type configuration for the I2S interface
  2025-09-11  6:36 [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mohammad Rafi Shaik
@ 2025-09-11  6:36 ` Mohammad Rafi Shaik
  2025-09-11  6:36 ` [RESEND PATCH v4 2/3] ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S Mohammad Rafi Shaik
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Mohammad Rafi Shaik @ 2025-09-11  6:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Pierre-Louis Bossart
  Cc: linux-sound, linux-arm-msm, linux-kernel, kernel, prasad.kumpatla,
	ajay.nandam, stable, Srinivas Kandagatla

Fix missing lpaif_type configuration for the I2S interface.
The proper lpaif interface type required to allow DSP to vote
appropriate clock setting for I2S interface.

Fixes: 25ab80db6b133 ("ASoC: qdsp6: audioreach: add module configuration command helpers")
Cc: stable@vger.kernel.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
 sound/soc/qcom/qdsp6/audioreach.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
index bbfd51db8797..be21d5f6af8a 100644
--- a/sound/soc/qcom/qdsp6/audioreach.c
+++ b/sound/soc/qcom/qdsp6/audioreach.c
@@ -995,6 +995,7 @@ static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
 	param_data->param_id = PARAM_ID_I2S_INTF_CFG;
 	param_data->param_size = ic_sz - APM_MODULE_PARAM_DATA_SIZE;
 
+	intf_cfg->cfg.lpaif_type = module->hw_interface_type;
 	intf_cfg->cfg.intf_idx = module->hw_interface_idx;
 	intf_cfg->cfg.sd_line_idx = module->sd_line_idx;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RESEND PATCH v4 2/3] ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S
  2025-09-11  6:36 [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mohammad Rafi Shaik
  2025-09-11  6:36 ` [RESEND PATCH v4 1/3] ASoC: qcom: audioreach: Fix lpaif_type configuration for the " Mohammad Rafi Shaik
@ 2025-09-11  6:36 ` Mohammad Rafi Shaik
  2025-09-11  6:36 ` [RESEND PATCH v4 3/3] ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces Mohammad Rafi Shaik
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Mohammad Rafi Shaik @ 2025-09-11  6:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Pierre-Louis Bossart
  Cc: linux-sound, linux-arm-msm, linux-kernel, kernel, prasad.kumpatla,
	ajay.nandam, stable, Srinivas Kandagatla

The q6i2s_set_fmt() function was defined but never linked into the
I2S DAI operations, resulting DAI format settings is being ignored
during stream setup. This change fixes the issue by properly linking
the .set_fmt handler within the DAI ops.

Fixes: 30ad723b93ade ("ASoC: qdsp6: audioreach: add q6apm lpass dai support")
Cc: stable@vger.kernel.org
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
index 20974f10406b..528756f1332b 100644
--- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
+++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
@@ -262,6 +262,7 @@ static const struct snd_soc_dai_ops q6i2s_ops = {
 	.shutdown	= q6apm_lpass_dai_shutdown,
 	.set_channel_map  = q6dma_set_channel_map,
 	.hw_params        = q6dma_hw_params,
+	.set_fmt	= q6i2s_set_fmt,
 };
 
 static const struct snd_soc_dai_ops q6hdmi_ops = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RESEND PATCH v4 3/3] ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces
  2025-09-11  6:36 [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mohammad Rafi Shaik
  2025-09-11  6:36 ` [RESEND PATCH v4 1/3] ASoC: qcom: audioreach: Fix lpaif_type configuration for the " Mohammad Rafi Shaik
  2025-09-11  6:36 ` [RESEND PATCH v4 2/3] ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S Mohammad Rafi Shaik
@ 2025-09-11  6:36 ` Mohammad Rafi Shaik
  2025-09-16  4:12   ` Alexey Klimov
  2025-09-11 11:18 ` [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mark Brown
  2025-09-19  9:51 ` Neil Armstrong
  4 siblings, 1 reply; 7+ messages in thread
From: Mohammad Rafi Shaik @ 2025-09-11  6:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Pierre-Louis Bossart
  Cc: linux-sound, linux-arm-msm, linux-kernel, kernel, prasad.kumpatla,
	ajay.nandam, Srinivas Kandagatla

Add support for configuring the DAI format on MI2S interfaces,
this enhancement allows setting the appropriate bit clock and
frame clock polarity, ensuring correct audio data transmission
over MI2S.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
 sound/soc/qcom/sc8280xp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index 73f9f82c4e25..3067b95bcdbb 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -32,6 +32,10 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
 	int dp_pcm_id = 0;
 
 	switch (cpu_dai->id) {
+	case PRIMARY_MI2S_RX...QUATERNARY_MI2S_TX:
+	case QUINARY_MI2S_RX...QUINARY_MI2S_TX:
+		snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
+		break;
 	case WSA_CODEC_DMA_RX_0:
 	case WSA_CODEC_DMA_RX_1:
 		/*
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface
  2025-09-11  6:36 [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mohammad Rafi Shaik
                   ` (2 preceding siblings ...)
  2025-09-11  6:36 ` [RESEND PATCH v4 3/3] ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces Mohammad Rafi Shaik
@ 2025-09-11 11:18 ` Mark Brown
  2025-09-19  9:51 ` Neil Armstrong
  4 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2025-09-11 11:18 UTC (permalink / raw)
  To: Mohammad Rafi Shaik
  Cc: Srinivas Kandagatla, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Pierre-Louis Bossart, linux-sound, linux-arm-msm, linux-kernel,
	kernel, prasad.kumpatla, ajay.nandam

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

On Thu, Sep 11, 2025 at 12:06:09PM +0530, Mohammad Rafi Shaik wrote:
> Fix the lpaif_type configuration for the I2S interface.
> The proper lpaif interface type required to allow DSP to vote
> appropriate clock setting for I2S interface and also Add support
> for configuring the DAI format on MI2S interfaces to allow setting
> the appropriate bit clock and frame clock polarity, ensuring correct
> audio data transmissionover MI2S.

You previously sent this on *Monday* - please allow reasonable time for
review.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH v4 3/3] ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces
  2025-09-11  6:36 ` [RESEND PATCH v4 3/3] ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces Mohammad Rafi Shaik
@ 2025-09-16  4:12   ` Alexey Klimov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Klimov @ 2025-09-16  4:12 UTC (permalink / raw)
  To: Mohammad Rafi Shaik, Srinivas Kandagatla
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Pierre-Louis Bossart, linux-sound, linux-arm-msm, linux-kernel,
	kernel, prasad.kumpatla, ajay.nandam, Srinivas Kandagatla

On Thu Sep 11, 2025 at 7:36 AM BST, Mohammad Rafi Shaik wrote:
> Add support for configuring the DAI format on MI2S interfaces,
> this enhancement allows setting the appropriate bit clock and
> frame clock polarity, ensuring correct audio data transmission
> over MI2S.
>
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
>  sound/soc/qcom/sc8280xp.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> index 73f9f82c4e25..3067b95bcdbb 100644
> --- a/sound/soc/qcom/sc8280xp.c
> +++ b/sound/soc/qcom/sc8280xp.c
> @@ -32,6 +32,10 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
>  	int dp_pcm_id = 0;
>  
>  	switch (cpu_dai->id) {
> +	case PRIMARY_MI2S_RX...QUATERNARY_MI2S_TX:
> +	case QUINARY_MI2S_RX...QUINARY_MI2S_TX:
> +		snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
> +		break;
>  	case WSA_CODEC_DMA_RX_0:
>  	case WSA_CODEC_DMA_RX_1:
>  		/*

Out of curosity (I am not trying to block this patch), is there a difference
doing this on ->init() rather than on startup?
For instance, in sm8250 and in sdm845 sndcards this is done in ->startup
method. I suspect that answer might be that both locations are fine and
sc8280xp sndcard directly calls qcom_snd_sdw_startup() on startup.

Thanks,
Alexey


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface
  2025-09-11  6:36 [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mohammad Rafi Shaik
                   ` (3 preceding siblings ...)
  2025-09-11 11:18 ` [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mark Brown
@ 2025-09-19  9:51 ` Neil Armstrong
  4 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2025-09-19  9:51 UTC (permalink / raw)
  To: Mohammad Rafi Shaik, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Pierre-Louis Bossart
  Cc: linux-sound, linux-arm-msm, linux-kernel, kernel, prasad.kumpatla,
	ajay.nandam

On 11/09/2025 08:36, Mohammad Rafi Shaik wrote:
> Fix the lpaif_type configuration for the I2S interface.
> The proper lpaif interface type required to allow DSP to vote
> appropriate clock setting for I2S interface and also Add support
> for configuring the DAI format on MI2S interfaces to allow setting
> the appropriate bit clock and frame clock polarity, ensuring correct
> audio data transmissionover MI2S.
> 
> changes in [v4]:
> 	- Updated commit message in patch v4-0003, suggested by Srinivas Kandagatla.
> 	- Link to V3: https://lore.kernel.org/linux-sound/20250905150445.2596140-1-mohammad.rafi.shaik@oss.qualcomm.com/
> 
> changes in [v3]:
> 	- Added Cc: <stable@vger.kernel.org>, suggested by Srinivas Kandagatla.
> 	- Added QUINARY MI2S case in patch 3, suggested by Konrad.
> 	- Link to V2: https://lore.kernel.org/lkml/20250905104020.2463473-1-mohammad.rafi.shaik@oss.qualcomm.com/
> 
> changes in [v2]:
> 	- Used snd_soc_dai_set_fmt() API to set the current clock settings,
> 	  instead of the default WS source setting, as suggested by Srinivas Kandagatla.
> 	- Link to V1: https://lore.kernel.org/lkml/20250822171440.2040324-1-mohammad.rafi.shaik@oss.qualcomm.com/
> 
> Mohammad Rafi Shaik (3):
>    ASoC: qcom: audioreach: Fix lpaif_type configuration for the I2S
>      interface
>    ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S
>    ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S
>      interfaces
> 
>   sound/soc/qcom/qdsp6/audioreach.c       | 1 +
>   sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 1 +
>   sound/soc/qcom/sc8280xp.c               | 4 ++++
>   3 files changed, 6 insertions(+)
> 

Fixes a long-term issue I had with I2S with audioreach platforms, thanks!

Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK

Neil

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-19  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-11  6:36 [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mohammad Rafi Shaik
2025-09-11  6:36 ` [RESEND PATCH v4 1/3] ASoC: qcom: audioreach: Fix lpaif_type configuration for the " Mohammad Rafi Shaik
2025-09-11  6:36 ` [RESEND PATCH v4 2/3] ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S Mohammad Rafi Shaik
2025-09-11  6:36 ` [RESEND PATCH v4 3/3] ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces Mohammad Rafi Shaik
2025-09-16  4:12   ` Alexey Klimov
2025-09-11 11:18 ` [RESEND PATCH v4 0/3] Fix lpaif_type and DAI configuration for I2S interface Mark Brown
2025-09-19  9:51 ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox