Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: dt-bindings: cirrus,cs4271: Convert to dtschema

Convert the Cirrus Logic CS4271 audio CODEC bindings to DT schema.

Add missing spi-cpha, spi-cpol, '#sound-dai-cells' and port, as they
are already being used in the DTS and the driver for this device.

Switch to 'reset-gpios' and drop legacy 'reset-gpio' used in original
bindings.

Based on Animesh Agarwal cs42xx8 conversion patch.

Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/all/20240715-ep93xx-v11-0-4e924efda795@maquefel.me
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240829-cs4271-yaml-v3-1-f1624cc838f6@maquefel.me
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Nikita Shubin and committed by
Mark Brown
7817eb1a 125b7492

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