Commit 1760df5b authored by Chancel Liu's avatar Chancel Liu Committed by Mark Brown

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: default avatarChancel Liu <chancel.liu@nxp.com>
Acked-by: default avatarShengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230104023953.2973362-4-chancel.liu@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e240b932
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
struct fsl_xcvr_soc_data { struct fsl_xcvr_soc_data {
const char *fw_name; const char *fw_name;
bool spdif_only; bool spdif_only;
bool use_edma;
}; };
struct fsl_xcvr { struct fsl_xcvr {
...@@ -538,6 +539,16 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream, ...@@ -538,6 +539,16 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream,
return -EBUSY; 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) { switch (xcvr->mode) {
case FSL_XCVR_MODE_SPDIF: case FSL_XCVR_MODE_SPDIF:
case FSL_XCVR_MODE_ARC: case FSL_XCVR_MODE_ARC:
...@@ -1207,6 +1218,7 @@ static const struct fsl_xcvr_soc_data fsl_xcvr_imx8mp_data = { ...@@ -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 = { static const struct fsl_xcvr_soc_data fsl_xcvr_imx93_data = {
.spdif_only = true, .spdif_only = true,
.use_edma = true,
}; };
static const struct of_device_id fsl_xcvr_dt_ids[] = { static const struct of_device_id fsl_xcvr_dt_ids[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment