From: Sugar Zhang Date: Thu, 4 Apr 2019 03:56:29 +0000 (+0800) Subject: ASoC: rockchip: pdm: adjust waterlevel in frame unit X-Git-Tag: v5.2-rc1~16^2~9^2~193 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=430f5da69b9323d5e7faca95bc30e61be4fcbbbf;p=uclinux-h8%2Flinux.git 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 Signed-off-by: Mark Brown --- 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; }