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 |
| 19 | mclk. |
Dylan Reid | 872bbb3 | 2014-10-03 10:06:08 -0700 | [diff] [blame] | 20 | - simple-audio-card,hp-det-gpio : Reference to GPIO that signals when |
Dylan Reid | 3fe2403 | 2014-10-01 14:25:20 -0700 | [diff] [blame] | 21 | headphones are attached. |
Dylan Reid | 872bbb3 | 2014-10-03 10:06:08 -0700 | [diff] [blame] | 22 | - simple-audio-card,mic-det-gpio : Reference to GPIO that signals when |
Dylan Reid | 3fe2403 | 2014-10-01 14:25:20 -0700 | [diff] [blame] | 23 | a microphone is attached. |
Andrew Lunn | 2942a0e | 2014-05-22 17:31:49 +0200 | [diff] [blame] | 24 | |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 25 | Optional subnodes: |
Xiubo Li | d4c2209 | 2013-12-23 12:57:01 +0800 | [diff] [blame] | 26 | |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 27 | - simple-audio-card,dai-link : Container for dai-link level |
| 28 | properties and the CPU and CODEC |
| 29 | sub-nodes. This container may be |
| 30 | omitted when the card has only one |
| 31 | DAI link. See the examples and the |
| 32 | section bellow. |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 33 | |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 34 | Dai-link subnode properties and subnodes: |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 35 | |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 36 | If dai-link subnode is omitted and the subnode properties are directly |
| 37 | under "sound"-node the subnode property and subnode names have to be |
| 38 | prefixed with "simple-audio-card,"-prefix. |
| 39 | |
| 40 | Required dai-link subnodes: |
| 41 | |
| 42 | - cpu : CPU sub-node |
| 43 | - codec : CODEC sub-node |
| 44 | |
| 45 | Optional dai-link subnode properties: |
| 46 | |
| 47 | - format : CPU/CODEC common audio format. |
| 48 | "i2s", "right_j", "left_j" , "dsp_a" |
| 49 | "dsp_b", "ac97", "pdm", "msb", "lsb" |
| 50 | - frame-master : Indicates dai-link frame master. |
| 51 | phandle to a cpu or codec subnode. |
| 52 | - bitclock-master : Indicates dai-link bit clock master. |
| 53 | phandle to a cpu or codec subnode. |
| 54 | - bitclock-inversion : bool property. Add this if the |
| 55 | dai-link uses bit clock inversion. |
| 56 | - frame-inversion : bool property. Add this if the |
| 57 | dai-link uses frame clock inversion. |
| 58 | |
| 59 | For backward compatibility the frame-master and bitclock-master |
| 60 | properties can be used as booleans in codec subnode to indicate if the |
| 61 | codec is the dai-link frame or bit clock master. In this case there |
| 62 | should be no dai-link node, the same properties should not be present |
| 63 | at sound-node level, and the bitclock-inversion and frame-inversion |
| 64 | properties should also be placed in the codec node if needed. |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 65 | |
| 66 | Required CPU/CODEC subnodes properties: |
| 67 | |
| 68 | - sound-dai : phandle and port of CPU/CODEC |
| 69 | |
| 70 | Optional CPU/CODEC subnodes properties: |
| 71 | |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 72 | - dai-tdm-slot-num : Please refer to tdm-slot.txt. |
| 73 | - dai-tdm-slot-width : Please refer to tdm-slot.txt. |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 74 | - clocks / system-clock-frequency : specify subnode's clock if needed. |
| 75 | it can be specified via "clocks" if system has |
| 76 | clock node (= common clock), or "system-clock-frequency" |
| 77 | (if system doens't support common clock) |
Jyri Sarha | f991180 | 2015-01-13 21:16:34 +0200 | [diff] [blame^] | 78 | If a clock is specified, it is |
| 79 | enabled with clk_prepare_enable() |
| 80 | in dai startup() and disabled with |
| 81 | clk_disable_unprepare() in dai |
| 82 | shutdown(). |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 83 | |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 84 | Example 1 - single DAI link: |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 85 | |
| 86 | sound { |
| 87 | compatible = "simple-audio-card"; |
Xiubo Li | 6684134 | 2014-02-08 15:59:55 +0800 | [diff] [blame] | 88 | simple-audio-card,name = "VF610-Tower-Sound-Card"; |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 89 | simple-audio-card,format = "left_j"; |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 90 | simple-audio-card,bitclock-master = <&dailink0_master>; |
| 91 | simple-audio-card,frame-master = <&dailink0_master>; |
Xiubo Li | 6684134 | 2014-02-08 15:59:55 +0800 | [diff] [blame] | 92 | simple-audio-card,widgets = |
| 93 | "Microphone", "Microphone Jack", |
| 94 | "Headphone", "Headphone Jack", |
| 95 | "Speaker", "External Speaker"; |
Xiubo Li | bb651b3 | 2014-01-10 13:17:27 +0800 | [diff] [blame] | 96 | simple-audio-card,routing = |
Xiubo Li | 6684134 | 2014-02-08 15:59:55 +0800 | [diff] [blame] | 97 | "MIC_IN", "Microphone Jack", |
Xiubo Li | d4c2209 | 2013-12-23 12:57:01 +0800 | [diff] [blame] | 98 | "Headphone Jack", "HP_OUT", |
Xiubo Li | 6684134 | 2014-02-08 15:59:55 +0800 | [diff] [blame] | 99 | "External Speaker", "LINE_OUT"; |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 100 | |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 101 | simple-audio-card,cpu { |
| 102 | sound-dai = <&sh_fsi2 0>; |
| 103 | }; |
| 104 | |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 105 | dailink0_master: simple-audio-card,codec { |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 106 | sound-dai = <&ak4648>; |
Kuninori Morimoto | fa558c2 | 2013-11-20 15:25:02 +0900 | [diff] [blame] | 107 | clocks = <&osc>; |
| 108 | }; |
| 109 | }; |
| 110 | |
| 111 | &i2c0 { |
| 112 | ak4648: ak4648@12 { |
| 113 | #sound-dai-cells = <0>; |
| 114 | compatible = "asahi-kasei,ak4648"; |
| 115 | reg = <0x12>; |
| 116 | }; |
| 117 | }; |
| 118 | |
| 119 | sh_fsi2: sh_fsi2@ec230000 { |
| 120 | #sound-dai-cells = <1>; |
| 121 | compatible = "renesas,sh_fsi2"; |
| 122 | reg = <0xec230000 0x400>; |
| 123 | interrupt-parent = <&gic>; |
| 124 | interrupts = <0 146 0x4>; |
| 125 | }; |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 126 | |
| 127 | Example 2 - many DAI links: |
| 128 | |
| 129 | sound { |
| 130 | compatible = "simple-audio-card"; |
| 131 | simple-audio-card,name = "Cubox Audio"; |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 132 | |
| 133 | simple-audio-card,dai-link@0 { /* I2S - HDMI */ |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 134 | format = "i2s"; |
| 135 | cpu { |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 136 | sound-dai = <&audio1 0>; |
| 137 | }; |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 138 | codec { |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 139 | sound-dai = <&tda998x 0>; |
| 140 | }; |
| 141 | }; |
| 142 | |
| 143 | simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */ |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 144 | cpu { |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 145 | sound-dai = <&audio1 1>; |
| 146 | }; |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 147 | codec { |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 148 | sound-dai = <&tda998x 1>; |
| 149 | }; |
| 150 | }; |
| 151 | |
| 152 | simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */ |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 153 | cpu { |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 154 | sound-dai = <&audio1 1>; |
| 155 | }; |
Jyri Sarha | b3ca11f | 2014-03-24 12:15:25 +0200 | [diff] [blame] | 156 | codec { |
Jean-Francois Moine | 015f630 | 2014-03-20 11:04:16 +0100 | [diff] [blame] | 157 | sound-dai = <&spdif_codec>; |
| 158 | }; |
| 159 | }; |
| 160 | }; |