diff mbox series

[2/2] ASoC: sdm845: Add support for Secondary MI2S interface

Message ID 1542354118-23360-3-git-send-email-rohitkr@codeaurora.org (mailing list archive)
State Accepted
Commit 992e75b3c80952fc60946458c75e1bf609e86aa2
Headers show
Series ASoC: SDM845: Update MI2S and TDM configuration | expand

Commit Message

Rohit Kumar Nov. 16, 2018, 7:41 a.m. UTC
Add support to configure bit clock for secondary MI2S
TX interface.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
---
 sound/soc/qcom/sdm845.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Srinivas Kandagatla Nov. 21, 2018, 9:22 a.m. UTC | #1
On 16/11/18 07:41, Rohit kumar wrote:
> Add support to configure bit clock for secondary MI2S
> TX interface.
> 
> Signed-off-by: Rohit kumar<rohitkr@codeaurora.org>
> ---
>   sound/soc/qcom/sdm845.c | 18 ++++++++++++++++++

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
diff mbox series

Patch

diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c
index 84e6ee7..58593db 100644
--- a/sound/soc/qcom/sdm845.c
+++ b/sound/soc/qcom/sdm845.c
@@ -19,6 +19,7 @@ 
 struct sdm845_snd_data {
 	struct snd_soc_card *card;
 	uint32_t pri_mi2s_clk_count;
+	uint32_t sec_mi2s_clk_count;
 	uint32_t quat_tdm_clk_count;
 };
 
@@ -121,6 +122,15 @@  static int sdm845_snd_startup(struct snd_pcm_substream *substream)
 		snd_soc_dai_set_fmt(cpu_dai, fmt);
 		break;
 
+	case SECONDARY_MI2S_TX:
+		if (++(data->sec_mi2s_clk_count) == 1) {
+			snd_soc_dai_set_sysclk(cpu_dai,
+				Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT,
+				MI2S_BCLK_RATE,	SNDRV_PCM_STREAM_CAPTURE);
+		}
+		snd_soc_dai_set_fmt(cpu_dai, fmt);
+		break;
+
 	case QUATERNARY_TDM_RX_0:
 	case QUATERNARY_TDM_TX_0:
 		if (++(data->quat_tdm_clk_count) == 1) {
@@ -157,6 +167,14 @@  static void  sdm845_snd_shutdown(struct snd_pcm_substream *substream)
 		};
 		break;
 
+	case SECONDARY_MI2S_TX:
+		if (--(data->sec_mi2s_clk_count) == 0) {
+			snd_soc_dai_set_sysclk(cpu_dai,
+				Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT,
+				0, SNDRV_PCM_STREAM_CAPTURE);
+		}
+		break;
+
 	case QUATERNARY_TDM_RX_0:
 	case QUATERNARY_TDM_TX_0:
 		if (--(data->quat_tdm_clk_count) == 0) {