From 9ce9e58eb76239c09059764092f0e69d67ccf9b5 Mon Sep 17 00:00:00 2001 From: Gangadhar S Date: Tue, 15 Sep 2020 09:51:27 +0530 Subject: asoc: msm8998: Configure TDM for full slots - Dynamic configuration of TDM is not supported with fixed slot mask - changes to override slot mask when TDM configured to use all slots available. Change-Id: I36ddac1355b158be7a7a458b18522c13f31c46c3 Signed-off-by: Gangadhar S --- sound/soc/msm/msm8998.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/msm/msm8998.c b/sound/soc/msm/msm8998.c index c1b238e18f9e..8b3da6d7dd64 100644 --- a/sound/soc/msm/msm8998.c +++ b/sound/soc/msm/msm8998.c @@ -6260,6 +6260,15 @@ static int msm8998_tdm_snd_hw_params(struct snd_pcm_substream *substream, slot_width, slots, tdm_interface); pr_debug("%s: slot_mask :%x\n", __func__, slot_mask); + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + /* over write slot-mask if configured for full slots */ + if ((slots == 32) && (slot_width == 16)) + slot_mask = 0xffffffff; + else if ((slots == 16) && (slot_width == 32)) + slot_mask = 0xffff; + pr_debug("%s:slot_mask :%x slots %d slot_width %d\n", __func__, + slot_mask, slots, slot_width); + } if (!slot_mask) { pr_err("%s: invalid slot_mask 0x%x\n", __func__, slot_mask); -- cgit v1.2.3