linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: qcom: SC7280: Update machine driver startup, shutdown callbacks
@ 2022-04-19  7:16 Srinivasa Rao Mandadapu
  2022-04-19  9:19 ` Srinivas Kandagatla
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivasa Rao Mandadapu @ 2022-04-19  7:16 UTC (permalink / raw)
  To: agross, bjorn.andersson, lgirdwood, broonie, robh+dt, quic_plai,
	bgoswami, perex, tiwai, srinivas.kandagatla, quic_rohkumar,
	linux-arm-msm, alsa-devel, devicetree, linux-kernel, swboyd,
	judyhsiao
  Cc: Srinivasa Rao Mandadapu, Venkata Prasad Potturu

Update machine driver startup, shutdown callback functions to support
codec DMA paths. Without this change, platforms with WCD codec is failing
to register sound card.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
---
 sound/soc/qcom/sc7280.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/qcom/sc7280.c b/sound/soc/qcom/sc7280.c
index 4ef4034..d64df11 100644
--- a/sound/soc/qcom/sc7280.c
+++ b/sound/soc/qcom/sc7280.c
@@ -295,6 +295,10 @@ static void sc7280_snd_shutdown(struct snd_pcm_substream *substream)
 		break;
 	case LPASS_DP_RX:
 		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_TX8:
+		break;
 	default:
 		dev_err(rtd->dev, "%s: invalid dai id 0x%x\n", __func__,
 			cpu_dai->id);
@@ -316,6 +320,10 @@ static int sc7280_snd_startup(struct snd_pcm_substream *substream)
 		break;
 	case LPASS_DP_RX:
 		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_TX8:
+		break;
 	default:
 		dev_err(rtd->dev, "%s: invalid dai id 0x%x\n", __func__,
 			cpu_dai->id);
-- 
2.7.4


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

* Re: [PATCH] ASoC: qcom: SC7280: Update machine driver startup, shutdown callbacks
  2022-04-19  7:16 [PATCH] ASoC: qcom: SC7280: Update machine driver startup, shutdown callbacks Srinivasa Rao Mandadapu
@ 2022-04-19  9:19 ` Srinivas Kandagatla
  2022-04-19  9:39   ` Srinivasa Rao Mandadapu
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Kandagatla @ 2022-04-19  9:19 UTC (permalink / raw)
  To: Srinivasa Rao Mandadapu, agross, bjorn.andersson, lgirdwood,
	broonie, robh+dt, quic_plai, bgoswami, perex, tiwai,
	quic_rohkumar, linux-arm-msm, alsa-devel, devicetree,
	linux-kernel, swboyd, judyhsiao
  Cc: Venkata Prasad Potturu



On 19/04/2022 08:16, Srinivasa Rao Mandadapu wrote:
> Update machine driver startup, shutdown callback functions to support
> codec DMA paths. Without this change, platforms with WCD codec is failing
> to register sound card.
> 
> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
> Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
> Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
> ---
>   sound/soc/qcom/sc7280.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/sound/soc/qcom/sc7280.c b/sound/soc/qcom/sc7280.c
> index 4ef4034..d64df11 100644
> --- a/sound/soc/qcom/sc7280.c
> +++ b/sound/soc/qcom/sc7280.c
> @@ -295,6 +295,10 @@ static void sc7280_snd_shutdown(struct snd_pcm_substream *substream)
>   		break;
>   	case LPASS_DP_RX:
>   		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_TX8:
> +		break;
>   	default:
>   		dev_err(rtd->dev, "%s: invalid dai id 0x%x\n", __func__,
>   			cpu_dai->id);

Why not just make sc7280_snd_startup code like this:

static int sc7280_snd_startup(struct snd_pcm_substream *substream)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
	int ret = 0;

	switch (cpu_dai->id) {
	case MI2S_PRIMARY:
		ret = sc7280_rt5682_init(rtd);
		break;
	default:
		break;
	}
	return ret;
}

and sc7280_snd_shutdown with something similar

--srini
> @@ -316,6 +320,10 @@ static int sc7280_snd_startup(struct snd_pcm_substream *substream)
>   		break;
>   	case LPASS_DP_RX:
>   		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_TX8:
> +		break;
>   	default:
>   		dev_err(rtd->dev, "%s: invalid dai id 0x%x\n", __func__,
>   			cpu_dai->id);

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

* Re: [PATCH] ASoC: qcom: SC7280: Update machine driver startup, shutdown callbacks
  2022-04-19  9:19 ` Srinivas Kandagatla
@ 2022-04-19  9:39   ` Srinivasa Rao Mandadapu
  0 siblings, 0 replies; 3+ messages in thread
From: Srinivasa Rao Mandadapu @ 2022-04-19  9:39 UTC (permalink / raw)
  To: Srinivas Kandagatla, agross, bjorn.andersson, lgirdwood, broonie,
	robh+dt, quic_plai, bgoswami, perex, tiwai, quic_rohkumar,
	linux-arm-msm, alsa-devel, devicetree, linux-kernel, swboyd,
	judyhsiao
  Cc: Venkata Prasad Potturu


On 4/19/2022 2:49 PM, Srinivas Kandagatla wrote:
Thanks for your time Srini!!
>
>
> On 19/04/2022 08:16, Srinivasa Rao Mandadapu wrote:
>> Update machine driver startup, shutdown callback functions to support
>> codec DMA paths. Without this change, platforms with WCD codec is 
>> failing
>> to register sound card.
>>
>> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
>> Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
>> Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
>> ---
>>   sound/soc/qcom/sc7280.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/sound/soc/qcom/sc7280.c b/sound/soc/qcom/sc7280.c
>> index 4ef4034..d64df11 100644
>> --- a/sound/soc/qcom/sc7280.c
>> +++ b/sound/soc/qcom/sc7280.c
>> @@ -295,6 +295,10 @@ static void sc7280_snd_shutdown(struct 
>> snd_pcm_substream *substream)
>>           break;
>>       case LPASS_DP_RX:
>>           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_TX8:
>> +        break;
>>       default:
>>           dev_err(rtd->dev, "%s: invalid dai id 0x%x\n", __func__,
>>               cpu_dai->id);
>
> Why not just make sc7280_snd_startup code like this:
>
> static int sc7280_snd_startup(struct snd_pcm_substream *substream)
> {
>     struct snd_soc_pcm_runtime *rtd = substream->private_data;
>     struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
>     int ret = 0;
>
>     switch (cpu_dai->id) {
>     case MI2S_PRIMARY:
>         ret = sc7280_rt5682_init(rtd);
>         break;
>     default:
>         break;
>     }
>     return ret;
> }
>
> and sc7280_snd_shutdown with something similar

Yes. we can do as you suggested. Then Shall I do it as fix to a commit?

i.e. c5198db ASoC: qcom: Add driver support for ALC5682I-VS

>
> --srini
>> @@ -316,6 +320,10 @@ static int sc7280_snd_startup(struct 
>> snd_pcm_substream *substream)
>>           break;
>>       case LPASS_DP_RX:
>>           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_TX8:
>> +        break;
>>       default:
>>           dev_err(rtd->dev, "%s: invalid dai id 0x%x\n", __func__,
>>               cpu_dai->id);

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

end of thread, other threads:[~2022-04-19  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  7:16 [PATCH] ASoC: qcom: SC7280: Update machine driver startup, shutdown callbacks Srinivasa Rao Mandadapu
2022-04-19  9:19 ` Srinivas Kandagatla
2022-04-19  9:39   ` Srinivasa Rao Mandadapu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).