xref: /freebsd/sys/contrib/device-tree/Bindings/sound/qcom,wcd934x.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/qcom,wcd934x.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Qualcomm WCD9340/WCD9341 Audio Codec
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription: |
13c66ec88fSEmmanuel Vadot  Qualcomm WCD9340/WCD9341 Codec is a standalone Hi-Fi audio codec IC.
14c66ec88fSEmmanuel Vadot  It has in-built Soundwire controller, pin controller, interrupt mux and
15c66ec88fSEmmanuel Vadot  supports both I2S/I2C and SLIMbus audio interfaces.
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadotproperties:
18c66ec88fSEmmanuel Vadot  compatible:
19c66ec88fSEmmanuel Vadot    const: slim217,250
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot  reg:
22c66ec88fSEmmanuel Vadot    maxItems: 1
23c66ec88fSEmmanuel Vadot
24c66ec88fSEmmanuel Vadot  interrupts:
25c66ec88fSEmmanuel Vadot    maxItems: 1
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot  reset-gpios:
28c66ec88fSEmmanuel Vadot    description: GPIO spec for reset line to use
29c66ec88fSEmmanuel Vadot    maxItems: 1
30c66ec88fSEmmanuel Vadot
31cb7aa33aSEmmanuel Vadot  slim-ifc-dev:
32cb7aa33aSEmmanuel Vadot    description: IFC device interface
33cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  clocks:
36c66ec88fSEmmanuel Vadot    maxItems: 1
37c66ec88fSEmmanuel Vadot
38c66ec88fSEmmanuel Vadot  clock-names:
39c66ec88fSEmmanuel Vadot    const: extclk
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  vdd-buck-supply:
42c66ec88fSEmmanuel Vadot    description: A reference to the 1.8V buck supply
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  vdd-buck-sido-supply:
45c66ec88fSEmmanuel Vadot    description: A reference to the 1.8V SIDO buck supply
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  vdd-rx-supply:
48c66ec88fSEmmanuel Vadot    description: A reference to the 1.8V rx supply
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot  vdd-tx-supply:
51c66ec88fSEmmanuel Vadot    description: A reference to the 1.8V tx supply
52c66ec88fSEmmanuel Vadot
53c66ec88fSEmmanuel Vadot  vdd-vbat-supply:
54c66ec88fSEmmanuel Vadot    description: A reference to the vbat supply
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadot  vdd-io-supply:
57c66ec88fSEmmanuel Vadot    description: A reference to the 1.8V I/O supply
58c66ec88fSEmmanuel Vadot
59c66ec88fSEmmanuel Vadot  vdd-micbias-supply:
60c66ec88fSEmmanuel Vadot    description: A reference to the micbias supply
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot  qcom,micbias1-microvolt:
63c66ec88fSEmmanuel Vadot    description: micbias1 voltage
64c66ec88fSEmmanuel Vadot    minimum: 1800000
65c66ec88fSEmmanuel Vadot    maximum: 2850000
66c66ec88fSEmmanuel Vadot
67c66ec88fSEmmanuel Vadot  qcom,micbias2-microvolt:
68c66ec88fSEmmanuel Vadot    description: micbias2 voltage
69c66ec88fSEmmanuel Vadot    minimum: 1800000
70c66ec88fSEmmanuel Vadot    maximum: 2850000
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  qcom,micbias3-microvolt:
73c66ec88fSEmmanuel Vadot    description: micbias3 voltage
74c66ec88fSEmmanuel Vadot    minimum: 1800000
75c66ec88fSEmmanuel Vadot    maximum: 2850000
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot  qcom,micbias4-microvolt:
78c66ec88fSEmmanuel Vadot    description: micbias4 voltage
79c66ec88fSEmmanuel Vadot    minimum: 1800000
80c66ec88fSEmmanuel Vadot    maximum: 2850000
81c66ec88fSEmmanuel Vadot
825956d97fSEmmanuel Vadot  qcom,hphl-jack-type-normally-closed:
835956d97fSEmmanuel Vadot    description: Indicates that HPHL jack switch type is normally closed
845956d97fSEmmanuel Vadot    type: boolean
855956d97fSEmmanuel Vadot
865956d97fSEmmanuel Vadot  qcom,ground-jack-type-normally-closed:
875956d97fSEmmanuel Vadot    description: Indicates that Headset Ground switch type is normally closed
885956d97fSEmmanuel Vadot    type: boolean
895956d97fSEmmanuel Vadot
905956d97fSEmmanuel Vadot  qcom,mbhc-headset-vthreshold-microvolt:
915956d97fSEmmanuel Vadot    description: Voltage threshold value for headset detection
925956d97fSEmmanuel Vadot    minimum: 0
935956d97fSEmmanuel Vadot    maximum: 2850000
945956d97fSEmmanuel Vadot
955956d97fSEmmanuel Vadot  qcom,mbhc-headphone-vthreshold-microvolt:
965956d97fSEmmanuel Vadot    description: Voltage threshold value for headphone detection
975956d97fSEmmanuel Vadot    minimum: 0
985956d97fSEmmanuel Vadot    maximum: 2850000
995956d97fSEmmanuel Vadot
1005956d97fSEmmanuel Vadot  qcom,mbhc-buttons-vthreshold-microvolt:
1015956d97fSEmmanuel Vadot    description:
1025956d97fSEmmanuel Vadot      Array of 8 Voltage threshold values corresponding to headset
1035956d97fSEmmanuel Vadot      button0 - button7
1045956d97fSEmmanuel Vadot    minItems: 8
1055956d97fSEmmanuel Vadot    maxItems: 8
1065956d97fSEmmanuel Vadot
107c66ec88fSEmmanuel Vadot  clock-output-names:
108c66ec88fSEmmanuel Vadot    const: mclk
109c66ec88fSEmmanuel Vadot
110c66ec88fSEmmanuel Vadot  clock-frequency:
111c66ec88fSEmmanuel Vadot    description: Clock frequency of output clk in Hz
112c66ec88fSEmmanuel Vadot
113c66ec88fSEmmanuel Vadot  interrupt-controller: true
114c66ec88fSEmmanuel Vadot
115c66ec88fSEmmanuel Vadot  '#interrupt-cells':
116c66ec88fSEmmanuel Vadot    const: 1
117c66ec88fSEmmanuel Vadot
118c66ec88fSEmmanuel Vadot  '#clock-cells':
119c66ec88fSEmmanuel Vadot    const: 0
120c66ec88fSEmmanuel Vadot
121c66ec88fSEmmanuel Vadot  '#sound-dai-cells':
122c66ec88fSEmmanuel Vadot    const: 1
123c66ec88fSEmmanuel Vadot
124c66ec88fSEmmanuel Vadot  "#address-cells":
125c66ec88fSEmmanuel Vadot    const: 1
126c66ec88fSEmmanuel Vadot
127c66ec88fSEmmanuel Vadot  "#size-cells":
128c66ec88fSEmmanuel Vadot    const: 1
129c66ec88fSEmmanuel Vadot
130c66ec88fSEmmanuel Vadot  gpio@42:
131c66ec88fSEmmanuel Vadot    type: object
132b97ee269SEmmanuel Vadot    $ref: /schemas/gpio/qcom,wcd934x-gpio.yaml#
133c66ec88fSEmmanuel Vadot
134c66ec88fSEmmanuel VadotpatternProperties:
135c66ec88fSEmmanuel Vadot  "^.*@[0-9a-f]+$":
136c66ec88fSEmmanuel Vadot    type: object
137*fac71e4eSEmmanuel Vadot    additionalProperties: true
138c66ec88fSEmmanuel Vadot    description: |
139c66ec88fSEmmanuel Vadot      WCD934x subnode for each slave devices. Bindings of each subnodes
140c66ec88fSEmmanuel Vadot      depends on the specific driver providing the functionality and
141c66ec88fSEmmanuel Vadot      documented in their respective bindings.
142c66ec88fSEmmanuel Vadot
143c66ec88fSEmmanuel Vadot    properties:
144c66ec88fSEmmanuel Vadot      reg:
145c66ec88fSEmmanuel Vadot        maxItems: 1
146c66ec88fSEmmanuel Vadot
147c66ec88fSEmmanuel Vadot    required:
148c66ec88fSEmmanuel Vadot      - reg
149c66ec88fSEmmanuel Vadot
150c66ec88fSEmmanuel Vadotrequired:
151c66ec88fSEmmanuel Vadot  - compatible
152c66ec88fSEmmanuel Vadot  - reg
153cb7aa33aSEmmanuel Vadot
154cb7aa33aSEmmanuel VadotallOf:
155*fac71e4eSEmmanuel Vadot  - $ref: dai-common.yaml#
156cb7aa33aSEmmanuel Vadot  - if:
157cb7aa33aSEmmanuel Vadot      required:
158cb7aa33aSEmmanuel Vadot        - slim-ifc-dev
159cb7aa33aSEmmanuel Vadot    then:
160cb7aa33aSEmmanuel Vadot      required:
161c66ec88fSEmmanuel Vadot        - reset-gpios
162c66ec88fSEmmanuel Vadot        - slim-ifc-dev
163c66ec88fSEmmanuel Vadot        - interrupt-controller
164c66ec88fSEmmanuel Vadot        - clock-frequency
165c66ec88fSEmmanuel Vadot        - clock-output-names
166c66ec88fSEmmanuel Vadot        - qcom,micbias1-microvolt
167c66ec88fSEmmanuel Vadot        - qcom,micbias2-microvolt
168c66ec88fSEmmanuel Vadot        - qcom,micbias3-microvolt
169c66ec88fSEmmanuel Vadot        - qcom,micbias4-microvolt
170c66ec88fSEmmanuel Vadot        - "#interrupt-cells"
171c66ec88fSEmmanuel Vadot        - "#clock-cells"
172c66ec88fSEmmanuel Vadot        - "#sound-dai-cells"
173c66ec88fSEmmanuel Vadot        - "#address-cells"
174c66ec88fSEmmanuel Vadot        - "#size-cells"
175cb7aa33aSEmmanuel Vadot      oneOf:
176cb7aa33aSEmmanuel Vadot        - required:
177cb7aa33aSEmmanuel Vadot            - interrupts-extended
178cb7aa33aSEmmanuel Vadot        - required:
179cb7aa33aSEmmanuel Vadot            - interrupts
180cb7aa33aSEmmanuel Vadot    else:
181cb7aa33aSEmmanuel Vadot      properties:
182cb7aa33aSEmmanuel Vadot        reset-gpios: false
183cb7aa33aSEmmanuel Vadot        slim-ifc-dev: false
184cb7aa33aSEmmanuel Vadot        interrupts: false
185cb7aa33aSEmmanuel Vadot        interrupt-controller: false
186cb7aa33aSEmmanuel Vadot        clock-frequency: false
187cb7aa33aSEmmanuel Vadot        clock-output-names: false
188cb7aa33aSEmmanuel Vadot        qcom,micbias1-microvolt: false
189cb7aa33aSEmmanuel Vadot        qcom,micbias2-microvolt: false
190cb7aa33aSEmmanuel Vadot        qcom,micbias3-microvolt: false
191cb7aa33aSEmmanuel Vadot        qcom,micbias4-microvolt: false
192cb7aa33aSEmmanuel Vadot        "#interrupt-cells": false
193cb7aa33aSEmmanuel Vadot        "#clock-cells": false
194cb7aa33aSEmmanuel Vadot        "#sound-dai-cells": false
195cb7aa33aSEmmanuel Vadot        "#address-cells": false
196cb7aa33aSEmmanuel Vadot        "#size-cells": false
197c66ec88fSEmmanuel Vadot
198c66ec88fSEmmanuel VadotadditionalProperties: false
199c66ec88fSEmmanuel Vadot
200c66ec88fSEmmanuel Vadotexamples:
201c66ec88fSEmmanuel Vadot  - |
202c66ec88fSEmmanuel Vadot    codec@1,0{
203c66ec88fSEmmanuel Vadot        compatible = "slim217,250";
204c66ec88fSEmmanuel Vadot        reg = <1 0>;
205c66ec88fSEmmanuel Vadot        reset-gpios = <&tlmm 64 0>;
206c66ec88fSEmmanuel Vadot        slim-ifc-dev = <&wcd9340_ifd>;
207c66ec88fSEmmanuel Vadot        #sound-dai-cells = <1>;
208c66ec88fSEmmanuel Vadot        interrupt-parent = <&tlmm>;
209c66ec88fSEmmanuel Vadot        interrupts = <54 4>;
210c66ec88fSEmmanuel Vadot        interrupt-controller;
211c66ec88fSEmmanuel Vadot        #interrupt-cells = <1>;
212c66ec88fSEmmanuel Vadot        #clock-cells = <0>;
213c66ec88fSEmmanuel Vadot        clock-frequency = <9600000>;
214c66ec88fSEmmanuel Vadot        clock-output-names = "mclk";
215c66ec88fSEmmanuel Vadot        qcom,micbias1-microvolt = <1800000>;
216c66ec88fSEmmanuel Vadot        qcom,micbias2-microvolt = <1800000>;
217c66ec88fSEmmanuel Vadot        qcom,micbias3-microvolt = <1800000>;
218c66ec88fSEmmanuel Vadot        qcom,micbias4-microvolt = <1800000>;
2195956d97fSEmmanuel Vadot        qcom,hphl-jack-type-normally-closed;
2205956d97fSEmmanuel Vadot        qcom,ground-jack-type-normally-closed;
2215956d97fSEmmanuel Vadot        qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>;
2225956d97fSEmmanuel Vadot        qcom,mbhc-headset-vthreshold-microvolt = <1700000>;
2235956d97fSEmmanuel Vadot        qcom,mbhc-headphone-vthreshold-microvolt = <50000>;
224c66ec88fSEmmanuel Vadot        clock-names = "extclk";
225c66ec88fSEmmanuel Vadot        clocks = <&rpmhcc 2>;
226c66ec88fSEmmanuel Vadot
227c66ec88fSEmmanuel Vadot        #address-cells = <1>;
228c66ec88fSEmmanuel Vadot        #size-cells = <1>;
229c66ec88fSEmmanuel Vadot
230c66ec88fSEmmanuel Vadot        gpio@42 {
231c66ec88fSEmmanuel Vadot            compatible = "qcom,wcd9340-gpio";
232c66ec88fSEmmanuel Vadot            reg = <0x42 0x2>;
233c66ec88fSEmmanuel Vadot            gpio-controller;
234c66ec88fSEmmanuel Vadot            #gpio-cells = <2>;
235c66ec88fSEmmanuel Vadot        };
236c66ec88fSEmmanuel Vadot    };
237c66ec88fSEmmanuel Vadot
238c66ec88fSEmmanuel Vadot...
239