blob: cf3979eb357809052b187cc27364eefd877e968b [file] [log] [blame]
Kuninori Morimotofa558c22013-11-20 15:25:02 +09001Simple-Card:
2
Jyri Sarhab3ca11f2014-03-24 12:15:25 +02003Simple-Card specifies audio DAI connections of SoC <-> codec.
Kuninori Morimotofa558c22013-11-20 15:25:02 +09004
5Required properties:
6
7- compatible : "simple-audio-card"
8
9Optional properties:
10
Xiubo Li66841342014-02-08 15:59:55 +080011- simple-audio-card,name : User specified audio sound card name, one string
12 property.
Xiubo Li66841342014-02-08 15:59:55 +080013- simple-audio-card,widgets : Please refer to widgets.txt.
Xiubo Li8c0b8232014-01-07 09:15:16 +080014- simple-audio-card,routing : A list of the connections between audio components.
Xiubo Lid4c22092013-12-23 12:57:01 +080015 Each entry is a pair of strings, the first being the
16 connection's sink, the second being the connection's
17 source.
Andrew Lunn2942a0e2014-05-22 17:31:49 +020018- simple-audio-card,mclk-fs : Multiplication factor between stream rate and codec
Arnaud Pouliquen85a4bfd2015-06-05 10:19:05 +020019 mclk. When defined, mclk-fs property defined in
20 dai-link sub nodes are ignored.
Dylan Reid872bbb32014-10-03 10:06:08 -070021- simple-audio-card,hp-det-gpio : Reference to GPIO that signals when
Dylan Reid3fe24032014-10-01 14:25:20 -070022 headphones are attached.
Dylan Reid872bbb32014-10-03 10:06:08 -070023- simple-audio-card,mic-det-gpio : Reference to GPIO that signals when
Dylan Reid3fe24032014-10-01 14:25:20 -070024 a microphone is attached.
Andrew Lunn2942a0e2014-05-22 17:31:49 +020025
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020026Optional subnodes:
Xiubo Lid4c22092013-12-23 12:57:01 +080027
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020028- simple-audio-card,dai-link : Container for dai-link level
29 properties and the CPU and CODEC
30 sub-nodes. This container may be
31 omitted when the card has only one
32 DAI link. See the examples and the
33 section bellow.
Kuninori Morimotofa558c22013-11-20 15:25:02 +090034
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020035Dai-link subnode properties and subnodes:
Jean-Francois Moine015f6302014-03-20 11:04:16 +010036
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020037If dai-link subnode is omitted and the subnode properties are directly
38under "sound"-node the subnode property and subnode names have to be
39prefixed with "simple-audio-card,"-prefix.
40
41Required dai-link subnodes:
42
43- cpu : CPU sub-node
44- codec : CODEC sub-node
45
46Optional dai-link subnode properties:
47
48- format : CPU/CODEC common audio format.
49 "i2s", "right_j", "left_j" , "dsp_a"
50 "dsp_b", "ac97", "pdm", "msb", "lsb"
51- frame-master : Indicates dai-link frame master.
52 phandle to a cpu or codec subnode.
53- bitclock-master : Indicates dai-link bit clock master.
54 phandle to a cpu or codec subnode.
55- bitclock-inversion : bool property. Add this if the
56 dai-link uses bit clock inversion.
57- frame-inversion : bool property. Add this if the
58 dai-link uses frame clock inversion.
Arnaud Pouliquen85a4bfd2015-06-05 10:19:05 +020059- mclk-fs : Multiplication factor between stream
60 rate and codec mclk, applied only for
61 the dai-link.
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020062
63For backward compatibility the frame-master and bitclock-master
64properties can be used as booleans in codec subnode to indicate if the
65codec is the dai-link frame or bit clock master. In this case there
66should be no dai-link node, the same properties should not be present
67at sound-node level, and the bitclock-inversion and frame-inversion
68properties should also be placed in the codec node if needed.
Kuninori Morimotofa558c22013-11-20 15:25:02 +090069
70Required CPU/CODEC subnodes properties:
71
72- sound-dai : phandle and port of CPU/CODEC
73
74Optional CPU/CODEC subnodes properties:
75
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020076- dai-tdm-slot-num : Please refer to tdm-slot.txt.
77- dai-tdm-slot-width : Please refer to tdm-slot.txt.
Kuninori Morimotofa558c22013-11-20 15:25:02 +090078- clocks / system-clock-frequency : specify subnode's clock if needed.
79 it can be specified via "clocks" if system has
80 clock node (= common clock), or "system-clock-frequency"
81 (if system doens't support common clock)
Jyri Sarhaf9911802015-01-13 21:16:34 +020082 If a clock is specified, it is
83 enabled with clk_prepare_enable()
84 in dai startup() and disabled with
85 clk_disable_unprepare() in dai
86 shutdown().
Kuninori Morimotofa558c22013-11-20 15:25:02 +090087
Jean-Francois Moine015f6302014-03-20 11:04:16 +010088Example 1 - single DAI link:
Kuninori Morimotofa558c22013-11-20 15:25:02 +090089
90sound {
91 compatible = "simple-audio-card";
Xiubo Li66841342014-02-08 15:59:55 +080092 simple-audio-card,name = "VF610-Tower-Sound-Card";
Kuninori Morimotofa558c22013-11-20 15:25:02 +090093 simple-audio-card,format = "left_j";
Jyri Sarhab3ca11f2014-03-24 12:15:25 +020094 simple-audio-card,bitclock-master = <&dailink0_master>;
95 simple-audio-card,frame-master = <&dailink0_master>;
Xiubo Li66841342014-02-08 15:59:55 +080096 simple-audio-card,widgets =
97 "Microphone", "Microphone Jack",
98 "Headphone", "Headphone Jack",
99 "Speaker", "External Speaker";
Xiubo Libb651b32014-01-10 13:17:27 +0800100 simple-audio-card,routing =
Xiubo Li66841342014-02-08 15:59:55 +0800101 "MIC_IN", "Microphone Jack",
Xiubo Lid4c22092013-12-23 12:57:01 +0800102 "Headphone Jack", "HP_OUT",
Xiubo Li66841342014-02-08 15:59:55 +0800103 "External Speaker", "LINE_OUT";
Kuninori Morimotofa558c22013-11-20 15:25:02 +0900104
Kuninori Morimotofa558c22013-11-20 15:25:02 +0900105 simple-audio-card,cpu {
106 sound-dai = <&sh_fsi2 0>;
107 };
108
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200109 dailink0_master: simple-audio-card,codec {
Kuninori Morimotofa558c22013-11-20 15:25:02 +0900110 sound-dai = <&ak4648>;
Kuninori Morimotofa558c22013-11-20 15:25:02 +0900111 clocks = <&osc>;
112 };
113};
114
115&i2c0 {
116 ak4648: ak4648@12 {
117 #sound-dai-cells = <0>;
118 compatible = "asahi-kasei,ak4648";
119 reg = <0x12>;
120 };
121};
122
123sh_fsi2: sh_fsi2@ec230000 {
124 #sound-dai-cells = <1>;
125 compatible = "renesas,sh_fsi2";
126 reg = <0xec230000 0x400>;
127 interrupt-parent = <&gic>;
128 interrupts = <0 146 0x4>;
129};
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100130
131Example 2 - many DAI links:
132
133sound {
134 compatible = "simple-audio-card";
135 simple-audio-card,name = "Cubox Audio";
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100136
137 simple-audio-card,dai-link@0 { /* I2S - HDMI */
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200138 format = "i2s";
139 cpu {
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100140 sound-dai = <&audio1 0>;
141 };
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200142 codec {
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100143 sound-dai = <&tda998x 0>;
144 };
145 };
146
147 simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200148 cpu {
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100149 sound-dai = <&audio1 1>;
150 };
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200151 codec {
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100152 sound-dai = <&tda998x 1>;
153 };
154 };
155
156 simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200157 cpu {
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100158 sound-dai = <&audio1 1>;
159 };
Jyri Sarhab3ca11f2014-03-24 12:15:25 +0200160 codec {
Jean-Francois Moine015f6302014-03-20 11:04:16 +0100161 sound-dai = <&spdif_codec>;
162 };
163 };
164};