Commit 19cc20bd authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Mark Brown

ASoC: amd: refactoring dai_hw_params() callback

Removed api config_pdm_stream_params().
Modified switch case for channel check.
Default case should return -EINVAL.
Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20200519143422.18255-2-Vijendar.Mukunda@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fdae433e
...@@ -72,14 +72,6 @@ static void init_pdm_ring_buffer(u32 physical_addr, ...@@ -72,14 +72,6 @@ static void init_pdm_ring_buffer(u32 physical_addr,
rn_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL); 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) static void enable_pdm_clock(void __iomem *acp_base)
{ {
u32 pdm_clk_enable, pdm_ctrl; u32 pdm_clk_enable, pdm_ctrl;
...@@ -332,11 +324,14 @@ static int acp_pdm_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -332,11 +324,14 @@ static int acp_pdm_dai_hw_params(struct snd_pcm_substream *substream,
rtd = substream->runtime->private_data; rtd = substream->runtime->private_data;
switch (params_channels(params)) { switch (params_channels(params)) {
case TWO_CH: case TWO_CH:
default:
ch_mask = 0x00; ch_mask = 0x00;
break; 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment