simple-card.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. Simple-Card:
  2. Simple-Card specifies audio DAI connections of SoC <-> codec.
  3. Required properties:
  4. - compatible : "simple-audio-card"
  5. Optional properties:
  6. - simple-audio-card,name : User specified audio sound card name, one string
  7. property.
  8. - simple-audio-card,widgets : Please refer to widgets.txt.
  9. - simple-audio-card,routing : A list of the connections between audio components.
  10. Each entry is a pair of strings, the first being the
  11. connection's sink, the second being the connection's
  12. source.
  13. - simple-audio-card,mclk-fs : Multiplication factor between stream rate and codec
  14. mclk. When defined, mclk-fs property defined in
  15. dai-link sub nodes are ignored.
  16. - simple-audio-card,hp-det-gpio : Reference to GPIO that signals when
  17. headphones are attached.
  18. - simple-audio-card,mic-det-gpio : Reference to GPIO that signals when
  19. a microphone is attached.
  20. - simple-audio-card,aux-devs : List of phandles pointing to auxiliary devices, such
  21. as amplifiers, to be added to the sound card.
  22. Optional subnodes:
  23. - simple-audio-card,dai-link : Container for dai-link level
  24. properties and the CPU and CODEC
  25. sub-nodes. This container may be
  26. omitted when the card has only one
  27. DAI link. See the examples and the
  28. section below.
  29. Dai-link subnode properties and subnodes:
  30. If dai-link subnode is omitted and the subnode properties are directly
  31. under "sound"-node the subnode property and subnode names have to be
  32. prefixed with "simple-audio-card,"-prefix.
  33. Required dai-link subnodes:
  34. - cpu : CPU sub-node
  35. - codec : CODEC sub-node
  36. Optional dai-link subnode properties:
  37. - format : CPU/CODEC common audio format.
  38. "i2s", "right_j", "left_j" , "dsp_a"
  39. "dsp_b", "ac97", "pdm", "msb", "lsb"
  40. - frame-master : Indicates dai-link frame master.
  41. phandle to a cpu or codec subnode.
  42. - bitclock-master : Indicates dai-link bit clock master.
  43. phandle to a cpu or codec subnode.
  44. - bitclock-inversion : bool property. Add this if the
  45. dai-link uses bit clock inversion.
  46. - frame-inversion : bool property. Add this if the
  47. dai-link uses frame clock inversion.
  48. - mclk-fs : Multiplication factor between stream
  49. rate and codec mclk, applied only for
  50. the dai-link.
  51. For backward compatibility the frame-master and bitclock-master
  52. properties can be used as booleans in codec subnode to indicate if the
  53. codec is the dai-link frame or bit clock master. In this case there
  54. should be no dai-link node, the same properties should not be present
  55. at sound-node level, and the bitclock-inversion and frame-inversion
  56. properties should also be placed in the codec node if needed.
  57. Required CPU/CODEC subnodes properties:
  58. - sound-dai : phandle and port of CPU/CODEC
  59. Optional CPU/CODEC subnodes properties:
  60. - dai-tdm-slot-num : Please refer to tdm-slot.txt.
  61. - dai-tdm-slot-width : Please refer to tdm-slot.txt.
  62. - clocks / system-clock-frequency : specify subnode's clock if needed.
  63. it can be specified via "clocks" if system has
  64. clock node (= common clock), or "system-clock-frequency"
  65. (if system doens't support common clock)
  66. If a clock is specified, it is
  67. enabled with clk_prepare_enable()
  68. in dai startup() and disabled with
  69. clk_disable_unprepare() in dai
  70. shutdown().
  71. If a clock is specified and a
  72. multiplication factor is given with
  73. mclk-fs, the clock will be set to the
  74. calculated mclk frequency when the
  75. stream starts.
  76. - system-clock-direction-out : specifies clock direction as 'out' on
  77. initialization. It is useful for some aCPUs with
  78. fixed clocks.
  79. Example 1 - single DAI link:
  80. sound {
  81. compatible = "simple-audio-card";
  82. simple-audio-card,name = "VF610-Tower-Sound-Card";
  83. simple-audio-card,format = "left_j";
  84. simple-audio-card,bitclock-master = <&dailink0_master>;
  85. simple-audio-card,frame-master = <&dailink0_master>;
  86. simple-audio-card,widgets =
  87. "Microphone", "Microphone Jack",
  88. "Headphone", "Headphone Jack",
  89. "Speaker", "External Speaker";
  90. simple-audio-card,routing =
  91. "MIC_IN", "Microphone Jack",
  92. "Headphone Jack", "HP_OUT",
  93. "External Speaker", "LINE_OUT";
  94. simple-audio-card,cpu {
  95. sound-dai = <&sh_fsi2 0>;
  96. };
  97. dailink0_master: simple-audio-card,codec {
  98. sound-dai = <&ak4648>;
  99. clocks = <&osc>;
  100. };
  101. };
  102. &i2c0 {
  103. ak4648: ak4648@12 {
  104. #sound-dai-cells = <0>;
  105. compatible = "asahi-kasei,ak4648";
  106. reg = <0x12>;
  107. };
  108. };
  109. sh_fsi2: sh_fsi2@ec230000 {
  110. #sound-dai-cells = <1>;
  111. compatible = "renesas,sh_fsi2";
  112. reg = <0xec230000 0x400>;
  113. interrupt-parent = <&gic>;
  114. interrupts = <0 146 0x4>;
  115. };
  116. Example 2 - many DAI links:
  117. sound {
  118. compatible = "simple-audio-card";
  119. simple-audio-card,name = "Cubox Audio";
  120. simple-audio-card,dai-link@0 { /* I2S - HDMI */
  121. reg = <0>;
  122. format = "i2s";
  123. cpu {
  124. sound-dai = <&audio1 0>;
  125. };
  126. codec {
  127. sound-dai = <&tda998x 0>;
  128. };
  129. };
  130. simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */
  131. reg = <1>;
  132. cpu {
  133. sound-dai = <&audio1 1>;
  134. };
  135. codec {
  136. sound-dai = <&tda998x 1>;
  137. };
  138. };
  139. simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */
  140. reg = <2>;
  141. cpu {
  142. sound-dai = <&audio1 1>;
  143. };
  144. codec {
  145. sound-dai = <&spdif_codec>;
  146. };
  147. };
  148. };
  149. Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec
  150. through TPA6130A2 amplifier to headphones:
  151. &i2c0 {
  152. codec: tlv320dac3100@18 {
  153. compatible = "ti,tlv320dac3100";
  154. ...
  155. }
  156. amp: tpa6130a2@60 {
  157. compatible = "ti,tpa6130a2";
  158. ...
  159. }
  160. }
  161. sound {
  162. compatible = "simple-audio-card";
  163. ...
  164. simple-audio-card,widgets =
  165. "Headphone", "Headphone Jack";
  166. simple-audio-card,routing =
  167. "Headphone Jack", "HPLEFT",
  168. "Headphone Jack", "HPRIGHT",
  169. "LEFTIN", "HPL",
  170. "RIGHTIN", "HPR";
  171. simple-audio-card,aux-devs = <&amp>;
  172. simple-audio-card,cpu {
  173. sound-dai = <&ssi2>;
  174. };
  175. simple-audio-card,codec {
  176. sound-dai = <&codec>;
  177. clocks = ...
  178. };
  179. };