On Thu, Dec 11, 2025 at 07:01:29PM +0800, Oder Chiou wrote:
Audio codec with I2S, I2C and SPI.
Signed-off-by: Oder Chiou oder_chiou@realtek.com
.../bindings/sound/realtek,rt5575.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/realtek,rt5575.yaml
diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5575.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5575.yaml new file mode 100644 index 000000000000..60f9af399dd2 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/realtek,rt5575.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/realtek,rt5575.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml#
+title: ALC5575 audio CODEC
+maintainers:
- Oder Chiou oder_chiou@realtek.com
+description:
- The device supports both I2C and SPI. I2C is mandatory, while SPI is
- optional depending on the hardware configuration.
+allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
- $ref: dai-common.yaml#
+properties:
- compatible:
- enum:
- realtek,rt5575- realtek,rt5575-use-spi- reg:
- maxItems: 1
+required:
- compatible
- reg
+unevaluatedProperties: false
+examples:
- |
- i2c {
#address-cells = <1>;#size-cells = <0>;codec@57 {compatible = "realtek,rt5575";reg = <0x57>;};- };
It is completely unclear what you are doing in the SPI case. I deciphered it studying the driver. I shouldn't have to do that, your binding should make that clear.
So your DT must look like this:
i2c { codec@57 { compatible = "realtek,rt5575-use-spi"; reg = <0x57>; }; };
spi { codec@1 { compatible = "realtek,rt5575"; reg = <0x1>; }; };
First, there's no need for "-use-spi" because you can just check if there is a rt5575 SPI device and use it if there is. Why would you have the SPI device and not use it?
But really it is not ideal having 2 device nodes for a single device. It would be much simpler to just have something like this in the i2c node:
spi-parent = <&spi0 1>;
Where the cell is the chip-select #.
We have an 'i2c-parent' already for similar reasons when there are 2 bus connections.
Rob