Cirrus Logic CS4271 audio CODEC
Schema identifier ($id): "http://devicetree.org/schemas/sound/cirrus,cs4271.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Alexander Sverdlin <alexander.sverdlin@gmail.com>", "Nikita Shubin <nikita.shubin@maquefel.me>"
The CS4271 is a stereo audio codec. This device supports both the I2C and the SPI bus.
All of these rules must match (allOf) #
Rule 1 #
Shared schema rule (
$ref):dai-common.yaml#
Rule 2 #
Shared schema rule (
$ref):/schemas/spi/spi-peripheral-props.yaml#
Properties and child nodes (properties) #
compatible — required here #
Exact value (const): "cirrus,cs4271"
reg — required here #
Maximum number of items (maxItems): 1
clocks — not listed as required here #
Array item rules (items) #
Item 1
Master clock connected to the MCLK pin if MCLK is an input (i.e. no crystal used).
clock-names — not listed as required here #
Array item rules (items) #
Item 1
Exact value (
const):"mclk"
spi-cpha — not listed as required here #
true — No constraints added by this property rule.
spi-cpol — not listed as required here #
true — No constraints added by this property rule.
#sound-dai-cells — not listed as required here #
Exact value (const): 0
reset-gpios — not listed as required here #
This pin will be deasserted before communication to the codec starts.
Maximum number of items (maxItems): 1
va-supply — not listed as required here #
Analog power supply.
vd-supply — not listed as required here #
Digital power supply.
vl-supply — not listed as required here #
Serial Control Port power supply.
port — not listed as required here #
Shared schema rule ($ref): audio-graph-port.yaml#
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
cirrus,amuteb-eq-bmutec — not listed as required here #
When given, the Codec's AMUTEB=BMUTEC flag is enabled.
Value type (type): "boolean"
cirrus,enable-soft-reset — not listed as required here #
The CS4271 requires its LRCLK and MCLK to be stable before its RESET line is de-asserted. That also means that clocks cannot be changed without putting the chip back into hardware reset, which also requires a complete re-initialization of all registers.
One (undocumented) workaround is to assert and de-assert the PDN bit in the MODE2 register. This workaround can be enabled with this DT property.
Note that this is not needed in case the clocks are stable throughout the entire runtime of the codec.
Value type (type): "boolean"
Required in this object (required): "compatible", "reg"
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
Examples (examples) #
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
codec@0 {
compatible = "cirrus,cs4271";
reg = <0>;
#sound-dai-cells = <0>;
spi-max-frequency = <6000000>;
spi-cpol;
spi-cpha;
reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
port {
endpoint {
remote-endpoint = <&i2s_ep>;
};
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)