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