arm64: dts: rockchip: add analog audio to rock-5a
authorSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 10 Jul 2023 16:52:23 +0000 (18:52 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 11 Jul 2023 13:24:30 +0000 (15:24 +0200)
Add analog audio support based on the Everest Semi ES8316 codec.

Note, that this currently does not support headphone plug events. The
Rock 5A uses a different headphone jack with a different logic to detect
a headphone plug. Unfortunately the detect GPIO is always low.
Downstream uses an ADC channel instead, but that is currently not
supported upstream.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20230710165228.105983-9-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts

index ea11e75..f2ccd4c 100644 (file)
                serial2 = &uart2;
        };
 
+       analog-sound {
+               compatible = "audio-graph-card";
+               label = "rk3588-es8316";
+
+               widgets = "Microphone", "Mic Jack",
+                         "Headphone", "Headphones";
+
+               routing = "MIC2", "Mic Jack",
+                         "Headphones", "HPOL",
+                         "Headphones", "HPOR";
+
+               dais = <&i2s0_8ch_p0>;
+       };
+
        chosen {
                stdout-path = "serial2:1500000n8";
        };
        };
 };
 
+&i2c7 {
+       status = "okay";
+
+       es8316: audio-codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru I2S0_8CH_MCLKOUT>;
+               clock-names = "mclk";
+               assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
+               assigned-clock-rates = <12288000>;
+               #sound-dai-cells = <0>;
+
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s0_8ch_p0_0>;
+                       };
+               };
+       };
+};
+
+&i2s0_8ch {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2s0_lrck
+                    &i2s0_mclk
+                    &i2s0_sclk
+                    &i2s0_sdi0
+                    &i2s0_sdo0>;
+       status = "okay";
+
+       i2s0_8ch_p0: port {
+               i2s0_8ch_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
+};
+
 &gmac1 {
        clock_in_out = "output";
        phy-handle = <&rgmii_phy1>;