ASoC: rockchip: pdm: adjust waterlevel in frame unit
authorSugar Zhang <sugar.zhang@rock-chips.com>
Thu, 4 Apr 2019 03:56:29 +0000 (11:56 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 4 Apr 2019 08:10:38 +0000 (15:10 +0700)
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>
sound/soc/rockchip/rockchip_pdm.c

index 3e1c5fd5b32b02c2ce27d5a610f743e1520b0ec3..955cdc2b8fc5d26ef3491c87619cba91e1de220c 100644 (file)
@@ -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;
 }