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