Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
- index cda76a2..d0ab0bd 100644
- --- a/arch/arm/mach-imx/clk-imx6q.c
- +++ b/arch/arm/mach-imx/clk-imx6q.c
- @@ -750,7 +750,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
- imx_clk_set_rate(clk[spdif1_sel], 7500000);
- /* Set pll4_audio to a value that can derive 5K-88.2KHz and 8K-96KHz */
- - imx_clk_set_rate(clk[pll4_audio_div], 541900800);
- + //imx_clk_set_rate(clk[pll4_audio_div], 541900800);
- + /* Set pll4_audio to a value that can derive 20480000 Hz for ESAI */
- + imx_clk_set_rate(clk[pll4_audio_div], 524288000);//which set actually around 524800000
- #ifdef CONFIG_MX6_VPU_352M
- /*
- diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
- index fd73e97..15ffc89 100644
- --- a/sound/soc/fsl/fsl_esai.c
- +++ b/sound/soc/fsl/fsl_esai.c
- @@ -136,16 +136,20 @@ static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, bool tx, u32 ratio,
- 2 * 8 * 256 * maxfp);
- return -EINVAL;
- } else if (ratio % 2) {
- - dev_err(dai->dev, "the raio must be even if using upper divider\n");
- + dev_err(dai->dev, "the ratio must be even if using upper divider\n");
- return -EINVAL;
- }
- ratio /= 2;
- psr = ratio <= 256 * maxfp ? ESAI_xCCR_xPSR_BYPASS : ESAI_xCCR_xPSR_DIV8;
- -
- - /* Set the max fluctuation -- 0.1% of the max devisor */
- - savesub = (psr ? 1 : 8) * 256 * maxfp / 1000;
- + if(psr){
- + /* Set the max fluctuation -- 1% of the max divisor */
- + savesub = 1 * 256 * maxfp / 100;
- + }else{
- + /* Set the max fluctuation -- 0.1% of the max divisor */
- + savesub = 8 * 256 * maxfp / 1000;
- + }
- /* Find the best value for PM */
- for (i = 1; i <= 256; i++) {
- @@ -249,11 +253,14 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
- }
- clk_rate = clk_get_rate(clksrc);
- - ratio = clk_rate / freq;
- - if (ratio * freq > clk_rate)
- + ratio = clk_rate;
- + ratio = DIV_ROUND_CLOSEST(ratio,freq);
- + if (ratio * freq > clk_rate){
- ret = ratio * freq - clk_rate;
- - else if (ratio * freq < clk_rate)
- + }
- + else if (ratio * freq < clk_rate){
- ret = clk_rate - ratio * freq;
- + }
- else
- ret = 0;
- @@ -293,7 +300,10 @@ static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
- {
- struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
- u32 hck_rate = esai_priv->hck_rate[tx];
- - u32 sub, ratio = hck_rate / freq;
- + u32 sub, ratio;
- +
- + ratio = hck_rate;
- + ratio = DIV_ROUND_CLOSEST(ratio,freq);
- /* Don't apply for fully slave mode*/
- if (esai_priv->slave_mode)
- @@ -546,7 +556,7 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
- regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
- ESAI_xFCR_xFEN_MASK, ESAI_xFCR_xFEN);
- - /* Write initial words reqiured by ESAI as normal procedure */
- + /* Write initial words required by ESAI as normal procedure */
- for (i = 0; tx && i < channels; i++)
- regmap_write(esai_priv->regmap, REG_ESAI_ETDR, 0x0);
- @@ -608,14 +618,14 @@ static struct snd_soc_dai_driver fsl_esai_dai = {
- .playback = {
- .stream_name = "esai-Playback",
- .channels_min = 1,
- - .channels_max = 12,
- + .channels_max = 64,//12,
- .rates = FSL_ESAI_RATES,
- .formats = FSL_ESAI_FORMATS,
- },
- .capture = {
- .stream_name = "esai-Capture",
- .channels_min = 1,
- - .channels_max = 8,
- + .channels_max = 64,//8,
- .rates = FSL_ESAI_RATES,
- .formats = FSL_ESAI_FORMATS,
- },
- @@ -911,8 +921,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
- else
- esai_priv->fifo_depth = 64;
- - esai_priv->dma_params_tx.maxburst = 16;
- - esai_priv->dma_params_rx.maxburst = 16;
- + esai_priv->dma_params_tx.maxburst = 64;
- + esai_priv->dma_params_rx.maxburst = 64;
- esai_priv->dma_params_tx.addr = res->start + REG_ESAI_ETDR;
- esai_priv->dma_params_rx.addr = res->start + REG_ESAI_ERDR;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement