Skip to content

Commit

Permalink
ASoC: rockchip: pdm: optimize clear logic
Browse files Browse the repository at this point in the history
There is no need to reset controller every time, do this
once in pdm_probe.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Sugar Zhang authored and Mark Brown committed Apr 4, 2019
1 parent a7980cd commit 252163a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/soc/rockchip/rockchip_pdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream,
val);
regmap_update_bits(pdm->regmap, PDM_DMA_CTRL, PDM_DMA_RDL_MSK,
PDM_DMA_RDL(16));
regmap_update_bits(pdm->regmap, PDM_SYSCONFIG,
PDM_RX_MASK | PDM_RX_CLR_MASK,
PDM_RX_STOP | PDM_RX_CLR_WR);
}

return 0;
Expand Down Expand Up @@ -353,6 +350,7 @@ static bool rockchip_pdm_volatile_reg(struct device *dev, unsigned int reg)
{
switch (reg) {
case PDM_SYSCONFIG:
case PDM_FIFO_CTRL:
case PDM_INT_CLR:
case PDM_INT_ST:
return true;
Expand Down Expand Up @@ -436,6 +434,7 @@ static int rockchip_pdm_probe(struct platform_device *pdev)
goto err_suspend;
}

rockchip_pdm_rxctrl(pdm, 0);
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
if (ret) {
dev_err(&pdev->dev, "could not register pcm: %d\n", ret);
Expand Down

0 comments on commit 252163a

Please sign in to comment.