]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00220446 ESAI: channel swapped occasionally when playing stereo wav
authorLionel Xu <Lionel.Xu@freescale.com>
Fri, 17 Aug 2012 08:06:32 +0000 (16:06 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:15 +0000 (08:35 +0200)
There is channel swap happened when playing stereo wav. According to the spec,
the initial words should be written to the ETDR register, at least one word
per enabled transmitter slot, to avoid any potential problem.

Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
sound/soc/imx/imx-esai.c

index b3cba9ea53c4a7094fc6c0f858491876eb89dec6..bc56d8073dceb957ed33672ba2fb13adef2ceeaa 100644 (file)
@@ -468,6 +468,7 @@ static int imx_esai_trigger(struct snd_pcm_substream *substream, int cmd,
 {
        struct imx_esai *esai = snd_soc_dai_get_drvdata(cpu_dai);
        u32 reg, tfcr = 0, rfcr = 0;
+       int i;
 
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                tfcr = readl(esai->base + ESAI_TFCR);
@@ -483,6 +484,9 @@ static int imx_esai_trigger(struct snd_pcm_substream *substream, int cmd,
                if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                        tfcr |= ESAI_TFCR_TFEN;
                        writel(tfcr, esai->base + ESAI_TFCR);
+                       /* write initial words to ETDR register */
+                       for (i = 0; i < substream->runtime->channels; i++)
+                               writel(0x0, esai->base + ESAI_ETDR);
                        reg |= ESAI_TCR_TE(substream->runtime->channels);
                        writel(reg, esai->base + ESAI_TCR);
                } else {