From fb031e6275fc165100a2bf65d630872b89a97c08 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Mon, 10 Jul 2023 18:52:23 +0200 Subject: [PATCH] arm64: dts: rockchip: add analog audio to rock-5a 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 Link: https://lore.kernel.org/r/20230710165228.105983-9-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner --- arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts index ea11e75..f2ccd4c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts @@ -16,6 +16,20 @@ 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"; }; @@ -149,6 +163,44 @@ }; }; +&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>; -- 2.7.4