[OpenWrt-Devel,3/3] ramips: rearrange LEDs for ZBT-WE826 devices to prevent delete-node
diff mbox series

Message ID 20190917122223.2745-3-freifunk@adrianschmutzler.de
State Rejected
Delegated to: Petr Štetiar
Headers show
Series
  • [OpenWrt-Devel,1/3] ramips/mt762x: convert devices to interrupt-driven gpio-keys
Related show

Commit Message

Adrian Schmutzler Sept. 17, 2019, 12:22 p.m. UTC
So far, for the ZBT-WE826-E the leds pulled from the DTSI are
deleted and then redefined. The config in the DTSI is then used
in two other DTSes for the ZBT-WE826 flash variants.

Since the block is effectively only used for two devices, this
moves led definitions to the device DTSes to prevent the use of
delete-node.
This seems more logical than created the config and then deleting
it again.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 .../dts/mt7620a_zbtlink_zbt-we826-16m.dts     | 21 +++++++++++++++++++
 .../dts/mt7620a_zbtlink_zbt-we826-32m.dts     | 21 +++++++++++++++++++
 .../dts/mt7620a_zbtlink_zbt-we826-e.dts       |  2 --
 .../ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi | 21 -------------------
 4 files changed, 42 insertions(+), 23 deletions(-)

Comments

Petr Štetiar Sept. 20, 2019, 6:55 a.m. UTC | #1
Adrian Schmutzler <freifunk@adrianschmutzler.de> [2019-09-17 14:22:23]:

Hi,

> So far, for the ZBT-WE826-E the leds pulled from the DTSI are deleted and
> then redefined. The config in the DTSI is then used in two other DTSes for
> the ZBT-WE826 flash variants.
>
> Since the block is effectively only used for two devices, this moves led
> definitions to the device DTSes to prevent the use of delete-node.  This
> seems more logical than created the config and then deleting it again.

maybe, but I would prefer to keep the current state as it avoids copy&pasting
of the exactly same leds node to the two places.

>  4 files changed, 42 insertions(+), 23 deletions(-)

You've just added 21 more lines one would need to maintain.

-- ynezz

Patch
diff mbox series

diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts
index 7f2b2646b2..ff72640399 100644
--- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts
+++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts
@@ -5,6 +5,27 @@ 
 / {
 	compatible = "zbtlink,zbt-we826-16m", "zbtlink,zbt-we826", "ralink,mt7620a-soc";
 	model = "ZBT-WE826 (16M)";
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "zbt-we826:green:power";
+			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+		};
+
+		usb {
+			label = "zbt-we826:green:usb";
+			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+			trigger-sources = <&ohci_port1>, <&ehci_port1>;
+			linux,default-trigger = "usbport";
+		};
+
+		air {
+			label = "zbt-we826:green:wifi";
+			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+		};
+	};
 };
 
 &spi0 {
diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts
index e7cdcab5e9..27613d54d6 100644
--- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts
+++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts
@@ -5,6 +5,27 @@ 
 / {
 	compatible = "zbtlink,zbt-we826-32m", "zbtlink,zbt-we826", "ralink,mt7620a-soc";
 	model = "ZBT-WE826 (32M)";
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "zbt-we826:green:power";
+			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+		};
+
+		usb {
+			label = "zbt-we826:green:usb";
+			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+			trigger-sources = <&ohci_port1>, <&ehci_port1>;
+			linux,default-trigger = "usbport";
+		};
+
+		air {
+			label = "zbt-we826:green:wifi";
+			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+		};
+	};
 };
 
 &spi0 {
diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts
index 243126125b..d8f51f6692 100644
--- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts
+++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts
@@ -7,8 +7,6 @@ 
 	compatible = "zbtlink,zbt-we826-e", "zbtlink,zbt-we826", "ralink,mt7620a-soc";
 	model = "ZBT-WE826-E";
 
-	/delete-node/ leds;
-
 	leds {
 		compatible = "gpio-leds";
 
diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi
index 41c6b07dbd..d66a7baddd 100644
--- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi
+++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi
@@ -17,27 +17,6 @@ 
 		bootargs = "console=ttyS0,115200";
 	};
 
-	leds {
-		compatible = "gpio-leds";
-
-		led_power: power {
-			label = "zbt-we826:green:power";
-			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
-		};
-
-		usb {
-			label = "zbt-we826:green:usb";
-			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
-			trigger-sources = <&ohci_port1>, <&ehci_port1>;
-			linux,default-trigger = "usbport";
-		};
-
-		air {
-			label = "zbt-we826:green:wifi";
-			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
-		};
-	};
-
 	keys {
 		compatible = "gpio-keys";