315 lines · yaml
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause2%YAML 1.23---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 CODEC8 9maintainers:10 - patches@opensource.cirrus.com11 12description: |13 The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface14 (Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed15 for portable applications. It provides a high dynamic range, stereo16 DAC for headphone output, two integrated Class D amplifiers for17 loudspeakers, and two ADCs for wired headset microphone input or18 stereo line input. PDM inputs are provided for digital microphones.19 20allOf:21 - $ref: dai-common.yaml#22 23properties:24 compatible:25 enum:26 - cirrus,cs42l4327 28 reg:29 maxItems: 130 31 vdd-p-supply:32 description:33 Power supply for the high voltage interface.34 35 vdd-a-supply:36 description:37 Power supply for internal analog circuits.38 39 vdd-d-supply:40 description:41 Power supply for internal digital circuits. Can be internally supplied.42 43 vdd-io-supply:44 description:45 Power supply for external interface and internal digital logic.46 47 vdd-cp-supply:48 description:49 Power supply for the amplifier 3 and 4 charge pump.50 51 vdd-amp-supply:52 description:53 Power supply for amplifier 1 and 2.54 55 reset-gpios:56 maxItems: 157 58 interrupt-controller: true59 60 "#interrupt-cells":61 const: 262 63 interrupts:64 maxItems: 165 66 "#sound-dai-cells":67 const: 168 69 clocks:70 items:71 - description: Synchronous audio clock provided on mclk_in.72 73 clock-names:74 const: mclk75 76 cirrus,bias-low:77 type: boolean78 description:79 Select a 1.8V headset micbias rather than 2.8V.80 81 cirrus,bias-sense-microamp:82 description:83 Current at which the headset micbias sense clamp will engage, 0 to84 disable.85 enum: [ 0, 14, 24, 43, 52, 61, 71, 90, 99 ]86 default: 1487 88 cirrus,bias-ramp-ms:89 description:90 Time in milliseconds the hardware allows for the headset micbias to91 ramp up.92 enum: [ 10, 40, 90, 170 ]93 default: 17094 95 cirrus,detect-us:96 description:97 Time in microseconds the type detection will run for. Long values will98 cause more audible effects, but give more accurate detection.99 enum: [ 20, 100, 1000, 10000, 50000, 75000, 100000, 200000 ]100 default: 1000101 102 cirrus,button-automute:103 type: boolean104 description:105 Enable the hardware automuting of decimator 1 when a headset button is106 pressed.107 108 cirrus,buttons-ohms:109 description:110 Impedance in Ohms for each headset button, these should be listed in111 ascending order.112 minItems: 1113 maxItems: 6114 115 cirrus,tip-debounce-ms:116 description:117 Software debounce on tip sense triggering in milliseconds.118 default: 0119 120 cirrus,tip-invert:121 type: boolean122 description:123 Indicates tip detect polarity, inverted implies open-circuit whilst the124 jack is inserted.125 126 cirrus,tip-disable-pullup:127 type: boolean128 description:129 Indicates if the internal pullup on the tip detect should be disabled.130 131 cirrus,tip-fall-db-ms:132 description:133 Time in milliseconds a falling edge on the tip detect should be hardware134 debounced for. Note the falling edge is considered after the invert.135 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]136 default: 500137 138 cirrus,tip-rise-db-ms:139 description:140 Time in milliseconds a rising edge on the tip detect should be hardware141 debounced for. Note the rising edge is considered after the invert.142 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]143 default: 500144 145 cirrus,use-ring-sense:146 type: boolean147 description:148 Indicates if the ring sense should be used.149 150 cirrus,ring-invert:151 type: boolean152 description:153 Indicates ring detect polarity, inverted implies open-circuit whilst the154 jack is inserted.155 156 cirrus,ring-disable-pullup:157 type: boolean158 description:159 Indicates if the internal pullup on the ring detect should be disabled.160 161 cirrus,ring-fall-db-ms:162 description:163 Time in milliseconds a falling edge on the ring detect should be hardware164 debounced for. Note the falling edge is considered after the invert.165 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]166 default: 500167 168 cirrus,ring-rise-db-ms:169 description:170 Time in milliseconds a rising edge on the ring detect should be hardware171 debounced for. Note the rising edge is considered after the invert.172 enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]173 default: 500174 175 pinctrl:176 type: object177 $ref: /schemas/pinctrl/pinctrl.yaml#178 additionalProperties: false179 180 properties:181 gpio-controller: true182 183 "#gpio-cells":184 const: 2185 186 gpio-ranges:187 items:188 - items:189 - description: A phandle to the CODEC pinctrl node190 minimum: 0191 - const: 0192 - const: 0193 - const: 3194 195 patternProperties:196 "-state$":197 oneOf:198 - $ref: "#/$defs/cirrus-cs42l43-state"199 - patternProperties:200 "-pins$":201 $ref: "#/$defs/cirrus-cs42l43-state"202 additionalProperties: false203 204 spi:205 type: object206 $ref: /schemas/spi/spi-controller.yaml#207 unevaluatedProperties: false208 209$defs:210 cirrus-cs42l43-state:211 type: object212 213 allOf:214 - $ref: /schemas/pinctrl/pincfg-node.yaml#215 - $ref: /schemas/pinctrl/pinmux-node.yaml#216 217 oneOf:218 - required: [ groups ]219 - required: [ pins ]220 221 additionalProperties: false222 223 properties:224 groups:225 enum: [ gpio1, gpio2, gpio3, asp, pdmout2, pdmout1, i2c, spi ]226 227 pins:228 enum: [ gpio1, gpio2, gpio3,229 asp_dout, asp_fsync, asp_bclk,230 pdmout2_clk, pdmout2_data, pdmout1_clk, pdmout1_data,231 i2c_sda, i2c_scl,232 spi_miso, spi_sck, spi_ssb ]233 234 function:235 enum: [ gpio, spdif, irq, mic-shutter, spk-shutter ]236 237 drive-strength:238 description: Set drive strength in mA239 enum: [ 1, 2, 4, 8, 9, 10, 12, 16 ]240 241 input-debounce:242 description: Set input debounce in uS243 enum: [ 0, 85 ]244 245required:246 - compatible247 - reg248 - vdd-p-supply249 - vdd-a-supply250 - vdd-io-supply251 - vdd-cp-supply252 253additionalProperties: false254 255examples:256 - |257 #include <dt-bindings/interrupt-controller/irq.h>258 259 i2c {260 #address-cells = <1>;261 #size-cells = <0>;262 263 cs42l43: codec@1a {264 compatible = "cirrus,cs42l43";265 reg = <0x1a>;266 267 vdd-p-supply = <&vdd5v0>;268 vdd-a-supply = <&vdd1v8>;269 vdd-io-supply = <&vdd1v8>;270 vdd-cp-supply = <&vdd1v8>;271 vdd-amp-supply = <&vdd5v0>;272 273 reset-gpios = <&gpio 0>;274 275 interrupt-controller;276 #interrupt-cells = <2>;277 interrupt-parent = <&gpio>;278 interrupts = <56 IRQ_TYPE_LEVEL_LOW>;279 280 #sound-dai-cells = <1>;281 282 clocks = <&clks 0>;283 clock-names = "mclk";284 285 cs42l43_pins: pinctrl {286 gpio-controller;287 #gpio-cells = <2>;288 gpio-ranges = <&cs42l43_pins 0 0 3>;289 290 pinctrl-names = "default";291 pinctrl-0 = <&pinsettings>;292 293 pinsettings: default-state {294 shutter-pins {295 groups = "gpio3";296 function = "mic-shutter";297 };298 };299 };300 301 spi {302 #address-cells = <1>;303 #size-cells = <0>;304 305 cs-gpios = <&cs42l43_pins 1 0>;306 307 sensor@0 {308 compatible = "bosch,bme680";309 reg = <0>;310 spi-max-frequency = <1400000>;311 };312 };313 };314 };315