aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijendar Mukunda <[email protected]>2024-06-17 12:58:41 +0530
committerMark Brown <[email protected]>2024-06-21 13:18:09 +0100
commit8978e1f7bc26655e0373c4a6b31e17fcdd497329 (patch)
tree963160b6543a397d3e12a3ad5b54ee9ef9825573
parentd85695b01cbb2455a2f70528bb9e53f2463a39cf (diff)
ASoC: amd: acp: add pcm constraints for buffer size and period size
ACP common dma driver has a buffer size and period size restriction which should be 64 byte aligned. Add pcm constraints for the same. Signed-off-by: Vijendar Mukunda <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/amd/acp/acp-platform.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c
index aaac8aa744cb..4f409cd09c11 100644
--- a/sound/soc/amd/acp/acp-platform.c
+++ b/sound/soc/amd/acp/acp-platform.c
@@ -197,6 +197,20 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs
else
runtime->hw = acp_pcm_hardware_capture;
+ ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, DMA_SIZE);
+ if (ret) {
+ dev_err(component->dev, "set hw constraint HW_PARAM_PERIOD_BYTES failed\n");
+ kfree(stream);
+ return ret;
+ }
+
+ ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, DMA_SIZE);
+ if (ret) {
+ dev_err(component->dev, "set hw constraint HW_PARAM_BUFFER_BYTES failed\n");
+ kfree(stream);
+ return ret;
+ }
+
ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0) {
dev_err(component->dev, "set integer constraint failed\n");