xref: /freebsd/sys/contrib/device-tree/Bindings/sound/qcom,q6afe.txt (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1Qualcomm Audio Front End (Q6AFE) binding
2
3AFE is one of the APR audio service on Q6DSP
4Please refer to qcom,apr.txt for details of the common apr service bindings
5used by all apr services. Must contain the following properties.
6
7- compatible:
8	Usage: required
9	Value type: <stringlist>
10	Definition: must be "qcom,q6afe-v<MAJOR-NUMBER>.<MINOR-NUMBER>"
11		  Or "qcom,q6afe" where the version number can be queried
12		  from DSP.
13		  example "qcom,q6afe"
14
15= AFE DAIs (Digial Audio Interface)
16"dais" subnode of the AFE node. It represents afe dais, each afe dai is a
17subnode of "dais" representing board specific dai setup.
18"dais" node should have following properties followed by dai children.
19
20- compatible:
21	Usage: required
22	Value type: <stringlist>
23	Definition: must be "qcom,q6afe-dais"
24
25- #sound-dai-cells
26	Usage: required
27	Value type: <u32>
28	Definition: Must be 1
29
30- #address-cells
31	Usage: required
32	Value type: <u32>
33	Definition: Must be 1
34
35- #size-cells
36	Usage: required
37	Value type: <u32>
38	Definition: Must be 0
39
40== AFE DAI is subnode of "dais" and represent a dai, it includes board specific
41configuration of each dai. Must contain the following properties.
42
43- reg
44	Usage: required
45	Value type: <u32>
46	Definition: Must be dai id
47
48- qcom,sd-lines
49	Usage: required for mi2s interface
50	Value type: <prop-encoded-array>
51	Definition: Must be list of serial data lines used by this dai.
52	should be one or more of the 0-3 sd lines.
53
54 - qcom,tdm-sync-mode:
55	Usage: required for tdm interface
56	Value type: <prop-encoded-array>
57	Definition: Synchronization mode.
58		0 - Short sync bit mode
59		1 - Long sync mode
60		2 - Short sync slot mode
61
62 - qcom,tdm-sync-src:
63	Usage: required for tdm interface
64	Value type: <prop-encoded-array>
65	Definition: Synchronization source.
66		0 - External source
67		1 - Internal source
68
69 - qcom,tdm-data-out:
70	Usage: required for tdm interface
71	Value type: <prop-encoded-array>
72	Definition: Data out signal to drive with other masters.
73		0 - Disable
74		1 - Enable
75
76 - qcom,tdm-invert-sync:
77	Usage: required for tdm interface
78	Value type: <prop-encoded-array>
79	Definition: Invert the sync.
80		0 - Normal
81		1 - Invert
82
83 - qcom,tdm-data-delay:
84	Usage: required for tdm interface
85	Value type: <prop-encoded-array>
86	Definition: Number of bit clock to delay data
87		with respect to sync edge.
88		0 - 0 bit clock cycle
89		1 - 1 bit clock cycle
90		2 - 2 bit clock cycle
91
92 - qcom,tdm-data-align:
93	Usage: required for tdm interface
94	Value type: <prop-encoded-array>
95	Definition: Indicate how data is packed
96		within the slot. For example, 32 slot width in case of
97		sample bit width is 24.
98		0 - MSB
99		1 - LSB
100
101= AFE CLOCKSS
102"clocks" subnode of the AFE node. It represents q6afe clocks
103"clocks" node should have following properties.
104- compatible:
105	Usage: required
106	Value type: <stringlist>
107	Definition: must be "qcom,q6afe-clocks"
108
109- #clock-cells:
110	Usage: required
111	Value type: <u32>
112	Definition: Must be 2. Clock Id followed by
113		below valid clock coupling attributes.
114		1 - for no coupled clock
115		2 - for dividend of the coupled clock
116		3 - for divisor of the coupled clock
117		4 - for inverted and no couple clock
118
119= EXAMPLE
120
121apr-service@4 {
122	compatible = "qcom,q6afe";
123	reg = <APR_SVC_AFE>;
124
125	dais {
126		compatible = "qcom,q6afe-dais";
127		#sound-dai-cells = <1>;
128		#address-cells = <1>;
129		#size-cells = <0>;
130
131		dai@1 {
132			reg = <HDMI_RX>;
133		};
134
135		dai@24 {
136			reg = <PRIMARY_TDM_RX_0>;
137			qcom,tdm-sync-mode = <1>:
138			qcom,tdm-sync-src = <1>;
139			qcom,tdm-data-out = <0>;
140			qcom,tdm-invert-sync = <1>;
141			qcom,tdm-data-delay = <1>;
142			qcom,tdm-data-align = <0>;
143
144		};
145
146		dai@25 {
147			reg = <PRIMARY_TDM_TX_0>;
148			qcom,tdm-sync-mode = <1>:
149			qcom,tdm-sync-src = <1>;
150			qcom,tdm-data-out = <0>;
151			qcom,tdm-invert-sync = <1>;
152			qcom,tdm-data-delay <1>:
153			qcom,tdm-data-align = <0>;
154		};
155
156		dai@16 {
157			reg = <PRIMARY_MI2S_RX>;
158			qcom,sd-lines = <0 2>;
159		};
160
161		dai@17 {
162			reg = <PRIMARY_MI2S_TX>;
163			qcom,sd-lines = <1>;
164		};
165
166		dai@18 {
167			reg = <SECONDARY_MI2S_RX>;
168			qcom,sd-lines = <0 3>;
169		};
170
171		dai@19 {
172			reg = <SECONDARY_MI2S_TX>;
173			qcom,sd-lines = <1>;
174		};
175
176		dai@20 {
177			reg = <TERTIARY_MI2S_RX>;
178			qcom,sd-lines = <1 3>;
179		};
180
181		dai@21 {
182			reg = <TERTIARY_MI2S_TX>;
183			qcom,sd-lines = <0>;
184		};
185
186		dai@22 {
187			reg = <QUATERNARY_MI2S_RX>;
188			qcom,sd-lines = <0>;
189		};
190
191		dai@23 {
192			reg = <QUATERNARY_MI2S_TX>;
193			qcom,sd-lines = <1>;
194		};
195	};
196
197	clocks {
198		compatible = "qcom,q6afe-clocks";
199		#clock-cells = <2>;
200	};
201};
202