All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <alsa-devel@alsa-project.org>, <broonie@kernel.org>, <tiwai@suse.de>
Cc: Alexander.Deucher@amd.com, Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Subject: [PATCH 2/3] ASoC: amd: refactoring dai_hw_params() callback
Date: Tue, 19 May 2020 22:34:21 +0800	[thread overview]
Message-ID: <20200519143422.18255-2-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20200519143422.18255-1-Vijendar.Mukunda@amd.com>

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>
---
 sound/soc/amd/renoir/acp3x-pdm-dma.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

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;
 }
 
-- 
2.26.2


  reply	other threads:[~2020-05-19 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 14:34 [PATCH 1/3] ASoC: amd: fix kernel warning Vijendar Mukunda
2020-05-19 14:34 ` Vijendar Mukunda [this message]
2020-05-19 14:34 ` [PATCH 3/3] ASoC: amd: return error when acp de-init fails Vijendar Mukunda
2020-05-19 18:50 ` [PATCH 1/3] ASoC: amd: fix kernel warning 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=20200519143422.18255-2-Vijendar.Mukunda@amd.com \
    --to=vijendar.mukunda@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.