diff options
author | Chancel Liu <[email protected]> | 2023-01-04 10:39:53 +0800 |
---|---|---|
committer | Mark Brown <[email protected]> | 2023-01-09 13:04:23 +0000 |
commit | 1760df5b7ee6a0bfc8ad47f4db490c36c5546be8 (patch) | |
tree | a3d14b88a69a391571731854bc2ff7990ac29992 | |
parent | e240b9329a300af7b7c1eba2ce0abbf19e6c540b (diff) |
ASoC: fsl_xcvr: Add constraints of period size while using eDMA
eDMA on i.MX93 platform requires the period size to be multiple of
maxburst.
Signed-off-by: Chancel Liu <[email protected]>
Acked-by: Shengjiu Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
-rw-r--r-- | sound/soc/fsl/fsl_xcvr.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index b794158a7876..2a78243df752 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -22,6 +22,7 @@ struct fsl_xcvr_soc_data { const char *fw_name; bool spdif_only; + bool use_edma; }; struct fsl_xcvr { @@ -538,6 +539,16 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream, return -EBUSY; } + /* + * EDMA controller needs period size to be a multiple of + * tx/rx maxburst + */ + if (xcvr->soc_data->use_edma) + snd_pcm_hw_constraint_step(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, + tx ? xcvr->dma_prms_tx.maxburst : + xcvr->dma_prms_rx.maxburst); + switch (xcvr->mode) { case FSL_XCVR_MODE_SPDIF: case FSL_XCVR_MODE_ARC: @@ -1207,6 +1218,7 @@ static const struct fsl_xcvr_soc_data fsl_xcvr_imx8mp_data = { static const struct fsl_xcvr_soc_data fsl_xcvr_imx93_data = { .spdif_only = true, + .use_edma = true, }; static const struct of_device_id fsl_xcvr_dt_ids[] = { |