[openwrt/openwrt] d1: Add device tree configuration for D1 RGB LED Controller

LEDE Commits lede-commits at lists.infradead.org
Fri Jan 23 01:36:55 PST 2026


wigyori pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/12992dcb7e40a08247541ab098483075c254a7f4

commit 12992dcb7e40a08247541ab098483075c254a7f4
Author: Gabriel Roper <lockheedmaniac at gmail.com>
AuthorDate: Mon Oct 6 21:21:40 2025 -0700

    d1: Add device tree configuration for D1 RGB LED Controller
    
    This adds the device tree patches written by Samuel Holland
    to the kernel. The driver was merged into mainline Linux in 6.8,
    but the device tree patches were never merged into mainline.
    
    Signed-off-by: Gabriel Roper <lockheedmaniac at gmail.com>
---
 ...-dts-allwinner-d1-add-led-controller-node.patch | 60 +++++++++++++++++++
 ...v-dts-allwinner-d1-add-rgb-leds-to-boards.patch | 70 ++++++++++++++++++++++
 2 files changed, 130 insertions(+)

diff --git a/target/linux/d1/patches-6.12/0015-riscv-dts-allwinner-d1-add-led-controller-node.patch b/target/linux/d1/patches-6.12/0015-riscv-dts-allwinner-d1-add-led-controller-node.patch
new file mode 100644
index 0000000000..271f1c5091
--- /dev/null
+++ b/target/linux/d1/patches-6.12/0015-riscv-dts-allwinner-d1-add-led-controller-node.patch
@@ -0,0 +1,60 @@
+From: Samuel Holland <samuel at sholland.org>
+Subject: riscv: dts: allwinner: d1: Add LED controller node
+Date: Sun, 29 Oct 2023 16:26:58 -0500
+
+Allwinner D1 contains an LED controller. Add its devicetree node, as
+well as the pinmux used by the reference board design.
+
+Acked-by: Guo Ren <guoren at kernel.org>
+Reviewed-by: Jernej Skrabec <jernej.skrabec at gmail.com>
+Tested-by: Trevor Woerner <twoerner at gmail.com>
+Signed-off-by: Samuel Holland <samuel at sholland.org>
+---
+(no changes since v5)
+
+Changes in v5:
+ - New patch for v5
+
+ arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi      |  6 ++++++
+ arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi | 15 +++++++++++++++
+ 2 files changed, 21 insertions(+)
+
+--- a/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi
++++ b/arch/riscv/boot/dts/allwinner/sun20i-d1.dtsi
+@@ -59,6 +59,12 @@
+ 	};
+ 
+ 	/omit-if-no-ref/
++	ledc_pc0_pin: ledc-pc0-pin {
++		pins = "PC0";
++		function = "ledc";
++	};
++
++	/omit-if-no-ref/
+ 	uart0_pb8_pins: uart0-pb8-pins {
+ 		pins = "PB8", "PB9";
+ 		function = "uart0";
+--- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
++++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
+@@ -156,6 +156,21 @@
+ 			#reset-cells = <1>;
+ 		};
+ 
++		ledc: led-controller at 2008000 {
++			compatible = "allwinner,sun20i-d1-ledc",
++				     "allwinner,sun50i-a100-ledc";
++			reg = <0x2008000 0x400>;
++			interrupts = <SOC_PERIPHERAL_IRQ(20) IRQ_TYPE_LEVEL_HIGH>;
++			clocks = <&ccu CLK_BUS_LEDC>, <&ccu CLK_LEDC>;
++			clock-names = "bus", "mod";
++			resets = <&ccu RST_BUS_LEDC>;
++			dmas = <&dma 42>;
++			dma-names = "tx";
++			status = "disabled";
++			#address-cells = <1>;
++			#size-cells = <0>;
++		};
++
+ 		gpadc: adc at 2009000 {
+ 			compatible = "allwinner,sun20i-d1-gpadc";
+ 			reg = <0x2009000 0x400>;
diff --git a/target/linux/d1/patches-6.12/0016-riscv-dts-allwinner-d1-add-rgb-leds-to-boards.patch b/target/linux/d1/patches-6.12/0016-riscv-dts-allwinner-d1-add-rgb-leds-to-boards.patch
new file mode 100644
index 0000000000..c0adfd7ce2
--- /dev/null
+++ b/target/linux/d1/patches-6.12/0016-riscv-dts-allwinner-d1-add-rgb-leds-to-boards.patch
@@ -0,0 +1,70 @@
+From: Samuel Holland <samuel at sholland.org>
+Subject: riscv: dts: allwinner: d1: Add RGB LEDs to boards
+Date: Sun, 29 Oct 2023 16:26:59 -0500
+
+Some D1-based boards feature an onboard RGB LED. Enable them.
+
+Acked-by: Guo Ren <guoren at kernel.org>
+Acked-by: Jernej Skrabec <jernej.skrabec at gmail.com>
+Tested-by: Trevor Woerner <twoerner at gmail.com>
+Signed-off-by: Samuel Holland <samuel at sholland.org>
+---
+(no changes since v5)
+
+Changes in v5:
+ - New patch for v5
+
+ .../boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts | 12 ++++++++++++
+ arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts   | 13 +++++++++++++
+ 2 files changed, 25 insertions(+)
+
+--- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts
++++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts
+@@ -59,6 +59,18 @@
+ 	status = "okay";
+ };
+ 
++&ledc {
++	pinctrl-0 = <&ledc_pc0_pin>;
++	pinctrl-names = "default";
++	status = "okay";
++
++	multi-led at 0 {
++		reg = <0x0>;
++		color = <LED_COLOR_ID_RGB>;
++		function = LED_FUNCTION_STATUS;
++	};
++};
++
+ &mmc1 {
+ 	bus-width = <4>;
+ 	mmc-pwrseq = <&wifi_pwrseq>;
+--- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
++++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
+@@ -22,6 +22,7 @@
+ 
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
+ 
+ /dts-v1/;
+ 
+@@ -121,6 +122,18 @@
+ 	};
+ };
+ 
++&ledc {
++	pinctrl-0 = <&ledc_pc0_pin>;
++	pinctrl-names = "default";
++	status = "okay";
++
++	multi-led at 0 {
++		reg = <0x0>;
++		color = <LED_COLOR_ID_RGB>;
++		function = LED_FUNCTION_STATUS;
++	};
++};
++
+ &mdio {
+ 	ext_rgmii_phy: ethernet-phy at 1 {
+ 		compatible = "ethernet-phy-ieee802.3-c22";




More information about the lede-commits mailing list