summaryrefslogtreecommitdiff
path: root/sound/soc/sof/intel/intel-ipc.c
diff options
context:
space:
mode:
authorKai Vehmanen <kai.vehmanen@linux.intel.com>2020-11-18 17:05:45 +0300
committerMark Brown <broonie@kernel.org>2020-11-19 16:00:04 +0300
commitcaebea04b9125c677e6e747793fbc7fab077727b (patch)
treeebc7b8f65bbbc784df3aee16e3ad26e57a34c92d /sound/soc/sof/intel/intel-ipc.c
parent9983ac49b7db34258facf47439463e96522e1d5a (diff)
downloadlinux-caebea04b9125c677e6e747793fbc7fab077727b.tar.xz
ASoC: SOF: Intel: add hw specific PCM constraints
Part of PCM constraints are set based on DSP topology, but rest should be set based on hardware capabilities. Add PCM constraints for Intel platforms: - Add constraint for the period count to be integer. This avoids wrap-arounds of the DMA circular buffer in middle of a period. - Align period size to dword/32bit as per HDA spec. Both constraints are aligned with current implementation in snd-hda-intel driver. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20201118140545.2138895-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/intel-ipc.c')
-rw-r--r--sound/soc/sof/intel/intel-ipc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/intel-ipc.c b/sound/soc/sof/intel/intel-ipc.c
index 310f9168c124..de66f8a82a07 100644
--- a/sound/soc/sof/intel/intel-ipc.c
+++ b/sound/soc/sof/intel/intel-ipc.c
@@ -73,6 +73,13 @@ int intel_pcm_open(struct snd_sof_dev *sdev,
/* binding pcm substream to hda stream */
substream->runtime->private_data = stream;
+ /* align to DMA minimum transfer size */
+ snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
+
+ /* avoid circular buffer wrap in middle of period */
+ snd_pcm_hw_constraint_integer(substream->runtime,
+ SNDRV_PCM_HW_PARAM_PERIODS);
+
return 0;
}
EXPORT_SYMBOL_NS(intel_pcm_open, SND_SOC_SOF_INTEL_HIFI_EP_IPC);