Commit fb031e62 authored by Sebastian Reichel's avatar Sebastian Reichel Committed by Heiko Stuebner
Browse files

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: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20230710165228.105983-9-sebastian.reichel@collabora.com


Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent db02f866
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
@@ -16,6 +16,20 @@ aliases {
		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 @@ regulator-state-mem {
	};
};

&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>;