From 2dbe5b42298d7418636405beafb5809595794469 Mon Sep 17 00:00:00 2001 From: Chen Liangjun Date: Thu, 16 Aug 2012 19:31:49 +0800 Subject: [PATCH] ENGR00219926-2 ASRC: use PAIR B for ASRC ideal ratio convert 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 --- drivers/mxc/asrc/mxc_asrc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/mxc/asrc/mxc_asrc.c b/drivers/mxc/asrc/mxc_asrc.c index cd4d9ee98a9f..62d7ceb0e04f 100644 --- a/drivers/mxc/asrc/mxc_asrc.c +++ b/drivers/mxc/asrc/mxc_asrc.c @@ -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; -- 2.39.5