OSDN Git Service

ASoC: fsl_sai: Specify the maxburst to 8 on i.MX93 platform
authorChancel Liu <chancel.liu@nxp.com>
Thu, 27 Oct 2022 06:03:11 +0000 (14:03 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 28 Oct 2022 09:46:53 +0000 (10:46 +0100)
There is a limit to eDMA AXI on i.MX93. Only TCD that has NBYTES in a
multiple of 8bytes can enable scatter-gather. NBYTES is calculated by
bus width times maxburst. On i.MX93 platform the value of maxburst is
specified to 8. It makes sure that NBYTES is a multiple of 8bytes.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20221027060311.2549711-4-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_sai.c
sound/soc/fsl/fsl_sai.h

index 68e1cc4..a0ea27f 100644 (file)
@@ -872,10 +872,10 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
 
        regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs),
                           FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
-                          sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX);
+                          sai->soc_data->fifo_depth - sai->dma_params_tx.maxburst);
        regmap_update_bits(sai->regmap, FSL_SAI_RCR1(ofs),
                           FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
-                          FSL_SAI_MAXBURST_RX - 1);
+                          sai->dma_params_rx.maxburst - 1);
 
        snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx,
                                &sai->dma_params_rx);
@@ -1416,8 +1416,10 @@ static int fsl_sai_probe(struct platform_device *pdev)
 
        sai->dma_params_rx.addr = sai->res->start + FSL_SAI_RDR0;
        sai->dma_params_tx.addr = sai->res->start + FSL_SAI_TDR0;
-       sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX;
-       sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX;
+       sai->dma_params_rx.maxburst =
+               sai->soc_data->max_burst[RX] ? sai->soc_data->max_burst[RX] : FSL_SAI_MAXBURST_RX;
+       sai->dma_params_tx.maxburst =
+               sai->soc_data->max_burst[TX] ? sai->soc_data->max_burst[TX] : FSL_SAI_MAXBURST_TX;
 
        sai->pinctrl = devm_pinctrl_get(&pdev->dev);
 
@@ -1588,6 +1590,7 @@ static const struct fsl_sai_soc_data fsl_sai_imx93_data = {
        .pins = 4,
        .flags = 0,
        .max_register = FSL_SAI_MCTL,
+       .max_burst = {8, 8},
 };
 
 static const struct of_device_id fsl_sai_ids[] = {
index 697f669..197748a 100644 (file)
@@ -235,6 +235,7 @@ struct fsl_sai_soc_data {
        unsigned int reg_offset;
        unsigned int flags;
        unsigned int max_register;
+       unsigned int max_burst[2];
 };
 
 /**