summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml
blob: beb0ff0245b0ab84477b282243d9ce43c633c078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/qcom,wcd934x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm WCD9340/WCD9341 Audio Codec

maintainers:
  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

description: |
  Qualcomm WCD9340/WCD9341 Codec is a standalone Hi-Fi audio codec IC.
  It has in-built Soundwire controller, pin controller, interrupt mux and
  supports both I2S/I2C and SLIMbus audio interfaces.

properties:
  compatible:
    const: slim217,250

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  reset-gpios:
    description: GPIO spec for reset line to use
    maxItems: 1

  slim-ifc-dev:
    description: IFC device interface
    $ref: /schemas/types.yaml#/definitions/phandle

  clocks:
    maxItems: 1

  clock-names:
    const: extclk

  vdd-buck-supply:
    description: A reference to the 1.8V buck supply

  vdd-buck-sido-supply:
    description: A reference to the 1.8V SIDO buck supply

  vdd-rx-supply:
    description: A reference to the 1.8V rx supply

  vdd-tx-supply:
    description: A reference to the 1.8V tx supply

  vdd-vbat-supply:
    description: A reference to the vbat supply

  vdd-io-supply:
    description: A reference to the 1.8V I/O supply

  vdd-micbias-supply:
    description: A reference to the micbias supply

  qcom,micbias1-microvolt:
    description: micbias1 voltage
    minimum: 1800000
    maximum: 2850000

  qcom,micbias2-microvolt:
    description: micbias2 voltage
    minimum: 1800000
    maximum: 2850000

  qcom,micbias3-microvolt:
    description: micbias3 voltage
    minimum: 1800000
    maximum: 2850000

  qcom,micbias4-microvolt:
    description: micbias4 voltage
    minimum: 1800000
    maximum: 2850000

  qcom,hphl-jack-type-normally-closed:
    description: Indicates that HPHL jack switch type is normally closed
    type: boolean

  qcom,ground-jack-type-normally-closed:
    description: Indicates that Headset Ground switch type is normally closed
    type: boolean

  qcom,mbhc-headset-vthreshold-microvolt:
    description: Voltage threshold value for headset detection
    minimum: 0
    maximum: 2850000

  qcom,mbhc-headphone-vthreshold-microvolt:
    description: Voltage threshold value for headphone detection
    minimum: 0
    maximum: 2850000

  qcom,mbhc-buttons-vthreshold-microvolt:
    description:
      Array of 8 Voltage threshold values corresponding to headset
      button0 - button7
    minItems: 8
    maxItems: 8

  clock-output-names:
    const: mclk

  clock-frequency:
    description: Clock frequency of output clk in Hz

  interrupt-controller: true

  '#interrupt-cells':
    const: 1

  '#clock-cells':
    const: 0

  '#sound-dai-cells':
    const: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  gpio@42:
    type: object
    $ref: /schemas/gpio/qcom,wcd934x-gpio.yaml#

patternProperties:
  "^.*@[0-9a-f]+$":
    type: object
    additionalProperties: true
    description: |
      WCD934x subnode for each slave devices. Bindings of each subnodes
      depends on the specific driver providing the functionality and
      documented in their respective bindings.

    properties:
      reg:
        maxItems: 1

    required:
      - reg

required:
  - compatible
  - reg

allOf:
  - $ref: dai-common.yaml#
  - if:
      required:
        - slim-ifc-dev
    then:
      required:
        - reset-gpios
        - slim-ifc-dev
        - interrupt-controller
        - clock-frequency
        - clock-output-names
        - qcom,micbias1-microvolt
        - qcom,micbias2-microvolt
        - qcom,micbias3-microvolt
        - qcom,micbias4-microvolt
        - "#interrupt-cells"
        - "#clock-cells"
        - "#sound-dai-cells"
        - "#address-cells"
        - "#size-cells"
      oneOf:
        - required:
            - interrupts-extended
        - required:
            - interrupts
    else:
      properties:
        reset-gpios: false
        slim-ifc-dev: false
        interrupts: false
        interrupt-controller: false
        clock-frequency: false
        clock-output-names: false
        qcom,micbias1-microvolt: false
        qcom,micbias2-microvolt: false
        qcom,micbias3-microvolt: false
        qcom,micbias4-microvolt: false
        "#interrupt-cells": false
        "#clock-cells": false
        "#sound-dai-cells": false
        "#address-cells": false
        "#size-cells": false

additionalProperties: false

examples:
  - |
    codec@1,0{
        compatible = "slim217,250";
        reg = <1 0>;
        reset-gpios = <&tlmm 64 0>;
        slim-ifc-dev = <&wcd9340_ifd>;
        #sound-dai-cells = <1>;
        interrupt-parent = <&tlmm>;
        interrupts = <54 4>;
        interrupt-controller;
        #interrupt-cells = <1>;
        #clock-cells = <0>;
        clock-frequency = <9600000>;
        clock-output-names = "mclk";
        qcom,micbias1-microvolt = <1800000>;
        qcom,micbias2-microvolt = <1800000>;
        qcom,micbias3-microvolt = <1800000>;
        qcom,micbias4-microvolt = <1800000>;
        qcom,hphl-jack-type-normally-closed;
        qcom,ground-jack-type-normally-closed;
        qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>;
        qcom,mbhc-headset-vthreshold-microvolt = <1700000>;
        qcom,mbhc-headphone-vthreshold-microvolt = <50000>;
        clock-names = "extclk";
        clocks = <&rpmhcc 2>;

        #address-cells = <1>;
        #size-cells = <1>;

        gpio@42 {
            compatible = "qcom,wcd9340-gpio";
            reg = <0x42 0x2>;
            gpio-controller;
            #gpio-cells = <2>;
        };
    };

...