Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/cirrus,cs42l43.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cirrus Logic CS42L43 Audio CODEC
8
9maintainers:
10 - patches@opensource.cirrus.com
11
12description: |
13 The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
14 (Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
15 for portable applications. It provides a high dynamic range, stereo
16 DAC for headphone output, two integrated Class D amplifiers for
17 loudspeakers, and two ADCs for wired headset microphone input or
18 stereo line input. PDM inputs are provided for digital microphones.
19 CS42L43B variant adds dedicated PDM interface, SoundWire Clock Gearing
20 support and more decimators to ISRCs.
21
22allOf:
23 - $ref: dai-common.yaml#
24
25properties:
26 compatible:
27 enum:
28 - cirrus,cs42l43
29 - cirrus,cs42l43b
30
31 reg:
32 maxItems: 1
33
34 vdd-p-supply:
35 description:
36 Power supply for the high voltage interface.
37
38 vdd-a-supply:
39 description:
40 Power supply for internal analog circuits.
41
42 vdd-d-supply:
43 description:
44 Power supply for internal digital circuits. Can be internally supplied.
45
46 vdd-io-supply:
47 description:
48 Power supply for external interface and internal digital logic.
49
50 vdd-cp-supply:
51 description:
52 Power supply for the amplifier 3 and 4 charge pump.
53
54 vdd-amp-supply:
55 description:
56 Power supply for amplifier 1 and 2.
57
58 reset-gpios:
59 maxItems: 1
60
61 interrupt-controller: true
62
63 "#interrupt-cells":
64 const: 2
65
66 interrupts:
67 maxItems: 1
68
69 "#sound-dai-cells":
70 const: 1
71
72 clocks:
73 items:
74 - description: Synchronous audio clock provided on mclk_in.
75
76 clock-names:
77 const: mclk
78
79 cirrus,bias-low:
80 type: boolean
81 description:
82 Select a 1.8V headset micbias rather than 2.8V.
83
84 cirrus,bias-sense-microamp:
85 description:
86 Current at which the headset micbias sense clamp will engage, 0 to
87 disable.
88 enum: [ 0, 14, 24, 43, 52, 61, 71, 90, 99 ]
89 default: 14
90
91 cirrus,bias-ramp-ms:
92 description:
93 Time in milliseconds the hardware allows for the headset micbias to
94 ramp up.
95 enum: [ 10, 40, 90, 170 ]
96 default: 170
97
98 cirrus,detect-us:
99 description:
100 Time in microseconds the type detection will run for. Long values will
101 cause more audible effects, but give more accurate detection.
102 enum: [ 20, 100, 1000, 10000, 50000, 75000, 100000, 200000 ]
103 default: 1000
104
105 cirrus,button-automute:
106 type: boolean
107 description:
108 Enable the hardware automuting of decimator 1 when a headset button is
109 pressed.
110
111 cirrus,buttons-ohms:
112 description:
113 Impedance in Ohms for each headset button, these should be listed in
114 ascending order.
115 minItems: 1
116 maxItems: 6
117
118 cirrus,tip-debounce-ms:
119 description:
120 Software debounce on tip sense triggering in milliseconds.
121 default: 0
122
123 cirrus,tip-invert:
124 type: boolean
125 description:
126 Indicates tip detect polarity, inverted implies open-circuit whilst the
127 jack is inserted.
128
129 cirrus,tip-disable-pullup:
130 type: boolean
131 description:
132 Indicates if the internal pullup on the tip detect should be disabled.
133
134 cirrus,tip-fall-db-ms:
135 description:
136 Time in milliseconds a falling edge on the tip detect should be hardware
137 debounced for. Note the falling edge is considered after the invert.
138 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
139 default: 500
140
141 cirrus,tip-rise-db-ms:
142 description:
143 Time in milliseconds a rising edge on the tip detect should be hardware
144 debounced for. Note the rising edge is considered after the invert.
145 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
146 default: 500
147
148 cirrus,use-ring-sense:
149 type: boolean
150 description:
151 Indicates if the ring sense should be used.
152
153 cirrus,ring-invert:
154 type: boolean
155 description:
156 Indicates ring detect polarity, inverted implies open-circuit whilst the
157 jack is inserted.
158
159 cirrus,ring-disable-pullup:
160 type: boolean
161 description:
162 Indicates if the internal pullup on the ring detect should be disabled.
163
164 cirrus,ring-fall-db-ms:
165 description:
166 Time in milliseconds a falling edge on the ring detect should be hardware
167 debounced for. Note the falling edge is considered after the invert.
168 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
169 default: 500
170
171 cirrus,ring-rise-db-ms:
172 description:
173 Time in milliseconds a rising edge on the ring detect should be hardware
174 debounced for. Note the rising edge is considered after the invert.
175 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
176 default: 500
177
178 pinctrl:
179 type: object
180 $ref: /schemas/pinctrl/pinctrl.yaml#
181 additionalProperties: false
182
183 properties:
184 gpio-controller: true
185
186 "#gpio-cells":
187 const: 2
188
189 gpio-ranges:
190 items:
191 - items:
192 - description: A phandle to the CODEC pinctrl node
193 minimum: 0
194 - const: 0
195 - const: 0
196 - const: 3
197
198 patternProperties:
199 "-state$":
200 oneOf:
201 - $ref: "#/$defs/cirrus-cs42l43-state"
202 - patternProperties:
203 "-pins$":
204 $ref: "#/$defs/cirrus-cs42l43-state"
205 additionalProperties: false
206
207 spi:
208 type: object
209 $ref: /schemas/spi/spi-controller.yaml#
210 unevaluatedProperties: false
211
212$defs:
213 cirrus-cs42l43-state:
214 type: object
215
216 allOf:
217 - $ref: /schemas/pinctrl/pincfg-node.yaml#
218 - $ref: /schemas/pinctrl/pinmux-node.yaml#
219
220 oneOf:
221 - required: [ groups ]
222 - required: [ pins ]
223
224 additionalProperties: false
225
226 properties:
227 groups:
228 enum: [ gpio1, gpio2, gpio3, asp, pdmout2, pdmout1, i2c, spi ]
229
230 pins:
231 enum: [ gpio1, gpio2, gpio3,
232 asp_dout, asp_fsync, asp_bclk,
233 pdmout2_clk, pdmout2_data, pdmout1_clk, pdmout1_data,
234 i2c_sda, i2c_scl,
235 spi_miso, spi_sck, spi_ssb ]
236
237 function:
238 enum: [ gpio, spdif, irq, mic-shutter, spk-shutter ]
239
240 drive-strength:
241 description: Set drive strength in mA
242 enum: [ 1, 2, 4, 8, 9, 10, 12, 16 ]
243
244 input-debounce:
245 description: Set input debounce in uS
246 enum: [ 0, 85 ]
247
248required:
249 - compatible
250 - reg
251 - vdd-p-supply
252 - vdd-a-supply
253 - vdd-io-supply
254 - vdd-cp-supply
255
256additionalProperties: false
257
258examples:
259 - |
260 #include <dt-bindings/interrupt-controller/irq.h>
261
262 i2c {
263 #address-cells = <1>;
264 #size-cells = <0>;
265
266 cs42l43: codec@1a {
267 compatible = "cirrus,cs42l43";
268 reg = <0x1a>;
269
270 vdd-p-supply = <&vdd5v0>;
271 vdd-a-supply = <&vdd1v8>;
272 vdd-io-supply = <&vdd1v8>;
273 vdd-cp-supply = <&vdd1v8>;
274 vdd-amp-supply = <&vdd5v0>;
275
276 reset-gpios = <&gpio 0>;
277
278 interrupt-controller;
279 #interrupt-cells = <2>;
280 interrupt-parent = <&gpio>;
281 interrupts = <56 IRQ_TYPE_LEVEL_LOW>;
282
283 #sound-dai-cells = <1>;
284
285 clocks = <&clks 0>;
286 clock-names = "mclk";
287
288 cs42l43_pins: pinctrl {
289 gpio-controller;
290 #gpio-cells = <2>;
291 gpio-ranges = <&cs42l43_pins 0 0 3>;
292
293 pinctrl-names = "default";
294 pinctrl-0 = <&pinsettings>;
295
296 pinsettings: default-state {
297 shutter-pins {
298 groups = "gpio3";
299 function = "mic-shutter";
300 };
301 };
302 };
303
304 spi {
305 #address-cells = <1>;
306 #size-cells = <0>;
307
308 cs-gpios = <&cs42l43_pins 1 0>;
309
310 sensor@0 {
311 compatible = "bosch,bme680";
312 reg = <0>;
313 spi-max-frequency = <1400000>;
314 };
315 };
316 };
317 };