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. 85*53ba32acSCharles Keepax enum: [ 0, 14, 24, 43, 52, 61, 71, 90, 99 ] 86ec77cad8SCharles Keepax default: 0 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 ] 100ec77cad8SCharles Keepax default: 10000 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: 188ec77cad8SCharles Keepax - description: A phandle to the CODEC pinctrl node 189ec77cad8SCharles Keepax minimum: 0 190ec77cad8SCharles Keepax - const: 0 191ec77cad8SCharles Keepax - const: 0 192ec77cad8SCharles Keepax - const: 3 193ec77cad8SCharles Keepax 194ec77cad8SCharles Keepax patternProperties: 195ec77cad8SCharles Keepax "-state$": 196ec77cad8SCharles Keepax oneOf: 197ec77cad8SCharles Keepax - $ref: "#/$defs/cirrus-cs42l43-state" 198ec77cad8SCharles Keepax - patternProperties: 199ec77cad8SCharles Keepax "-pins$": 200ec77cad8SCharles Keepax $ref: "#/$defs/cirrus-cs42l43-state" 201ec77cad8SCharles Keepax additionalProperties: false 202ec77cad8SCharles Keepax 203ec77cad8SCharles Keepax spi: 204ec77cad8SCharles Keepax type: object 205ec77cad8SCharles Keepax $ref: /schemas/spi/spi-controller.yaml# 206ec77cad8SCharles Keepax unevaluatedProperties: false 207ec77cad8SCharles Keepax 208ec77cad8SCharles Keepax$defs: 209ec77cad8SCharles Keepax cirrus-cs42l43-state: 210ec77cad8SCharles Keepax type: object 211ec77cad8SCharles Keepax 212ec77cad8SCharles Keepax allOf: 213ec77cad8SCharles Keepax - $ref: /schemas/pinctrl/pincfg-node.yaml# 214ec77cad8SCharles Keepax - $ref: /schemas/pinctrl/pinmux-node.yaml# 215ec77cad8SCharles Keepax 216ec77cad8SCharles Keepax oneOf: 217ec77cad8SCharles Keepax - required: [ groups ] 218ec77cad8SCharles Keepax - required: [ pins ] 219ec77cad8SCharles Keepax 220ec77cad8SCharles Keepax additionalProperties: false 221ec77cad8SCharles Keepax 222ec77cad8SCharles Keepax properties: 223ec77cad8SCharles Keepax groups: 224ec77cad8SCharles Keepax enum: [ gpio1, gpio2, gpio3, asp, pdmout2, pdmout1, i2c, spi ] 225ec77cad8SCharles Keepax 226ec77cad8SCharles Keepax pins: 227ec77cad8SCharles Keepax enum: [ gpio1, gpio2, gpio3, 228ec77cad8SCharles Keepax asp_dout, asp_fsync, asp_bclk, 229ec77cad8SCharles Keepax pdmout2_clk, pdmout2_data, pdmout1_clk, pdmout1_data, 230ec77cad8SCharles Keepax i2c_sda, i2c_scl, 231ec77cad8SCharles Keepax spi_miso, spi_sck, spi_ssb ] 232ec77cad8SCharles Keepax 233ec77cad8SCharles Keepax function: 234ec77cad8SCharles Keepax enum: [ gpio, spdif, irq, mic-shutter, spk-shutter ] 235ec77cad8SCharles Keepax 236ec77cad8SCharles Keepax drive-strength: 237ec77cad8SCharles Keepax description: Set drive strength in mA 238ec77cad8SCharles Keepax enum: [ 1, 2, 4, 8, 9, 10, 12, 16 ] 239ec77cad8SCharles Keepax 240ec77cad8SCharles Keepax input-debounce: 241ec77cad8SCharles Keepax description: Set input debounce in uS 242ec77cad8SCharles Keepax enum: [ 0, 85 ] 243ec77cad8SCharles Keepax 244ec77cad8SCharles Keepaxrequired: 245ec77cad8SCharles Keepax - compatible 246ec77cad8SCharles Keepax - reg 247ec77cad8SCharles Keepax - vdd-p-supply 248ec77cad8SCharles Keepax - vdd-a-supply 249ec77cad8SCharles Keepax - vdd-io-supply 250ec77cad8SCharles Keepax - vdd-cp-supply 251ec77cad8SCharles Keepax 252ec77cad8SCharles KeepaxadditionalProperties: false 253ec77cad8SCharles Keepax 254ec77cad8SCharles Keepaxexamples: 255ec77cad8SCharles Keepax - | 256ec77cad8SCharles Keepax #include <dt-bindings/interrupt-controller/irq.h> 257ec77cad8SCharles Keepax 258ec77cad8SCharles Keepax i2c { 259ec77cad8SCharles Keepax #address-cells = <1>; 260ec77cad8SCharles Keepax #size-cells = <0>; 261ec77cad8SCharles Keepax 262ec77cad8SCharles Keepax cs42l43: codec@1a { 263ec77cad8SCharles Keepax compatible = "cirrus,cs42l43"; 264ec77cad8SCharles Keepax reg = <0x1a>; 265ec77cad8SCharles Keepax 266ec77cad8SCharles Keepax vdd-p-supply = <&vdd5v0>; 267ec77cad8SCharles Keepax vdd-a-supply = <&vdd1v8>; 268ec77cad8SCharles Keepax vdd-io-supply = <&vdd1v8>; 269ec77cad8SCharles Keepax vdd-cp-supply = <&vdd1v8>; 270ec77cad8SCharles Keepax vdd-amp-supply = <&vdd5v0>; 271ec77cad8SCharles Keepax 272ec77cad8SCharles Keepax reset-gpios = <&gpio 0>; 273ec77cad8SCharles Keepax 274ec77cad8SCharles Keepax interrupt-controller; 275ec77cad8SCharles Keepax #interrupt-cells = <2>; 276ec77cad8SCharles Keepax interrupt-parent = <&gpio>; 277ec77cad8SCharles Keepax interrupts = <56 IRQ_TYPE_LEVEL_LOW>; 278ec77cad8SCharles Keepax 279ec77cad8SCharles Keepax #sound-dai-cells = <1>; 280ec77cad8SCharles Keepax 281ec77cad8SCharles Keepax clocks = <&clks 0>; 282ec77cad8SCharles Keepax clock-names = "mclk"; 283ec77cad8SCharles Keepax 284ec77cad8SCharles Keepax cs42l43_pins: pinctrl { 285ec77cad8SCharles Keepax gpio-controller; 286ec77cad8SCharles Keepax #gpio-cells = <2>; 287ec77cad8SCharles Keepax gpio-ranges = <&cs42l43_pins 0 0 3>; 288ec77cad8SCharles Keepax 289ec77cad8SCharles Keepax pinctrl-names = "default"; 290ec77cad8SCharles Keepax pinctrl-0 = <&pinsettings>; 291ec77cad8SCharles Keepax 292ec77cad8SCharles Keepax pinsettings: default-state { 293ec77cad8SCharles Keepax shutter-pins { 294ec77cad8SCharles Keepax groups = "gpio3"; 295ec77cad8SCharles Keepax function = "mic-shutter"; 296ec77cad8SCharles Keepax }; 297ec77cad8SCharles Keepax }; 298ec77cad8SCharles Keepax }; 299ec77cad8SCharles Keepax 300ec77cad8SCharles Keepax spi { 301ec77cad8SCharles Keepax #address-cells = <1>; 302ec77cad8SCharles Keepax #size-cells = <0>; 303ec77cad8SCharles Keepax 304ec77cad8SCharles Keepax cs-gpios = <&cs42l43_pins 1 0>; 305ec77cad8SCharles Keepax 306ec77cad8SCharles Keepax sensor@0 { 307ec77cad8SCharles Keepax compatible = "bosch,bme680"; 308ec77cad8SCharles Keepax reg = <0>; 309ec77cad8SCharles Keepax spi-max-frequency = <1400000>; 310ec77cad8SCharles Keepax }; 311ec77cad8SCharles Keepax }; 312ec77cad8SCharles Keepax }; 313ec77cad8SCharles Keepax }; 314