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,wcd9335.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm WCD9335 Audio Codec
8
9maintainers:
10  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11
12description:
13  Qualcomm WCD9335 Codec is a standalone Hi-Fi audio codec IC with in-built
14  Soundwire controller and interrupt mux. It supports both I2S/I2C and SLIMbus
15  audio interfaces.
16
17properties:
18  compatible:
19    const: slim217,1a0
20
21  reg:
22    maxItems: 1
23
24  clocks:
25    maxItems: 2
26
27  clock-names:
28    items:
29      - const: mclk
30      - const: slimbus
31
32  interrupts:
33    maxItems: 2
34
35  interrupt-names:
36    items:
37      - const: intr1
38      - const: intr2
39
40  interrupt-controller: true
41
42  '#interrupt-cells':
43    const: 1
44
45  reset-gpios:
46    maxItems: 1
47
48  slim-ifc-dev:
49    description: SLIM IFC device interface
50    $ref: /schemas/types.yaml#/definitions/phandle
51
52  '#sound-dai-cells':
53    const: 1
54
55  vdd-buck-supply:
56    description: 1.8V buck supply
57
58  vdd-buck-sido-supply:
59    description: 1.8V SIDO buck supply
60
61  vdd-io-supply:
62    description: 1.8V I/O supply
63
64  vdd-micbias-supply:
65    description: micbias supply
66
67  vdd-rx-supply:
68    description: 1.8V rx supply
69
70  vdd-tx-supply:
71    description: 1.8V tx supply
72
73  vdd-vbat-supply:
74    description: vbat supply
75
76required:
77  - compatible
78  - reg
79
80allOf:
81  - $ref: dai-common.yaml#
82  - if:
83      required:
84        - slim-ifc-dev
85    then:
86      required:
87        - clocks
88        - clock-names
89        - interrupts
90        - interrupt-names
91        - interrupt-controller
92        - '#interrupt-cells'
93        - reset-gpios
94        - slim-ifc-dev
95        - '#sound-dai-cells'
96        - vdd-buck-supply
97        - vdd-buck-sido-supply
98        - vdd-io-supply
99        - vdd-rx-supply
100        - vdd-tx-supply
101    else:
102      properties:
103        clocks: false
104        clock-names: false
105        interrupts: false
106        interrupt-names: false
107        interrupt-controller: false
108        '#interrupt-cells': false
109        reset-gpios: false
110        slim-ifc-dev: false
111        '#sound-dai-cells': false
112        vdd-buck-supply: false
113        vdd-buck-sido-supply: false
114        vdd-io-supply: false
115        vdd-micbias-supply: false
116        vdd-rx-supply: false
117        vdd-tx-supply: false
118        vdd-vbat-supply: false
119
120additionalProperties: false
121
122examples:
123  - |
124    #include <dt-bindings/clock/qcom,rpmcc.h>
125    #include <dt-bindings/gpio/gpio.h>
126    #include <dt-bindings/interrupt-controller/irq.h>
127
128    tasha_ifd: codec@0,0 {
129        compatible = "slim217,1a0";
130        reg = <0 0>;
131    };
132
133    codec@1,0 {
134        compatible = "slim217,1a0";
135        reg = <1 0>;
136
137        clock-names = "mclk", "slimbus";
138        clocks = <&div1_mclk>, <&rpmcc RPM_SMD_BB_CLK1>;
139
140        interrupt-parent = <&tlmm>;
141        interrupts = <54 IRQ_TYPE_LEVEL_HIGH>,
142                     <53 IRQ_TYPE_LEVEL_HIGH>;
143        interrupt-names = "intr1", "intr2";
144        interrupt-controller;
145        #interrupt-cells = <1>;
146
147        reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
148        slim-ifc-dev = <&tasha_ifd>;
149        #sound-dai-cells = <1>;
150
151        vdd-buck-supply = <&vreg_s4a_1p8>;
152        vdd-buck-sido-supply = <&vreg_s4a_1p8>;
153        vdd-tx-supply = <&vreg_s4a_1p8>;
154        vdd-rx-supply = <&vreg_s4a_1p8>;
155        vdd-io-supply = <&vreg_s4a_1p8>;
156    };
157