From d928e16f9d396f9323b4fa331162bc8754154fb4 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 12 Jun 2017 16:27:14 +0800 Subject: MLK-15066-1: ASoC: imx-pcm-dma-v2: fix noise issue with pulseaudio Same as commit c55075170214 ("MLK-14582: ASoC: imx-pcm-rpmsg: fix audio noise issue with pulseaudio"), need to add a constraint for SNDRV_PCM_HW_PARAM_PERIODS, which make the period number integer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/imx-pcm-dma-v2.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sound/soc/fsl/imx-pcm-dma-v2.c') diff --git a/sound/soc/fsl/imx-pcm-dma-v2.c b/sound/soc/fsl/imx-pcm-dma-v2.c index 38ff1375ff3d..7d345dd92e3d 100644 --- a/sound/soc/fsl/imx-pcm-dma-v2.c +++ b/sound/soc/fsl/imx-pcm-dma-v2.c @@ -113,12 +113,23 @@ static int imx_pcm_open(struct snd_pcm_substream *substream) chan = dma_request_slave_channel(rtd->cpu_dai->dev, dma_data->filter_data); ret = snd_dmaengine_pcm_open(substream, chan); + if (ret) + return ret; } else { ret = snd_dmaengine_pcm_open_request_chan(substream, imx_dma_filter_fn, dma_data->filter_data); + if (ret) + return ret; } - return ret; + + ret = snd_pcm_hw_constraint_integer(substream->runtime, + SNDRV_PCM_HW_PARAM_PERIODS); + if (ret < 0) + return ret; + + + return 0; } static int imx_pcm_mmap(struct snd_pcm_substream *substream, -- cgit v1.2.3