xref: /freebsd/sys/contrib/device-tree/Bindings/sound/qcom,q6dsp-lpass-ports.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/sound/qcom,q6dsp-lpass-ports.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: Qualcomm DSP LPASS(Low Power Audio SubSystem) Audio Ports binding
8
9maintainers:
10  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11
12description: |
13  This binding describes the Qualcomm DSP LPASS Audio ports
14
15properties:
16  compatible:
17    enum:
18      - qcom,q6afe-dais
19      - qcom,q6apm-lpass-dais
20
21  '#sound-dai-cells':
22    const: 1
23
24  '#address-cells':
25    const: 1
26
27  '#size-cells':
28    const: 0
29
30#Digital Audio Interfaces
31patternProperties:
32  '^dai@[0-9]+$':
33    type: object
34    description:
35      Q6DSP Digital Audio Interfaces.
36
37    properties:
38      reg:
39        description:
40          Digital Audio Interface ID
41
42      qcom,sd-lines:
43        $ref: /schemas/types.yaml#/definitions/uint32-array
44        description:
45          List of serial data lines used by this dai.should be one or more of the 0-3 sd lines.
46        minItems: 1
47        maxItems: 4
48        uniqueItems: true
49        items:
50          minimum: 0
51          maximum: 3
52
53      qcom,tdm-sync-mode:
54        $ref: /schemas/types.yaml#/definitions/uint32
55        enum: [0, 1, 2]
56        description:
57          TDM 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        $ref: /schemas/types.yaml#/definitions/uint32
64        enum: [0, 1]
65        description:
66          TDM Synchronization source
67            0 = External source
68            1 = Internal source
69
70      qcom,tdm-data-out:
71        $ref: /schemas/types.yaml#/definitions/uint32
72        enum: [0, 1]
73        description:
74          TDM Data out signal to drive with other masters
75            0 = Disable
76            1 = Enable
77
78      qcom,tdm-invert-sync:
79        $ref: /schemas/types.yaml#/definitions/uint32
80        enum: [0, 1]
81        description:
82          TDM Invert the sync
83            0 = Normal
84            1 = Invert
85
86      qcom,tdm-data-delay:
87        $ref: /schemas/types.yaml#/definitions/uint32
88        enum: [0, 1, 2]
89        description:
90          TDM Number of bit clock to delay data
91            0 = 0 bit clock cycle
92            1 = 1 bit clock cycle
93            2 = 2 bit clock cycle
94
95      qcom,tdm-data-align:
96        $ref: /schemas/types.yaml#/definitions/uint32
97        enum: [0, 1]
98        description:
99          Indicate how data is packed within the slot. For example, 32 slot
100          width in case of sample bit width is 24TDM Invert the sync.
101            0 = MSB
102            1 = LSB
103
104    required:
105      - reg
106
107    allOf:
108      - if:
109          properties:
110            reg:
111              contains:
112                # TDM DAI ID range from PRIMARY_TDM_RX_0 - QUINARY_TDM_TX_7
113                items:
114                  minimum: 24
115                  maximum: 103
116        then:
117          required:
118            - qcom,tdm-sync-mode
119            - qcom,tdm-sync-src
120            - qcom,tdm-data-out
121            - qcom,tdm-invert-sync
122            - qcom,tdm-data-delay
123            - qcom,tdm-data-align
124
125      - if:
126          properties:
127            reg:
128              contains:
129                # MI2S DAI ID range PRIMARY_MI2S_RX - QUATERNARY_MI2S_TX and
130                # QUINARY_MI2S_RX - QUINARY_MI2S_TX
131                items:
132                  oneOf:
133                    - minimum: 16
134                      maximum: 23
135                    - minimum: 127
136                      maximum: 128
137        then:
138          required:
139            - qcom,sd-lines
140
141    additionalProperties: false
142
143required:
144  - compatible
145  - "#sound-dai-cells"
146  - "#address-cells"
147  - "#size-cells"
148
149additionalProperties: false
150
151examples:
152  - |
153    #include <dt-bindings/soc/qcom,apr.h>
154    #include <dt-bindings/sound/qcom,q6afe.h>
155    apr {
156        compatible = "qcom,apr-v2";
157        #address-cells = <1>;
158        #size-cells = <0>;
159        qcom,domain = <APR_DOMAIN_ADSP>;
160
161        service@4 {
162            compatible = "qcom,q6afe";
163            reg = <APR_SVC_AFE>;
164            qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
165
166            dais {
167                compatible = "qcom,q6afe-dais";
168                #address-cells = <1>;
169                #size-cells = <0>;
170                #sound-dai-cells = <1>;
171
172                dai@22 {
173                    reg = <QUATERNARY_MI2S_RX>;
174                    qcom,sd-lines = <0 1 2 3>;
175                };
176            };
177        };
178    };
179  - |
180    #include <dt-bindings/soc/qcom,gpr.h>
181    gpr {
182        compatible = "qcom,gpr";
183        #address-cells = <1>;
184        #size-cells = <0>;
185        qcom,domain = <GPR_DOMAIN_ID_ADSP>;
186
187        service@1 {
188            compatible = "qcom,q6apm";
189            reg = <GPR_APM_MODULE_IID>;
190
191            dais {
192                compatible = "qcom,q6apm-lpass-dais";
193                #address-cells = <1>;
194                #size-cells = <0>;
195                #sound-dai-cells = <1>;
196
197                dai@22 {
198                    reg = <QUATERNARY_MI2S_RX>;
199                    qcom,sd-lines = <0 1 2 3>;
200                };
201            };
202        };
203    };
204