Advertisement
Guest User

patch_on_top_of_imx_3.10.53_1.1.0_ga.patch

a guest
Jan 15th, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.82 KB | None | 0 0
  1. diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
  2. index cda76a2..d0ab0bd 100644
  3. --- a/arch/arm/mach-imx/clk-imx6q.c
  4. +++ b/arch/arm/mach-imx/clk-imx6q.c
  5. @@ -750,7 +750,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
  6.     imx_clk_set_rate(clk[spdif1_sel], 7500000);
  7.  
  8.     /* Set pll4_audio to a value that can derive 5K-88.2KHz and 8K-96KHz */
  9. -   imx_clk_set_rate(clk[pll4_audio_div], 541900800);
  10. +   //imx_clk_set_rate(clk[pll4_audio_div], 541900800);
  11. +   /* Set pll4_audio to a value that can derive 20480000 Hz for ESAI */
  12. +   imx_clk_set_rate(clk[pll4_audio_div], 524288000);//which set actually around 524800000
  13.  
  14.  #ifdef CONFIG_MX6_VPU_352M
  15.     /*
  16. diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
  17. index fd73e97..15ffc89 100644
  18. --- a/sound/soc/fsl/fsl_esai.c
  19. +++ b/sound/soc/fsl/fsl_esai.c
  20. @@ -136,16 +136,20 @@ static int fsl_esai_divisor_cal(struct snd_soc_dai *dai, bool tx, u32 ratio,
  21.                 2 * 8 * 256 * maxfp);
  22.         return -EINVAL;
  23.     } else if (ratio % 2) {
  24. -       dev_err(dai->dev, "the raio must be even if using upper divider\n");
  25. +       dev_err(dai->dev, "the ratio must be even if using upper divider\n");
  26.         return -EINVAL;
  27.     }
  28.  
  29.     ratio /= 2;
  30.  
  31.     psr = ratio <= 256 * maxfp ? ESAI_xCCR_xPSR_BYPASS : ESAI_xCCR_xPSR_DIV8;
  32. -
  33. -   /* Set the max fluctuation -- 0.1% of the max devisor */
  34. -   savesub = (psr ? 1 : 8)  * 256 * maxfp / 1000;
  35. +   if(psr){
  36. +       /* Set the max fluctuation -- 1% of the max divisor */
  37. +       savesub = 1  * 256 * maxfp / 100;
  38. +   }else{
  39. +       /* Set the max fluctuation -- 0.1% of the max divisor */
  40. +       savesub = 8  * 256 * maxfp / 1000;
  41. +   }
  42.  
  43.     /* Find the best value for PM */
  44.     for (i = 1; i <= 256; i++) {
  45. @@ -249,11 +253,14 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
  46.     }
  47.     clk_rate = clk_get_rate(clksrc);
  48.  
  49. -   ratio = clk_rate / freq;
  50. -   if (ratio * freq > clk_rate)
  51. +   ratio = clk_rate;
  52. +   ratio = DIV_ROUND_CLOSEST(ratio,freq);
  53. +   if (ratio * freq > clk_rate){
  54.         ret = ratio * freq - clk_rate;
  55. -   else if (ratio * freq < clk_rate)
  56. +   }
  57. +   else if (ratio * freq < clk_rate){
  58.         ret = clk_rate - ratio * freq;
  59. +   }
  60.     else
  61.         ret = 0;
  62.  
  63. @@ -293,7 +300,10 @@ static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
  64.  {
  65.     struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
  66.     u32 hck_rate = esai_priv->hck_rate[tx];
  67. -   u32 sub, ratio = hck_rate / freq;
  68. +   u32 sub, ratio;
  69. +
  70. +   ratio = hck_rate;
  71. +   ratio = DIV_ROUND_CLOSEST(ratio,freq);
  72.  
  73.     /* Don't apply for fully slave mode*/
  74.     if (esai_priv->slave_mode)
  75. @@ -546,7 +556,7 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd,
  76.         regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx),
  77.                    ESAI_xFCR_xFEN_MASK, ESAI_xFCR_xFEN);
  78.  
  79. -       /* Write initial words reqiured by ESAI as normal procedure */
  80. +       /* Write initial words required by ESAI as normal procedure */
  81.         for (i = 0; tx && i < channels; i++)
  82.             regmap_write(esai_priv->regmap, REG_ESAI_ETDR, 0x0);
  83.  
  84. @@ -608,14 +618,14 @@ static struct snd_soc_dai_driver fsl_esai_dai = {
  85.     .playback = {
  86.         .stream_name = "esai-Playback",
  87.         .channels_min = 1,
  88. -       .channels_max = 12,
  89. +       .channels_max = 64,//12,
  90.         .rates = FSL_ESAI_RATES,
  91.         .formats = FSL_ESAI_FORMATS,
  92.     },
  93.     .capture = {
  94.         .stream_name = "esai-Capture",
  95.         .channels_min = 1,
  96. -       .channels_max = 8,
  97. +       .channels_max = 64,//8,
  98.         .rates = FSL_ESAI_RATES,
  99.         .formats = FSL_ESAI_FORMATS,
  100.     },
  101. @@ -911,8 +921,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
  102.     else
  103.         esai_priv->fifo_depth = 64;
  104.  
  105. -   esai_priv->dma_params_tx.maxburst = 16;
  106. -   esai_priv->dma_params_rx.maxburst = 16;
  107. +   esai_priv->dma_params_tx.maxburst = 64;
  108. +   esai_priv->dma_params_rx.maxburst = 64;
  109.     esai_priv->dma_params_tx.addr = res->start + REG_ESAI_ETDR;
  110.     esai_priv->dma_params_rx.addr = res->start + REG_ESAI_ERDR;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement