From ab72f04662c6065a331924d9421b2b4c5707a35b Mon Sep 17 00:00:00 2001
From: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
Date: Thu, 17 Apr 2025 17:44:55 +0200
Subject: [PATCH] meson-g12b-bananapi-cm4-mnt-reform2.dts: fix audio and
 communication with LPC

---
 .../meson-g12b-bananapi-cm4-mnt-reform2.dts   | 37 ++++++++++++++-----
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts
index 0f48c32bec97..5b105fcee657 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts
@@ -79,10 +79,6 @@ sound {
 				"LINPUT1", "Mic Jack",
 				"Mic Jack", "MICB";
 
-		clocks = <&clkc CLKID_MPLL2>,
-			 <&clkc CLKID_MPLL0>,
-			 <&clkc CLKID_MPLL1>;
-
 		assigned-clocks = <&clkc CLKID_MPLL2>,
 					<&clkc CLKID_MPLL0>,
 					<&clkc CLKID_MPLL1>;
@@ -197,14 +193,18 @@ backlight: backlight {
 		enable-gpios = <&gpio 58 GPIO_ACTIVE_HIGH>;
 		brightness-levels = <0 32 64 128 160 200 255>;
 		default-brightness-level = <6>;
+
+		status = "okay";
 	};
 
 	panel {
-		compatible = "innolux,n125hce-gn1";
+		compatible = "innolux,n125hce-gn1-a311d", "simple-panel";
 		power-supply = <&reg_main_3v3>;
 		backlight = <&backlight>;
 		no-hpd;
 
+		status = "okay";
+
 		port {
 			panel_in: endpoint {
 				remote-endpoint = <&edp_bridge_out>;
@@ -217,6 +217,24 @@ clock_12288: clock_12288 {
 		#clock-cells = <0>;
 		clock-frequency = <12288000>;
 	};
+
+	spi {
+		compatible = "spi-gpio";
+		#address-cells = <0x1>;
+		ranges;
+
+		sck-gpios = <&gpio_ao GPIOAO_5 0>; // GPIOAO_5 / GPIO7
+		miso-gpios = <&gpio GPIOH_4 0>; // GPIOH_4 / GPIO5
+		mosi-gpios = <&gpio_ao GPIOAO_10 0>; // GPIOAO_10 / GPIO6
+		cs-gpios = <&gpio GPIOA_10 0>; // GPIOA_10 / GPIO4
+		num-chipselects = <1>;
+
+		spidev@0 {
+			compatible = "mntre,lpc11u24";
+			spi-max-frequency = <1000000>;
+			reg = <0>;
+		};
+	};
 };
 
 &mipi_analog_dphy {
@@ -281,6 +299,10 @@ &i2c0 {
 	status = "okay";
 };
 
+&i2c2 {
+	status = "okay";
+};
+
 &i2c3 {
 	status = "okay";
 
@@ -292,6 +314,7 @@ edp_bridge: bridge@2c {
 		vpll-supply = <&reg_main_1v8>;
 		vcca-supply = <&reg_main_1v2>;
 		vcc-supply = <&reg_main_1v2>;
+		burst-mode;
 
 		ports {
 			#address-cells = <1>;
@@ -314,10 +337,6 @@ edp_bridge_out: endpoint {
 			};
 		};
 	};
-};
-
-&i2c2 {
-	status = "okay";
 
 	wm8960: codec@1a {
 		compatible = "wlf,wm8960";
-- 
2.49.0

