Advertisement
codekipper

Untitled

May 30th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. commit 7e406355c5001d6e8e6100e4062df41b41f80ab8
  2. Author: Marcus Cooper <[email protected]>
  3. Date: Sun Mar 20 18:54:29 2016 +0100
  4.  
  5. hacking 22nd Mar 2016
  6.  
  7. diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
  8. index 54d76cb..b609f75 100644
  9. --- a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
  10. +++ b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
  11. @@ -74,6 +74,12 @@
  12. };
  13. };
  14.  
  15. + pcm5102: pcm510x {
  16. + compatible = "ti,pcm510x";
  17. + pcm510x,format = "i2s";
  18. + #sound-dai-cells = <0>;
  19. + };
  20. +
  21. sound_i2s {
  22. compatible = "simple-audio-card";
  23. simple-audio-card,format = "i2s";
  24. @@ -98,6 +104,7 @@
  25. };
  26.  
  27. simple-audio-card,codec {
  28. + // sound-dai = <&pcm5102>;
  29. sound-dai = <&ext_codec>;
  30. };
  31. };
  32. diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
  33. index de8230c..be2cafc 100644
  34. --- a/sound/soc/codecs/uda1380.c
  35. +++ b/sound/soc/codecs/uda1380.c
  36. @@ -664,13 +664,13 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
  37. .channels_min = 1,
  38. .channels_max = 2,
  39. .rates = UDA1380_RATES,
  40. - .formats = SNDRV_PCM_FMTBIT_S16_LE,},
  41. + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
  42. .capture = {
  43. .stream_name = "Capture",
  44. .channels_min = 1,
  45. .channels_max = 2,
  46. .rates = UDA1380_RATES,
  47. - .formats = SNDRV_PCM_FMTBIT_S16_LE,},
  48. + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
  49. .ops = &uda1380_dai_ops,
  50. },
  51. { /* playback only - dual interface */
  52. @@ -680,8 +680,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
  53. .channels_min = 1,
  54. .channels_max = 2,
  55. .rates = UDA1380_RATES,
  56. - .formats = SNDRV_PCM_FMTBIT_S16_LE,
  57. - },
  58. + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
  59. .ops = &uda1380_dai_ops_playback,
  60. },
  61. { /* capture only - dual interface*/
  62. @@ -691,8 +690,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
  63. .channels_min = 1,
  64. .channels_max = 2,
  65. .rates = UDA1380_RATES,
  66. - .formats = SNDRV_PCM_FMTBIT_S16_LE,
  67. - },
  68. + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE), },
  69. .ops = &uda1380_dai_ops_capture,
  70. },
  71. };
  72. diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
  73. index 66c5618..c1a4a40c 100644
  74. --- a/sound/soc/sunxi/sun4i-codec.c
  75. +++ b/sound/soc/sunxi/sun4i-codec.c
  76. @@ -499,6 +499,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = {
  77. SNDRV_PCM_RATE_96000 |
  78. SNDRV_PCM_RATE_192000,
  79. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  80. + SNDRV_PCM_FMTBIT_S24_LE |
  81. SNDRV_PCM_FMTBIT_S32_LE,
  82. .sig_bits = 24,
  83. },
  84. diff --git a/sound/soc/sunxi/sun4i-dai.c b/sound/soc/sunxi/sun4i-dai.c
  85. index cc6f697..ddec2b0 100644
  86. --- a/sound/soc/sunxi/sun4i-dai.c
  87. +++ b/sound/soc/sunxi/sun4i-dai.c
  88. @@ -134,10 +134,8 @@ static int sun4i_dai_params_to_sr(struct snd_pcm_hw_params *params)
  89. ret = 1;
  90. break;
  91. case 24:
  92. - ret = 2;
  93. - break;
  94. case 32:
  95. - ret = 3;
  96. + ret = 2;
  97. break;
  98. }
  99.  
  100. @@ -147,7 +145,7 @@ static int sun4i_dai_params_to_sr(struct snd_pcm_hw_params *params)
  101. static u8 sun4i_dai_params_to_wss(struct snd_pcm_hw_params *params)
  102. {
  103. int ret = -EINVAL;
  104. - switch (params_width(params)) {
  105. + switch (snd_soc_params_to_frame_size(params)) {
  106. case 16:
  107. ret = 0;
  108. break;
  109. @@ -259,7 +257,7 @@ static int sun4i_dai_set_clk_rate(struct sun4i_dai *sdai,
  110. break;
  111. }
  112.  
  113. - if (bclk_div <= 0 && mclk_div <= 0)
  114. + if ((bclk_div < 0) || (mclk_div < 0))
  115. return -EINVAL;
  116.  
  117. printk("%s +%d\n", __func__, __LINE__);
  118. @@ -312,6 +310,10 @@ static int sun4i_dai_hw_params(struct snd_pcm_substream *substream,
  119. case 16:
  120. width = DMA_SLAVE_BUSWIDTH_2_BYTES;
  121. break;
  122. + case 24:
  123. + case 32:
  124. + width = DMA_SLAVE_BUSWIDTH_4_BYTES;
  125. + break;
  126. default:
  127. return -EINVAL;
  128. }
  129. @@ -329,7 +331,7 @@ static int sun4i_dai_hw_params(struct snd_pcm_substream *substream,
  130. if (wss < 0)
  131. return -EINVAL;
  132.  
  133. - printk("%s +%d\n", __func__, __LINE__);
  134. + printk("%s wss returned is %d based on a width of %d\n", __func__, wss, snd_soc_params_to_frame_size(params));
  135.  
  136. regmap_update_bits(sdai->regmap, SUN4I_DAI_FMT0_REG,
  137. SUN4I_DAI_FMT0_WSS_MASK | SUN4I_DAI_FMT0_SR_MASK,
  138. @@ -338,7 +340,7 @@ static int sun4i_dai_hw_params(struct snd_pcm_substream *substream,
  139. printk("%s +%d\n", __func__, __LINE__);
  140.  
  141. return sun4i_dai_set_clk_rate(sdai, params_rate(params),
  142. - params_width(params));
  143. + snd_soc_params_to_frame_size(params));
  144. }
  145.  
  146. static int sun4i_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
  147. @@ -553,10 +555,8 @@ static int sun4i_dai_dai_probe(struct snd_soc_dai *dai)
  148.  
  149. #define SUN4I_RATES SNDRV_PCM_RATE_8000_192000
  150.  
  151. -#define SUN4I_FORMATS (SNDRV_PCM_FORMAT_S16_LE | \
  152. - SNDRV_PCM_FORMAT_S20_3LE | \
  153. - SNDRV_PCM_FORMAT_S24_LE | \
  154. - SNDRV_PCM_FORMAT_S32_LE)
  155. +#define SUN4I_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
  156. + SNDRV_PCM_FMTBIT_S24_LE)
  157.  
  158. static struct snd_soc_dai_driver sun4i_dai_dai = {
  159. .probe = sun4i_dai_dai_probe,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement