simple-card.txt 4.3 KB

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