xref: /freebsd/sys/contrib/device-tree/Bindings/soundwire/qcom,soundwire.yaml (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/soundwire/qcom,soundwire.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm SoundWire Controller
8
9maintainers:
10  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11  - Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
12
13description:
14  The Qualcomm SoundWire controller along with its board specific bus parameters.
15
16properties:
17  compatible:
18    enum:
19      - qcom,soundwire-v1.3.0
20      - qcom,soundwire-v1.5.0
21      - qcom,soundwire-v1.5.1
22      - qcom,soundwire-v1.6.0
23      - qcom,soundwire-v1.7.0
24      - qcom,soundwire-v2.0.0
25
26  reg:
27    maxItems: 1
28
29  interrupts:
30    minItems: 1
31    items:
32      - description: specify the SoundWire controller core.
33      - description: specify the Soundwire controller wake IRQ.
34
35  interrupt-names:
36    minItems: 1
37    items:
38      - const: core
39      - const: wakeup
40
41  clocks:
42    items:
43      - description: iface clock
44
45  clock-names:
46    items:
47      - const: iface
48
49  resets:
50    items:
51      - description: SWR_AUDIO_CGCR RESET
52
53  reset-names:
54    items:
55      - const: swr_audio_cgcr
56
57  '#sound-dai-cells':
58    const: 1
59
60  '#address-cells':
61    const: 2
62
63  '#size-cells':
64    const: 0
65
66  wakeup-source: true
67
68  qcom,din-ports:
69    $ref: /schemas/types.yaml#/definitions/uint32
70    description: count of data in ports
71
72  qcom,dout-ports:
73    $ref: /schemas/types.yaml#/definitions/uint32
74    description: count of data out ports
75
76  qcom,ports-word-length:
77    $ref: /schemas/types.yaml#/definitions/uint8-array
78    description:
79      Size of payload channel sample.
80      Value of 0xff indicates that this option is not implemented
81      or applicable for the respective data port.
82      More info in MIPI Alliance SoundWire 1.0 Specifications.
83    minItems: 3
84    maxItems: 16
85
86  qcom,ports-sinterval-low:
87    $ref: /schemas/types.yaml#/definitions/uint8-array
88    description:
89      Sample interval (only lowest byte) of each data port.
90      Out ports followed by In ports. Used for Sample Interval calculation.
91      Value of 0xff indicates that this option is not implemented
92      or applicable for the respective data port.
93      More info in MIPI Alliance SoundWire 1.0 Specifications.
94    minItems: 3
95    maxItems: 16
96
97  qcom,ports-sinterval:
98    $ref: /schemas/types.yaml#/definitions/uint16-array
99    description:
100      Sample interval of each data port.
101      Out ports followed by In ports. Used for Sample Interval calculation.
102      Value of 0xffff indicates that this option is not implemented
103      or applicable for the respective data port.
104      More info in MIPI Alliance SoundWire 1.0 Specifications.
105    minItems: 3
106    maxItems: 16
107
108  qcom,ports-offset1:
109    $ref: /schemas/types.yaml#/definitions/uint8-array
110    description:
111      Payload transport window offset1 of each data port.
112      Out ports followed by In ports.
113      Value of 0xff indicates that this option is not implemented
114      or applicable for the respective data port.
115      More info in MIPI Alliance SoundWire 1.0 Specifications.
116    minItems: 3
117    maxItems: 16
118
119  qcom,ports-offset2:
120    $ref: /schemas/types.yaml#/definitions/uint8-array
121    description:
122      Payload transport window offset2 of each data port.
123      Out ports followed by In ports.
124      Value of 0xff indicates that this option is not implemented
125      or applicable for the respective data port.
126      More info in MIPI Alliance SoundWire 1.0 Specifications.
127    minItems: 3
128    maxItems: 16
129
130  qcom,ports-lane-control:
131    $ref: /schemas/types.yaml#/definitions/uint8-array
132    description:
133      Identify which data lane the data port uses.
134      Out ports followed by In ports.
135      Value of 0xff indicates that this option is not implemented
136      or applicable for the respective data port.
137      More info in MIPI Alliance SoundWire 1.0 Specifications.
138    minItems: 3
139    maxItems: 16
140
141  qcom,ports-block-pack-mode:
142    $ref: /schemas/types.yaml#/definitions/uint8-array
143    description:
144      Indicate the block packing mode.
145      0 to indicate Blocks are per Channel
146      1 to indicate Blocks are per Port.
147      Out ports followed by In ports.
148      Value of 0xff indicates that this option is not implemented
149      or applicable for the respective data port.
150      More info in MIPI Alliance SoundWire 1.0 Specifications.
151    minItems: 3
152    maxItems: 16
153    items:
154      oneOf:
155        - minimum: 0
156          maximum: 1
157        - const: 0xff
158
159  qcom,ports-hstart:
160    $ref: /schemas/types.yaml#/definitions/uint8-array
161    description:
162      Identifying lowerst numbered column in SoundWire Frame,
163      i.e. left edge of the Transport sub-frame for each port.
164      Out ports followed by In ports.
165      Value of 0xff indicates that this option is not implemented
166      or applicable for the respective data port.
167      More info in MIPI Alliance SoundWire 1.0 Specifications.
168    minItems: 3
169    maxItems: 16
170    items:
171      oneOf:
172        - minimum: 0
173          maximum: 15
174        - const: 0xff
175
176  qcom,ports-hstop:
177    $ref: /schemas/types.yaml#/definitions/uint8-array
178    description:
179      Identifying highest numbered column in SoundWire Frame,
180      i.e. the right edge of the Transport
181      sub-frame for each port. Out ports followed by In ports.
182      Value of 0xff indicates that this option is not implemented
183      or applicable for the respective data port.
184      More info in MIPI Alliance SoundWire 1.0 Specifications.
185    minItems: 3
186    maxItems: 16
187    items:
188      oneOf:
189        - minimum: 0
190          maximum: 15
191        - const: 0xff
192
193  qcom,ports-block-group-count:
194    $ref: /schemas/types.yaml#/definitions/uint8-array
195    description:
196      In range 1 to 4 to indicate how many sample intervals are combined
197      into a payload. Out ports followed by In ports.
198      Value of 0xff indicates that this option is not implemented
199      or applicable for the respective data port.
200      More info in MIPI Alliance SoundWire 1.0 Specifications.
201    minItems: 3
202    maxItems: 16
203    items:
204      oneOf:
205        - minimum: 0
206          maximum: 4
207        - const: 0xff
208
209  label:
210    maxItems: 1
211
212required:
213  - compatible
214  - reg
215  - interrupts
216  - clocks
217  - clock-names
218  - '#sound-dai-cells'
219  - '#address-cells'
220  - '#size-cells'
221  - qcom,dout-ports
222  - qcom,din-ports
223  - qcom,ports-offset1
224  - qcom,ports-offset2
225
226oneOf:
227  - required:
228      - qcom,ports-sinterval-low
229  - required:
230      - qcom,ports-sinterval
231
232allOf:
233  - $ref: soundwire-controller.yaml#
234
235unevaluatedProperties: false
236
237examples:
238  - |
239    #include <dt-bindings/interrupt-controller/arm-gic.h>
240    #include <dt-bindings/interrupt-controller/irq.h>
241    #include <dt-bindings/clock/qcom,lpassaudiocc-sc7280.h>
242
243    soundwire@3210000 {
244        compatible = "qcom,soundwire-v1.6.0";
245        reg = <0x03210000 0x2000>;
246
247        interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
248                     <&pdc 130 IRQ_TYPE_LEVEL_HIGH>;
249
250        interrupt-names = "core", "wakeup";
251
252        clocks = <&lpass_rx_macro>;
253        clock-names = "iface";
254
255        qcom,din-ports = <0>;
256        qcom,dout-ports = <5>;
257
258        resets = <&lpass_audiocc LPASS_AUDIO_SWR_RX_CGCR>;
259        reset-names = "swr_audio_cgcr";
260
261        qcom,ports-word-length =        /bits/ 8 <0x01 0x07 0x04 0xff 0xff>;
262        qcom,ports-sinterval-low =      /bits/ 8 <0x03 0x3f 0x1f 0x03 0x03>;
263        qcom,ports-offset1 =            /bits/ 8 <0x00 0x00 0x0b 0x01 0x01>;
264        qcom,ports-offset2 =            /bits/ 8 <0x00 0x00 0x0b 0x00 0x00>;
265        qcom,ports-lane-control =       /bits/ 8 <0x01 0x00 0x00 0x00 0x00>;
266        qcom,ports-block-pack-mode =    /bits/ 8 <0xff 0x00 0x01 0xff 0xff>;
267        qcom,ports-hstart =             /bits/ 8 <0xff 0x03 0xff 0xff 0xff>;
268        qcom,ports-hstop =              /bits/ 8 <0xff 0x06 0xff 0xff 0xff>;
269        qcom,ports-block-group-count =  /bits/ 8 <0xff 0xff 0xff 0xff 0x00>;
270
271        #sound-dai-cells = <1>;
272        #address-cells = <2>;
273        #size-cells = <0>;
274
275        codec@0,4 {
276            compatible = "sdw20217010d00";
277            reg = <0 4>;
278            qcom,rx-port-mapping = <1 2 3 4 5>;
279        };
280    };
281