diff mbox series

[SRU,OEM-5.6/unstable,16/18] ASoC: amd: refactoring dai_hw_params() callback

Message ID 20200528021121.28987-36-hui.wang@canonical.com
State New
Headers show
Series None | expand

Commit Message

Hui Wang May 28, 2020, 2:11 a.m. UTC
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>

BugLink: https://bugs.launchpad.net/bugs/1881046

Removed api config_pdm_stream_params().
Modified switch case for channel check.
Default case should return -EINVAL.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20200519143422.18255-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 19cc20bd644f7baf279671c0647ef79c36f259a3
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/soc/amd/renoir/acp3x-pdm-dma.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
index b33c7aec7481..623dfd3ea705 100644
--- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
+++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
@@ -72,14 +72,6 @@  static void init_pdm_ring_buffer(u32 physical_addr,
 	rn_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL);
 }
 
-static void config_pdm_stream_params(unsigned int ch_mask,
-				     void __iomem *acp_base)
-{
-	rn_writel(ch_mask, acp_base + ACP_WOV_PDM_NO_OF_CHANNELS);
-	rn_writel(PDM_DECIMATION_FACTOR, acp_base +
-		  ACP_WOV_PDM_DECIMATION_FACTOR);
-}
-
 static void enable_pdm_clock(void __iomem *acp_base)
 {
 	u32 pdm_clk_enable, pdm_ctrl;
@@ -332,11 +324,14 @@  static int acp_pdm_dai_hw_params(struct snd_pcm_substream *substream,
 	rtd = substream->runtime->private_data;
 	switch (params_channels(params)) {
 	case TWO_CH:
-	default:
 		ch_mask = 0x00;
 		break;
+	default:
+		return -EINVAL;
 	}
-	config_pdm_stream_params(ch_mask, rtd->acp_base);
+	rn_writel(ch_mask, rtd->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS);
+	rn_writel(PDM_DECIMATION_FACTOR, rtd->acp_base +
+		  ACP_WOV_PDM_DECIMATION_FACTOR);
 	return 0;
 }