The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jianhua Lu <lujianhua000@gmail.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jianhua Lu <lujianhua000@gmail.com>
Subject: [PATCH v3 3/4] Asoc: qcom: sdw: Add TDM support
Date: Wed, 13 Dec 2023 20:35:55 +0800	[thread overview]
Message-ID: <20231213123556.20469-3-lujianhua000@gmail.com> (raw)
In-Reply-To: <20231213123556.20469-1-lujianhua000@gmail.com>

Setup TDM ports when dai id is matched to *_TDM_*.

Signed-off-by: Jianhua Lu <lujianhua000@gmail.com>
---
Changes in v3:
  1. split qcom_snd_tdm_hw_params function to common.c

Changes in v2:
  1. remove EXPORT_SYMBOL_GPL
  2. remove static modifier

 sound/soc/qcom/sdw.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sound/soc/qcom/sdw.c b/sound/soc/qcom/sdw.c
index 77dbe0c28b29..c07d878a1c18 100644
--- a/sound/soc/qcom/sdw.c
+++ b/sound/soc/qcom/sdw.c
@@ -5,6 +5,7 @@
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <linux/module.h>
 #include <sound/soc.h>
+#include "common.h"
 #include "sdw.h"
 
 /**
@@ -109,7 +110,7 @@ int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai;
 	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
 	struct sdw_stream_runtime *sruntime;
-	int i;
+	int ret, i;
 
 	switch (cpu_dai->id) {
 	case WSA_CODEC_DMA_RX_0:
@@ -125,6 +126,14 @@ int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream,
 				*psruntime = sruntime;
 		}
 		break;
+	case PRIMARY_TDM_RX_0...QUINARY_TDM_TX_7:
+		ret = qcom_snd_tdm_hw_params(substream, params);
+		if (ret < 0) {
+			dev_err(rtd->dev, "%s: failed to setup TDM err:%d\n",
+				__func__, ret);
+			return ret;
+		}
+		break;
 	}
 
 	return 0;
-- 
2.41.0


  parent reply	other threads:[~2023-12-13 12:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 12:35 [PATCH v3 1/4] ASoC: qcom: common: Add qcom_snd_tdm_hw_params function Jianhua Lu
2023-12-13 12:35 ` [PATCH v3 2/4] ASoC: qcom: sdm845: switch to qcom_snd_tdm_hw_params helper Jianhua Lu
2023-12-13 12:35 ` Jianhua Lu [this message]
2023-12-13 12:35 ` [PATCH v3 4/4] ASoC: qcom: sm8250: Add TERTIARY_TDM_RX_0 support Jianhua Lu
2023-12-14 11:11 ` [PATCH v3 1/4] ASoC: qcom: common: Add qcom_snd_tdm_hw_params function Mark Brown
2023-12-14 15:51   ` Jianhua Lu
2023-12-14 15:56     ` Mark Brown
2023-12-14 16:55       ` Jianhua Lu
2023-12-14 17:04         ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231213123556.20469-3-lujianhua000@gmail.com \
    --to=lujianhua000@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox