From 6bf5753f848d4c9e66d5e55929b307715ee1d5c5 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Thu, 9 Feb 2023 10:11:39 +0000
Subject: [PATCH 36/37] WIP: arm64: dts: meson-gxm-tx9-pro: support the fd628
 display

The TX9-Pro 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-gxm-tx9-pro.dts    | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-tx9-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-tx9-pro.dts
index 9a62176cfe5a..08603b035868 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-tx9-pro.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-tx9-pro.dts
@@ -9,6 +9,7 @@
 #include "meson-gxm.dtsi"
 #include "meson-gx-p23x-q20x.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
 	compatible = "oranth,tx9-pro", "amlogic,s912", "amlogic,meson-gxm";
@@ -37,6 +38,67 @@ button {
 			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
 		};
 	};
+
+	display_client: spi {
+		compatible = "spi-gpio";
+		sck-gpios = <&gpio 76 GPIO_ACTIVE_HIGH>;
+		mosi-gpios = <&gpio 75 GPIO_ACTIVE_HIGH>;
+		cs-gpios = <&gpio 53 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,digits = [00 01 02 03];
+			tm16xx,segment-mapping = [03 01 02 06 04 05 00];
+
+			#address-cells = <2>;
+			#size-cells = <0>;
+
+			led@4,0 {
+				reg = <4 0>;
+				function = LED_FUNCTION_ALARM;
+			};
+
+			led@4,1 {
+				reg = <4 1>;
+				function = LED_FUNCTION_USB;
+			};
+
+			led@4,2 {
+				reg = <4 2>;
+				function = "play";
+			};
+
+			led@4,3 {
+				reg = <4 3>;
+				function = "pause";
+			};
+
+			led@4,4 {
+				reg = <4 4>;
+				function = "colon";
+			};
+
+			led@4,5 {
+				reg = <4 5>;
+				function = LED_FUNCTION_LAN;
+			};
+
+			led@4,6 {
+				reg = <4 6>;
+				function = LED_FUNCTION_WLAN;
+			};
+		};
+	};
 };
 
 &ethmac {
-- 
2.34.1

