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>
__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);
dmaengine_submit(iprtd->asrc_p2p_desc);
dmaengine_submit(iprtd->asrc_desc);
asrc_start_conv(iprtd->asrc_index);
+ mdelay(1);
} else {
dmaengine_submit(iprtd->desc);
}