From 7f3cc57dc50d31414a284761cfb5372942229571 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Wed, 11 Jun 2025 11:47:31 +0000
Subject: [PATCH 37/37] WIP: arm64: dts: meson-g12a-x96-max: support the fd628
 display

The X96-Max has an FD628 display. Add support using the tm166xx
kernel driver and userspace tools [0].

[0] https://github.com/jefflessard/tm16xx-display

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
index 5ab460a3e637..879276d6f6e9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
@@ -7,6 +7,7 @@
 
 #include "meson-g12a.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/meson-g12a-gpio.h>
 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
 
@@ -54,6 +55,68 @@ hdmi_connector_in: endpoint {
 		};
 	};
 
+	display_client: spi {
+		compatible = "spi-gpio";
+		sck-gpios = <&gpio 64 GPIO_ACTIVE_HIGH>;
+		mosi-gpios = <&gpio 63 GPIO_ACTIVE_HIGH>;
+		cs-gpios = <&gpio_ao 10 GPIO_ACTIVE_LOW>;
+		num-chipselects = <1>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		display@0 {
+			compatible = "fdhisi,fd628";
+			reg = <0x0>;
+			spi-3wire;
+			spi-lsb-first;
+			spi-rx-delay-us = <1>;
+			spi-max-frequency = <500000>;
+
+			tm16xx,transposed;
+			tm16xx,digits = [00 01 02 03];
+			tm16xx,segment-mapping = [00 01 02 03 04 05 06];
+
+			#address-cells = <2>;
+			#size-cells = <0>;
+
+			led@4,0 {
+				reg = <4 0>;
+				function = "apps";
+			};
+
+			led@4,1 {
+				reg = <4 1>;
+				function = "setup";
+			};
+
+			led@4,2 {
+				reg = <4 2>;
+				function = LED_FUNCTION_USB;
+			};
+
+			led@4,3 {
+				reg = <4 3>;
+				function = LED_FUNCTION_SD;
+			};
+
+			led@4,4 {
+				reg = <4 4>;
+				function = "colon";
+			};
+
+			led@4,5 {
+				reg = <4 5>;
+				function = "hdmi";
+			};
+
+			led@4,6 {
+				reg = <4 6>;
+				function = "video";
+			};
+		};
+	};
+
 	emmc_pwrseq: emmc-pwrseq {
 		compatible = "mmc-pwrseq-emmc";
 		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
-- 
2.34.1

