]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00219931 ESAI ASRC: fix channel swap bug while playback 6 channel
authorChen Liangjun <b36089@freescale.com>
Thu, 16 Aug 2012 09:14:37 +0000 (17:14 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:14 +0000 (08:35 +0200)
Channel swap caused by 2 reason:

1. To avoid ASRC underflow error, ASRC driver would prefill ASRC input
FIFO with 160 samples. However, 160 can't be divided by 6. In this case,
channel data miss alignment. In this patch, prefill ASRC input
FIFO with 120, which can be divided by 2,4,6,8.

2. While start P2P playback, ESAI driver would first start SDMA, then
ASRC, and last ESAI. While start ESAI, the data is not ready, thus ESAI
underrun would happens and channel data miss alignment. In this patch,
delay 1 ms between ASRC's start and ESAI's start.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
drivers/mxc/asrc/mxc_asrc.c
sound/soc/imx/imx-pcm-dma-mx2.c

index cf41f29942264074553525a4ab0904c0876a6a94..ed3256906863fd054ed492c390d59fecbf5860de 100644 (file)
@@ -667,12 +667,6 @@ void asrc_start_conv(enum asrc_pair_index index)
                __raw_writel(reg,
                             g_asrc->vaddr + ASRC_ASRDIA_REG +
                             (index << 3));
-               __raw_writel(reg,
-                            g_asrc->vaddr + ASRC_ASRDIA_REG +
-                            (index << 3));
-               __raw_writel(reg,
-                            g_asrc->vaddr + ASRC_ASRDIA_REG +
-                            (index << 3));
        }
 
        __raw_writel(0x40, g_asrc->vaddr + ASRC_ASRIER_REG);
index b36b28108049bcae5031e2175d66b194dd9948e4..ad8d5a3329c74071846ce07d9fd9d1afa2297ec6 100644 (file)
@@ -359,6 +359,7 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
                        dmaengine_submit(iprtd->asrc_p2p_desc);
                        dmaengine_submit(iprtd->asrc_desc);
                        asrc_start_conv(iprtd->asrc_index);
+                       mdelay(1);
                } else {
                        dmaengine_submit(iprtd->desc);
                }