summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-pcm-dma-v2.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-06-12 16:27:14 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:51:24 +0800
commitd928e16f9d396f9323b4fa331162bc8754154fb4 (patch)
tree64d2b4226c179047ca16a053f10c90eeab511373 /sound/soc/fsl/imx-pcm-dma-v2.c
parent98ee74727894da0250d31c0f43038016aa1f24e8 (diff)
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 <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound/soc/fsl/imx-pcm-dma-v2.c')
-rw-r--r--sound/soc/fsl/imx-pcm-dma-v2.c13
1 files changed, 12 insertions, 1 deletions
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,