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