summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChen Liangjun <b36089@freescale.com>2012-08-16 19:20:51 +0800
committerChen Liangjun <b36089@freescale.com>2012-08-17 15:38:31 +0800
commite2dc80107eeaa87626f02adba60ab904c41de82e (patch)
tree40ae9454dad49def86137c8535504a328407bd23 /drivers
parent59f87e44a8faaef59969daadd1a7d295adbda3a0 (diff)
ENGR00219926-1 ESAI ASRC: use ideal ratio for ASRC P2P playback
When use no ideal-ratio mode for ESAI playback, CPU should provide accurate clock for input clock, which means input clock should be divided by input sample rate. However, all our clock is from 24M crystal and if the input sample rate equal to 44.1k or so, CPU can't provide these clock. In this patch, use ideal ratio mode thus CPU need not provide accurate clock which can be divided by 44.1k. Signed-off-by: Chen Liangjun <b36089@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/asrc/mxc_asrc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mxc/asrc/mxc_asrc.c b/drivers/mxc/asrc/mxc_asrc.c
index ed3256906863..cd4d9ee98a9f 100644
--- a/drivers/mxc/asrc/mxc_asrc.c
+++ b/drivers/mxc/asrc/mxc_asrc.c
@@ -583,17 +583,23 @@ int asrc_config_pair(struct asrc_config *config)
}
}
- if ((config->inclk == INCLK_ASRCK1_CLK) &&
+ if ((config->inclk == INCLK_NONE) &&
(config->outclk == OUTCLK_ESAI_TX)) {
reg = __raw_readl(g_asrc->vaddr + ASRC_ASRCTR_REG);
- reg |= (1 << (20 + config->pair));
- reg |= (0x02 << (13 + (config->pair << 1)));
+ reg &= ~(1 << (20 + config->pair));
+ reg |= (0x03 << (13 + (config->pair << 1)));
__raw_writel(reg, g_asrc->vaddr + ASRC_ASRCTR_REG);
err = asrc_set_clock_ratio(config->pair,
config->input_sample_rate,
config->output_sample_rate);
if (err < 0)
return err;
+ err = asrc_set_process_configuration(config->pair,
+ config->input_sample_rate,
+ config->
+ output_sample_rate);
+ if (err < 0)
+ return err;
}
/* Config input and output wordwidth */