1*b2d2a78aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*b2d2a78aSEmmanuel Vadot%YAML 1.2 3*b2d2a78aSEmmanuel Vadot--- 4*b2d2a78aSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/cirrus,cs4271.yaml# 5*b2d2a78aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*b2d2a78aSEmmanuel Vadot 7*b2d2a78aSEmmanuel Vadottitle: Cirrus Logic CS4271 audio CODEC 8*b2d2a78aSEmmanuel Vadot 9*b2d2a78aSEmmanuel Vadotmaintainers: 10*b2d2a78aSEmmanuel Vadot - Alexander Sverdlin <alexander.sverdlin@gmail.com> 11*b2d2a78aSEmmanuel Vadot - Nikita Shubin <nikita.shubin@maquefel.me> 12*b2d2a78aSEmmanuel Vadot 13*b2d2a78aSEmmanuel Vadotdescription: 14*b2d2a78aSEmmanuel Vadot The CS4271 is a stereo audio codec. This device supports both the I2C 15*b2d2a78aSEmmanuel Vadot and the SPI bus. 16*b2d2a78aSEmmanuel Vadot 17*b2d2a78aSEmmanuel VadotallOf: 18*b2d2a78aSEmmanuel Vadot - $ref: dai-common.yaml# 19*b2d2a78aSEmmanuel Vadot - $ref: /schemas/spi/spi-peripheral-props.yaml# 20*b2d2a78aSEmmanuel Vadot 21*b2d2a78aSEmmanuel Vadotproperties: 22*b2d2a78aSEmmanuel Vadot compatible: 23*b2d2a78aSEmmanuel Vadot const: cirrus,cs4271 24*b2d2a78aSEmmanuel Vadot 25*b2d2a78aSEmmanuel Vadot reg: 26*b2d2a78aSEmmanuel Vadot maxItems: 1 27*b2d2a78aSEmmanuel Vadot 28*b2d2a78aSEmmanuel Vadot spi-cpha: true 29*b2d2a78aSEmmanuel Vadot 30*b2d2a78aSEmmanuel Vadot spi-cpol: true 31*b2d2a78aSEmmanuel Vadot 32*b2d2a78aSEmmanuel Vadot '#sound-dai-cells': 33*b2d2a78aSEmmanuel Vadot const: 0 34*b2d2a78aSEmmanuel Vadot 35*b2d2a78aSEmmanuel Vadot reset-gpios: 36*b2d2a78aSEmmanuel Vadot description: 37*b2d2a78aSEmmanuel Vadot This pin will be deasserted before communication to the codec starts. 38*b2d2a78aSEmmanuel Vadot maxItems: 1 39*b2d2a78aSEmmanuel Vadot 40*b2d2a78aSEmmanuel Vadot va-supply: 41*b2d2a78aSEmmanuel Vadot description: Analog power supply. 42*b2d2a78aSEmmanuel Vadot 43*b2d2a78aSEmmanuel Vadot vd-supply: 44*b2d2a78aSEmmanuel Vadot description: Digital power supply. 45*b2d2a78aSEmmanuel Vadot 46*b2d2a78aSEmmanuel Vadot vl-supply: 47*b2d2a78aSEmmanuel Vadot description: Serial Control Port power supply. 48*b2d2a78aSEmmanuel Vadot 49*b2d2a78aSEmmanuel Vadot port: 50*b2d2a78aSEmmanuel Vadot $ref: audio-graph-port.yaml# 51*b2d2a78aSEmmanuel Vadot unevaluatedProperties: false 52*b2d2a78aSEmmanuel Vadot 53*b2d2a78aSEmmanuel Vadot cirrus,amuteb-eq-bmutec: 54*b2d2a78aSEmmanuel Vadot description: 55*b2d2a78aSEmmanuel Vadot When given, the Codec's AMUTEB=BMUTEC flag is enabled. 56*b2d2a78aSEmmanuel Vadot type: boolean 57*b2d2a78aSEmmanuel Vadot 58*b2d2a78aSEmmanuel Vadot cirrus,enable-soft-reset: 59*b2d2a78aSEmmanuel Vadot description: | 60*b2d2a78aSEmmanuel Vadot The CS4271 requires its LRCLK and MCLK to be stable before its RESET 61*b2d2a78aSEmmanuel Vadot line is de-asserted. That also means that clocks cannot be changed 62*b2d2a78aSEmmanuel Vadot without putting the chip back into hardware reset, which also requires 63*b2d2a78aSEmmanuel Vadot a complete re-initialization of all registers. 64*b2d2a78aSEmmanuel Vadot 65*b2d2a78aSEmmanuel Vadot One (undocumented) workaround is to assert and de-assert the PDN bit 66*b2d2a78aSEmmanuel Vadot in the MODE2 register. This workaround can be enabled with this DT 67*b2d2a78aSEmmanuel Vadot property. 68*b2d2a78aSEmmanuel Vadot 69*b2d2a78aSEmmanuel Vadot Note that this is not needed in case the clocks are stable 70*b2d2a78aSEmmanuel Vadot throughout the entire runtime of the codec. 71*b2d2a78aSEmmanuel Vadot type: boolean 72*b2d2a78aSEmmanuel Vadot 73*b2d2a78aSEmmanuel Vadotrequired: 74*b2d2a78aSEmmanuel Vadot - compatible 75*b2d2a78aSEmmanuel Vadot - reg 76*b2d2a78aSEmmanuel Vadot 77*b2d2a78aSEmmanuel VadotunevaluatedProperties: false 78*b2d2a78aSEmmanuel Vadot 79*b2d2a78aSEmmanuel Vadotexamples: 80*b2d2a78aSEmmanuel Vadot - | 81*b2d2a78aSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 82*b2d2a78aSEmmanuel Vadot spi { 83*b2d2a78aSEmmanuel Vadot #address-cells = <1>; 84*b2d2a78aSEmmanuel Vadot #size-cells = <0>; 85*b2d2a78aSEmmanuel Vadot codec@0 { 86*b2d2a78aSEmmanuel Vadot compatible = "cirrus,cs4271"; 87*b2d2a78aSEmmanuel Vadot reg = <0>; 88*b2d2a78aSEmmanuel Vadot #sound-dai-cells = <0>; 89*b2d2a78aSEmmanuel Vadot spi-max-frequency = <6000000>; 90*b2d2a78aSEmmanuel Vadot spi-cpol; 91*b2d2a78aSEmmanuel Vadot spi-cpha; 92*b2d2a78aSEmmanuel Vadot reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; 93*b2d2a78aSEmmanuel Vadot port { 94*b2d2a78aSEmmanuel Vadot endpoint { 95*b2d2a78aSEmmanuel Vadot remote-endpoint = <&i2s_ep>; 96*b2d2a78aSEmmanuel Vadot }; 97*b2d2a78aSEmmanuel Vadot }; 98*b2d2a78aSEmmanuel Vadot }; 99*b2d2a78aSEmmanuel Vadot }; 100*b2d2a78aSEmmanuel Vadot 101*b2d2a78aSEmmanuel Vadot... 102