summaryrefslogtreecommitdiff
path: root/sound/soc/rockchip
diff options
context:
space:
mode:
authorSugar Zhang <sugar.zhang@rock-chips.com>2019-04-04 11:56:29 +0800
committerMark Brown <broonie@kernel.org>2019-04-04 15:10:38 +0700
commit430f5da69b9323d5e7faca95bc30e61be4fcbbbf (patch)
tree97bf901946aa9f5700a80ee9af2177d0317ceae5 /sound/soc/rockchip
parent2a050b7a746e2c59a733a3641eb1c01cf2e573b4 (diff)
downloadlwn-430f5da69b9323d5e7faca95bc30e61be4fcbbbf.tar.gz
lwn-430f5da69b9323d5e7faca95bc30e61be4fcbbbf.zip
ASoC: rockchip: pdm: adjust waterlevel in frame unit
This patch make the waterlevel more reasonable, because the pdm controller share the single FIFO(128 entries) with each channel. adjust waterlevel in frame to meet the vad or dma frames request. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/rockchip')
-rw-r--r--sound/soc/rockchip/rockchip_pdm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
index 3e1c5fd5b32b..955cdc2b8fc5 100644
--- a/sound/soc/rockchip/rockchip_pdm.c
+++ b/sound/soc/rockchip/rockchip_pdm.c
@@ -255,8 +255,9 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream,
regmap_update_bits(pdm->regmap, PDM_CTRL0,
PDM_PATH_MSK | PDM_VDW_MSK,
val);
+ /* all channels share the single FIFO */
regmap_update_bits(pdm->regmap, PDM_DMA_CTRL, PDM_DMA_RDL_MSK,
- PDM_DMA_RDL(16));
+ PDM_DMA_RDL(8 * params_channels(params)));
return 0;
}