MLK-15109-3: ASoC: fsl_esai: add constraint for dma workaround
authorShengjiu Wang <shengjiu.wang@freescale.com>
Mon, 19 Jun 2017 03:28:42 +0000 (11:28 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:28:26 +0000 (15:28 -0500)
Use GPT dma event to instead of esai dma event can't totally
resolve/workaround the hardware issue, There is two GPT, one
GPT is to get the failing edge of dma event, then to trigger
EDMA copy data, another one is to get the raising edge, then to
clear the interrupt of both GPT, sometimes, the clear operation
may clear the failing edge event wrongly in race condition.
then the EDMA will stop.
In test result, the high sample rate and multi-channel is easy
to trigger this issue. so add constraint for them to make the
workaround stable

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
sound/soc/fsl/fsl_esai.c

index d0b6c45..e5cc9c8 100644 (file)
@@ -640,6 +640,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
                                esai_priv->dma_params_rx.maxburst);
        }
 
+       if (esai_priv->soc->dma_workaround) {
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                               SNDRV_PCM_HW_PARAM_CHANNELS, 1, 2);
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                               SNDRV_PCM_HW_PARAM_RATE, 48000, 48000);
+       }
+
        return 0;
 
 err_fsysclk: