Commit 11e11084 authored by Martin Blumenstingl's avatar Martin Blumenstingl
Browse files

ARM: dts: meson8b: ec100: wire up the RT5640 audio codec



The Realtek RT5640 codec is connected to the SoC's I2S interface.
Describe this in the .dts together with the codec's LDO1 enable GPIO so
audio can be played on the Endless Mini.

Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
parent be7f7602
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -107,6 +107,33 @@
		#clock-cells = <0>;
	};

	sound {
		compatible = "amlogic,gx-sound-card";
		model = "M8B-EC100";
		audio-routing = "I2S Encoder Playback", "I2S FIFO Playback";

		assigned-clocks = <&clkc CLKID_MPLL0>,
				  <&clkc CLKID_MPLL1>,
				  <&clkc CLKID_MPLL2>;
		assigned-clock-rates = <270950400>,
				       <294912000>,
				       <393216000>;

		dai-link-0 {
			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
		};

		dai-link-1 {
			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
			dai-format = "i2s";
			mclk-fs = <256>;

			codec-0 {
				sound-dai = <&rt5640>;
			};
		};
	};

	tv-connector {
		compatible = "composite-video-connector";

@@ -263,6 +290,14 @@
	};
};

&aiu {
	status = "okay";

	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
	pinctrl-names = "default";
};

&cpu0 {
	cpu-supply = <&vcck>;
};
@@ -322,9 +357,15 @@

	rt5640: codec@1c {
		compatible = "realtek,rt5640";

		reg = <0x1c>;

		#sound-dai-cells = <0>;

		interrupt-parent = <&gpio_intc>;
		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */

		realtek,ldo1-en-gpios = <&gpio GPIO_BSD_EN GPIO_ACTIVE_LOW>;
		realtek,in1-differential;
	};
};