1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
4 $id: http://devicetree.org/schemas/sound/cirrus,cs42l42.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: Cirrus Logic CS42L42 audio CODEC
10 - patches@opensource.cirrus.com
13 The CS42L42 is a low-power audio codec designed for portable applications.
14 It provides a high-dynamic range, stereo DAC for audio playback and a mono
15 high-dynamic-range ADC for audio capture. There is an integrated headset
26 The I2C address of the CS42L42.
35 Charge pump power supply.
51 This pin will be asserted and then deasserted to reset the
52 CS42L42 before communication starts.
57 Interrupt for CS42L42 IRQ line.
62 Sets the behaviour of the jack plug detect switch.
64 0 - (Default) Shorted to tip when unplugged, open when plugged.
65 This is "inverted tip sense (ITS)" in the datasheet.
67 1 - Open when unplugged, shorted to tip when plugged.
68 This is "normal tip sense (TS)" in the datasheet.
70 The CS42L42_TS_INV_* defines are available for this.
71 $ref: /schemas/types.yaml#/definitions/uint32
77 Debounce the rising edge of TIP_SENSE_PLUG. With no
78 debounce, the tip sense pin might be noisy on a plug event.
89 The CS42L42_TS_DBNCE_* defines are available for this.
90 $ref: /schemas/types.yaml#/definitions/uint32
96 Debounce the falling edge of TIP_SENSE_UNPLUG. With no
97 debounce, the tip sense pin might be noisy on an unplug event.
108 The CS42L42_TS_DBNCE_* defines are available for this.
109 $ref: /schemas/types.yaml#/definitions/uint32
113 cirrus,btn-det-init-dbnce:
115 This sets how long to wait after enabling button detection
116 interrupts before servicing button interrupts, to allow the
117 HS bias time to settle. Value is in milliseconds.
118 There may be erroneous button interrupts if this debounce time
123 $ref: /schemas/types.yaml#/definitions/uint32
127 cirrus,btn-det-event-dbnce:
129 This sets how long to wait after receiving a button press
130 interrupt before processing it. Allows time for the button
131 press to make a clean connection with the bias resistors.
132 Value is in milliseconds.
136 $ref: /schemas/types.yaml#/definitions/uint32
142 For a level-detect headset button scheme, each button will bias
143 the mic pin to a certain voltage. To determine which button was
144 pressed, the voltage is compared to sequential, decreasing
145 voltages, until the compared voltage < bias voltage.
146 For different hardware setups, a designer might want to tweak this.
147 This is an array of descending values for the comparator voltage,
148 given as percent of the HSBIAS voltage.
150 Array of 4 values, each 0-63
152 Default = < 15 8 4 1 >
153 $ref: /schemas/types.yaml#/definitions/uint32-array
160 cirrus,hs-bias-ramp-rate:
162 If present this sets the rate that the HS bias should rise and fall.
163 The actual rise and fall times depend on external hardware (the
164 datasheet gives several rise and fall time examples).
166 0 - Fast rise time; slow, load-dependent fall time
171 The CS42L42_HSBIAS_RAMP_* defines are available for this.
172 $ref: /schemas/types.yaml#/definitions/uint32
176 cirrus,hs-bias-sense-disable:
178 If present the HSBIAS sense is disabled. Configures HSBIAS output
179 current sense through the external 2.21-k resistor. HSBIAS_SENSE
180 is a hardware feature to reduce the potential pop noise when the
181 headset plug is removed slowly. But on some platforms ESD voltage
182 will affect it causing plug detection to fail, especially with CTIA
183 headset type. For different hardware setups, a designer might want
184 to tweak default behavior.
196 additionalProperties: false
200 #include <dt-bindings/sound/cs42l42.h>
202 #address-cells = <1>;
205 cs42l42: cs42l42@48 {
206 compatible = "cirrus,cs42l42";
208 VA-supply = <&dummy_vreg>;
209 VP-supply = <&dummy_vreg>;
210 VCP-supply = <&dummy_vreg>;
211 VD_FILT-supply = <&dummy_vreg>;
212 VL-supply = <&dummy_vreg>;
214 reset-gpios = <&axi_gpio_0 1 0>;
215 interrupt-parent = <&gpio0>;
218 cirrus,ts-inv = <CS42L42_TS_INV_DIS>;
219 cirrus,ts-dbnc-rise = <CS42L42_TS_DBNCE_1000>;
220 cirrus,ts-dbnc-fall = <CS42L42_TS_DBNCE_0>;
221 cirrus,btn-det-init-dbnce = <100>;
222 cirrus,btn-det-event-dbnce = <10>;
223 cirrus,bias-lvls = <0x0F 0x08 0x04 0x01>;
224 cirrus,hs-bias-ramp-rate = <CS42L42_HSBIAS_RAMP_SLOW>;