simple-card.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. Optional subnodes:
  21. - simple-audio-card,dai-link : Container for dai-link level
  22. properties and the CPU and CODEC
  23. sub-nodes. This container may be
  24. omitted when the card has only one
  25. DAI link. See the examples and the
  26. section bellow.
  27. Dai-link subnode properties and subnodes:
  28. If dai-link subnode is omitted and the subnode properties are directly
  29. under "sound"-node the subnode property and subnode names have to be
  30. prefixed with "simple-audio-card,"-prefix.
  31. Required dai-link subnodes:
  32. - cpu : CPU sub-node
  33. - codec : CODEC sub-node
  34. Optional dai-link subnode properties:
  35. - format : CPU/CODEC common audio format.
  36. "i2s", "right_j", "left_j" , "dsp_a"
  37. "dsp_b", "ac97", "pdm", "msb", "lsb"
  38. - frame-master : Indicates dai-link frame master.
  39. phandle to a cpu or codec subnode.
  40. - bitclock-master : Indicates dai-link bit clock master.
  41. phandle to a cpu or codec subnode.
  42. - bitclock-inversion : bool property. Add this if the
  43. dai-link uses bit clock inversion.
  44. - frame-inversion : bool property. Add this if the
  45. dai-link uses frame clock inversion.
  46. - mclk-fs : Multiplication factor between stream
  47. rate and codec mclk, applied only for
  48. the dai-link.
  49. For backward compatibility the frame-master and bitclock-master
  50. properties can be used as booleans in codec subnode to indicate if the
  51. codec is the dai-link frame or bit clock master. In this case there
  52. should be no dai-link node, the same properties should not be present
  53. at sound-node level, and the bitclock-inversion and frame-inversion
  54. properties should also be placed in the codec node if needed.
  55. Required CPU/CODEC subnodes properties:
  56. - sound-dai : phandle and port of CPU/CODEC
  57. Optional CPU/CODEC subnodes properties:
  58. - dai-tdm-slot-num : Please refer to tdm-slot.txt.
  59. - dai-tdm-slot-width : Please refer to tdm-slot.txt.
  60. - clocks / system-clock-frequency : specify subnode's clock if needed.
  61. it can be specified via "clocks" if system has
  62. clock node (= common clock), or "system-clock-frequency"
  63. (if system doens't support common clock)
  64. If a clock is specified, it is
  65. enabled with clk_prepare_enable()
  66. in dai startup() and disabled with
  67. clk_disable_unprepare() in dai
  68. shutdown().
  69. Example 1 - single DAI link:
  70. sound {
  71. compatible = "simple-audio-card";
  72. simple-audio-card,name = "VF610-Tower-Sound-Card";
  73. simple-audio-card,format = "left_j";
  74. simple-audio-card,bitclock-master = <&dailink0_master>;
  75. simple-audio-card,frame-master = <&dailink0_master>;
  76. simple-audio-card,widgets =
  77. "Microphone", "Microphone Jack",
  78. "Headphone", "Headphone Jack",
  79. "Speaker", "External Speaker";
  80. simple-audio-card,routing =
  81. "MIC_IN", "Microphone Jack",
  82. "Headphone Jack", "HP_OUT",
  83. "External Speaker", "LINE_OUT";
  84. simple-audio-card,cpu {
  85. sound-dai = <&sh_fsi2 0>;
  86. };
  87. dailink0_master: simple-audio-card,codec {
  88. sound-dai = <&ak4648>;
  89. clocks = <&osc>;
  90. };
  91. };
  92. &i2c0 {
  93. ak4648: ak4648@12 {
  94. #sound-dai-cells = <0>;
  95. compatible = "asahi-kasei,ak4648";
  96. reg = <0x12>;
  97. };
  98. };
  99. sh_fsi2: sh_fsi2@ec230000 {
  100. #sound-dai-cells = <1>;
  101. compatible = "renesas,sh_fsi2";
  102. reg = <0xec230000 0x400>;
  103. interrupt-parent = <&gic>;
  104. interrupts = <0 146 0x4>;
  105. };
  106. Example 2 - many DAI links:
  107. sound {
  108. compatible = "simple-audio-card";
  109. simple-audio-card,name = "Cubox Audio";
  110. simple-audio-card,dai-link@0 { /* I2S - HDMI */
  111. format = "i2s";
  112. cpu {
  113. sound-dai = <&audio1 0>;
  114. };
  115. codec {
  116. sound-dai = <&tda998x 0>;
  117. };
  118. };
  119. simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */
  120. cpu {
  121. sound-dai = <&audio1 1>;
  122. };
  123. codec {
  124. sound-dai = <&tda998x 1>;
  125. };
  126. };
  127. simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */
  128. cpu {
  129. sound-dai = <&audio1 1>;
  130. };
  131. codec {
  132. sound-dai = <&spdif_codec>;
  133. };
  134. };
  135. };