1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/qcom,lpass-cpu.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm Technologies Inc. LPASS CPU dai driver bindings
8
9maintainers:
10  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11  - Rohit kumar <rohitkr@codeaurora.org>
12
13description: |
14  Qualcomm Technologies Inc. SOC Low-Power Audio SubSystem (LPASS) that consist
15  of MI2S interface for audio data transfer on external codecs. LPASS cpu driver
16  is a module to configure Low-Power Audio Interface(LPAIF) core registers
17  across different IP versions.
18
19properties:
20  compatible:
21    enum:
22      - qcom,lpass-cpu
23      - qcom,apq8016-lpass-cpu
24      - qcom,sc7180-lpass-cpu
25
26  reg:
27    maxItems: 2
28    description: LPAIF core registers
29
30  reg-names:
31    maxItems: 2
32
33  clocks:
34    minItems: 3
35    maxItems: 6
36
37  clock-names:
38    minItems: 3
39    maxItems: 6
40
41  interrupts:
42    maxItems: 2
43    description: LPAIF DMA buffer interrupt
44
45  interrupt-names:
46    maxItems: 2
47
48  qcom,adsp:
49    $ref: /schemas/types.yaml#/definitions/phandle
50    description: Phandle for the audio DSP node
51
52  iommus:
53    maxItems: 2
54    description: Phandle to apps_smmu node with sid mask
55
56  power-domains:
57    maxItems: 1
58
59  '#sound-dai-cells':
60    const: 1
61
62  '#address-cells':
63    const: 1
64
65  '#size-cells':
66    const: 0
67
68patternProperties:
69  "^dai-link@[0-9a-f]$":
70    type: object
71    description: |
72      LPASS CPU dai node for each I2S device. Bindings of each node
73      depends on the specific driver providing the functionality and
74      properties.
75    properties:
76      reg:
77        maxItems: 1
78        description: Must be one of the DAI ID
79
80      qcom,playback-sd-lines:
81        $ref: /schemas/types.yaml#/definitions/uint32-array
82        description: list of MI2S data lines for playback
83
84      qcom,capture-sd-lines:
85        $ref: /schemas/types.yaml#/definitions/uint32-array
86        description: list of MI2S data lines for capture
87
88    required:
89      - reg
90
91    additionalProperties: false
92
93required:
94  - compatible
95  - reg
96  - reg-names
97  - clocks
98  - clock-names
99  - interrupts
100  - interrupt-names
101  - '#sound-dai-cells'
102
103additionalProperties: false
104
105allOf:
106  - if:
107      properties:
108        compatible:
109          contains:
110            const: qcom,lpass-cpu
111
112    then:
113      properties:
114        clock-names:
115          items:
116            - const: ahbix-clk
117            - const: mi2s-osr-clk
118            - const: mi2s-bit-clk
119
120  - if:
121      properties:
122        compatible:
123          contains:
124            const: qcom,apq8016-lpass-cpu
125
126    then:
127      properties:
128        clock-names:
129          items:
130            - const: ahbix-clk
131            - const: mi2s-bit-clk0
132            - const: mi2s-bit-clk1
133            - const: mi2s-bit-clk2
134            - const: mi2s-bit-clk3
135            - const: pcnoc-mport-clk
136            - const: pcnoc-sway-clk
137
138  - if:
139      properties:
140        compatible:
141          contains:
142            const: qcom,sc7180-lpass-cpu
143
144    then:
145      properties:
146        clock-names:
147          oneOf:
148            - items:   #for I2S
149                - const: pcnoc-sway-clk
150                - const: audio-core
151                - const: mclk0
152                - const: pcnoc-mport-clk
153                - const: mi2s-bit-clk0
154                - const: mi2s-bit-clk1
155            - items:   #for HDMI
156                - const: pcnoc-sway-clk
157                - const: audio-core
158                - const: pcnoc-mport-clk
159        reg-names:
160          anyOf:
161            - items:   #for I2S
162                - const: lpass-lpaif
163            - items:   #for I2S and HDMI
164                - const: lpass-hdmiif
165                - const: lpass-lpaif
166        interrupt-names:
167          anyOf:
168            - items:   #for I2S
169                - const: lpass-irq-lpaif
170            - items:   #for I2S and HDMI
171                - const: lpass-irq-lpaif
172                - const: lpass-irq-hdmi
173      required:
174        - iommus
175        - power-domains
176
177examples:
178  - |
179    #include <dt-bindings/sound/sc7180-lpass.h>
180
181    soc {
182        #address-cells = <2>;
183        #size-cells = <2>;
184        lpass@62d80000 {
185            compatible = "qcom,sc7180-lpass-cpu";
186
187            reg = <0 0x62d87000 0 0x68000>,
188                  <0 0x62f00000 0 0x29000>;
189            reg-names = "lpass-hdmiif",
190                        "lpass-lpaif";
191            iommus = <&apps_smmu 0x1020 0>,
192                     <&apps_smmu 0x1032 0>;
193            power-domains = <&lpass_hm 0>;
194
195            clocks = <&gcc 131>,
196                 <&lpasscorecc 6>,
197                 <&lpasscorecc 7>,
198                 <&lpasscorecc 10>,
199                 <&lpasscorecc 8>,
200                 <&lpasscorecc 9>;
201
202            clock-names = "pcnoc-sway-clk", "audio-core",
203                          "mclk0", "pcnoc-mport-clk",
204                          "mi2s-bit-clk0", "mi2s-bit-clk1";
205
206            interrupts = <0 160 1>,
207                         <0 268 1>;
208            interrupt-names = "lpass-irq-lpaif",
209                              "lpass-irq-hdmi";
210            #sound-dai-cells = <1>;
211
212            #address-cells = <1>;
213            #size-cells = <0>;
214            /* Optional to set different MI2S SD lines */
215            dai-link@0 {
216                reg = <MI2S_PRIMARY>;
217                qcom,playback-sd-lines = <1>;
218                qcom,capture-sd-lines = <0>;
219            };
220        };
221    };
222
223...
224