aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/atom/sst-mfld-platform-pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-09-17 16:35:38 +0100
committerMark Brown <broonie@kernel.org>2020-09-17 16:35:38 +0100
commit4db68e62a0b912655c598de829b05b2383da0cab (patch)
tree14c717646e8de62283aaa9c08b747e8db3871dbd /sound/soc/intel/atom/sst-mfld-platform-pcm.c
parentMerge series "ASoC: SOF: DSP core management fixes for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>: (diff)
parentASoC: tlv320adcx140: Fix BCLK inversion for DSP modes (diff)
downloadlinux-dev-4db68e62a0b912655c598de829b05b2383da0cab.tar.xz
linux-dev-4db68e62a0b912655c598de829b05b2383da0cab.zip
Merge branch 'asoc-5.9' into asoc-5.10
Diffstat (limited to 'sound/soc/intel/atom/sst-mfld-platform-pcm.c')
-rw-r--r--sound/soc/intel/atom/sst-mfld-platform-pcm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 6add70500ed8..9e9b05883557 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -333,6 +333,17 @@ static int sst_media_open(struct snd_pcm_substream *substream,
if (ret_val < 0)
goto out_power_up;
+ /*
+ * Make sure the period to be multiple of 1ms to align the
+ * design of firmware. Apply same rule to buffer size to make
+ * sure alsa could always find a value for period size
+ * regardless the buffer size given by user space.
+ */
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 48);
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 48);
+
/* Make sure, that the period size is always even */
snd_pcm_hw_constraint_step(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_PERIODS, 2);