]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00219926-2 ASRC: use PAIR B for ASRC ideal ratio convert
authorChen Liangjun <b36089@freescale.com>
Thu, 16 Aug 2012 11:31:49 +0000 (19:31 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:15 +0000 (08:35 +0200)
When use ASRC ideal ratio mode for convert, PAIR C can't work properly.
However, when use PAIR C for internal ratio mode or non ratio mode
convert, it can work properly.

In this patch, Use PAIR B for 6 channel convert as a workaround.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
drivers/mxc/asrc/mxc_asrc.c

index cd4d9ee98a9fe6343bdba548125d46c83d04e663..62d7ceb0e04fc2a7440aa1c5cf299df622be2422 100644 (file)
@@ -316,22 +316,22 @@ int asrc_req_pair(int chn_num, enum asrc_pair_index *index)
        spin_lock_irqsave(&data_lock, lock_flags);
 
        if (chn_num > 2) {
-               pair = &g_asrc->asrc_pair[ASRC_PAIR_C];
+               pair = &g_asrc->asrc_pair[ASRC_PAIR_B];
                if (pair->active || (chn_num > pair->chn_max))
                        err = -EBUSY;
                else {
-                       *index = ASRC_PAIR_C;
+                       *index = ASRC_PAIR_B;
                        pair->chn_num = chn_num;
                        pair->active = 1;
                }
        } else {
                pair = &g_asrc->asrc_pair[ASRC_PAIR_A];
                if (pair->active || (pair->chn_max == 0)) {
-                       pair = &g_asrc->asrc_pair[ASRC_PAIR_B];
+                       pair = &g_asrc->asrc_pair[ASRC_PAIR_C];
                        if (pair->active || (pair->chn_max == 0))
                                err = -EBUSY;
                        else {
-                               *index = ASRC_PAIR_B;
+                               *index = ASRC_PAIR_C;
                                pair->chn_num = 2;
                                pair->active = 1;
                        }
@@ -813,9 +813,9 @@ static int mxc_init_asrc(void)
        /* Enable overflow interrupt */
        __raw_writel(0x00, g_asrc->vaddr + ASRC_ASRIER_REG);
 
-       /* Default 6: 2: 2 channel assignment */
-       __raw_writel((0x06 << g_asrc->mxc_asrc_data->channel_bits *
-                     2) | (0x02 << g_asrc->mxc_asrc_data->channel_bits) | 0x02,
+       /* Default 2: 6: 2 channel assignment */
+       __raw_writel((0x02 << g_asrc->mxc_asrc_data->channel_bits *
+                     2) | (0x06 << g_asrc->mxc_asrc_data->channel_bits) | 0x02,
                     g_asrc->vaddr + ASRC_ASRCNCR_REG);
 
        /* Parameter Registers recommended settings */
@@ -1696,8 +1696,8 @@ static int mxc_asrc_probe(struct platform_device *pdev)
        g_asrc->dev->coherent_dma_mask = DMA_BIT_MASK(32);
 
        g_asrc->asrc_pair[0].chn_max = 2;
-       g_asrc->asrc_pair[1].chn_max = 2;
-       g_asrc->asrc_pair[2].chn_max = 6;
+       g_asrc->asrc_pair[1].chn_max = 6;
+       g_asrc->asrc_pair[2].chn_max = 2;
        g_asrc->asrc_pair[0].overload_error = 0;
        g_asrc->asrc_pair[1].overload_error = 0;
        g_asrc->asrc_pair[2].overload_error = 0;