Skip to contentSkip to conversation

ARM: mvebu/kirkwood: NETGEAR ReadyNAS .dts files cleanup

PATCH Superseded Arnaud Ebalard 2 participants 8 messages Nov 29, 2013 – Dec 1, 2013 Device tree bindings

lore
Share & tools
lore
#0 lore raw

v2 cover ARM: mvebu/kirkwood: NETGEAR ReadyNAS .dts files cleanup

Hi,

This series provides some cleanup for all NETGEAR ReadyNAS .dts files (Duo v2, 102 and 104). This is mostly based on suggestions from Sebastian during RN2120 .dts submission. Jason, two remarks:

- Patch 1/4 applies on top of previous gpio-poweroff patch for Duo v2
- Patch 3/4 applies on NXP PCA 9554 patch for RN104

As requested, last patch (4/4) contains whitespace cleanups for those .dts (in fact, mainly Duo v2 and a single hunk for RN102).

This v2 mainly removes PHY compatible strings for simple comments.

Comments welcome,

Cheers,

a+

Arnaud Ebalard (4):
ARM: kirkwood: NETGEAR ReadyNAS Duo v2 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 102 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 104 .dts cleanup
ARM: Fix whitespaces in NETGEAR ReadyNAS .dts files

 arch/arm/boot/dts/armada-370-netgear-rn102.dts     | 82 ++++++++++--------
 arch/arm/boot/dts/armada-370-netgear-rn104.dts     | 68 +++++++--------
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  | 99 +++++++++++++---------
 3 files changed, 141 insertions(+), 108 deletions(-)
Signature · 1 line
1.8.4.4
#1 lore raw

PATCH v2 1/4 ARM: kirkwood: NETGEAR ReadyNAS Duo v2 .dts cleanup

The patch does some cleanup work on NETGEAR ReadyNAS Duo v2 .dts file. Changes are listed below:

- Converted from value to macros for GPIO voltage level
- Converted all numeric input key values to macros
- Made button names more explicit
- Document ethernet PHY (Marvell 88E1318) via a comment
- Added header for the file to describe content and author
- Made G762 clock node name unique by including g762 in it
- Fixed all node names and labels to use respectively '-' and '_'
- Changed order of included files from general to local
- Removed useless clocks and gpio-keys properties

---
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  | 51 ++++++++++++----------
 1 file changed, 29 insertions(+), 22 deletions(-)
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts +29 -22
index 551bfed..03bb136 100644
@@ -1,5 +1,17 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS Duo v2
+ *
+ * Copyright (C) 2013, Arnaud EBALARD <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
 /dts-v1/;
 
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
 #include "kirkwood.dtsi"
 #include "kirkwood-6282.dtsi"
@@ -68,10 +80,7 @@
 		};
 
 		clocks {
-		       #address-cells = <1>;
-		       #size-cells = <0>;
-
-		       g762_clk: fixedclk {
+		       g762_clk: g762-oscillator {
 				 compatible = "fixed-clock";
 				 #clock-cells = <0>;
 				 clock-frequency = <8192>;
@@ -117,49 +126,47 @@
 
 		power_led {
 			label = "status:blue:power_led";
-			gpios = <&gpio0 31 1>;   /* GPIO 31 Active Low */
+			gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "default-on";
 		};
 		activity_led {
 			label = "status:blue:activity_led";
-			gpios = <&gpio1 6 1>;    /* GPIO 38 Active Low */
+			gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
 		};
 		disk1_led {
 			label = "status:blue:disk1_led";
-			gpios = <&gpio0 23 1>;   /* GPIO 23 Active Low */
+			gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
 		};
 		disk2_led {
 			label = "status:blue:disk2_led";
-			gpios = <&gpio0 22 1>;   /* GPIO 22 Active Low */
+			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
 		};
 		backup_led {
 			label = "status:blue:backup_led";
-			gpios = <&gpio0 29 1>;   /* GPIO 29 Active Low*/
+			gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
 		};
 	};
 
-	gpio_keys {
+	gpio-keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
 		pinctrl-0 = <&pmx_button_power &pmx_button_backup
 			     &pmx_button_reset>;
 		pinctrl-names = "default";
 
-		button at 1 {
+		power-button {
 			label = "Power Button";
-			linux,code = <116>;     /* KEY_POWER */
-			gpios = <&gpio1 15 1>;
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
 		};
-		button at 2 {
+		reset-button {
 			label = "Reset Button";
-			linux,code = <0x198>;   /* KEY_RESTART */
-			gpios = <&gpio0 13 1>;
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
 		};
-		button at 3 {
+		backup-button {
 			label = "Backup Button";
-			linux,code = <133>;     /* KEY_COPY */
-			gpios = <&gpio1 13 1>;
+			linux,code = <KEY_COPY>;
+			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
 		};
 	};
 
@@ -222,7 +229,7 @@
 &mdio {
 	status = "okay";
 
-	ethphy0: ethernet-phy at 0 {
+	ethphy0: ethernet-phy at 0 { /* Marvell 88E1318 */
 		device_type = "ethernet-phy";
 		reg = <0>;
 	};
Signature · 1 line
1.8.4.4
#2 lore raw

PATCH v2 2/4 ARM: mvebu: NETGEAR ReadyNAS 102 .dts cleanup

In reply to Arnaud Ebalard

The patch does some cleanup work on NETGEAR ReadyNAS 102 .dts file. Changes are listed below

- Added missing button mpp in pinctrl
- Converted from value to macros for GPIO voltage level
- Converted all numeric input key values to macros
- Added GPIO keys pins to pinctrl
- Made button names more explicit
- Document ethernet PHY (Marvell 88E1318) via a comment
- Made G762 clock node name unique by including g762 in it
- Fixed all node names and labels to use respectively '-' and '_'
- Changed order of included files from general to local
- Removed useless clocks and gpio-keys properties

---
 arch/arm/boot/dts/armada-370-netgear-rn102.dts | 81 +++++++++++++++-----------
 1 file changed, 48 insertions(+), 33 deletions(-)
arch/arm/boot/dts/armada-370-netgear-rn102.dts +48 -33
index 8ac2ac1..6411105 100644
@@ -11,6 +11,8 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
 #include "armada-370.dtsi"
 
 / {
@@ -77,6 +79,21 @@
 					marvell,function = "gpio";
 				};
 
+				backup_button_pin: backup-button-pin {
+					marvell,pins = "mpp58";
+					marvell,function = "gpio";
+				};
+
+				power_button_pin: power-button-pin {
+					marvell,pins = "mpp62";
+					marvell,function = "gpio";
+				};
+
+				reset_button_pin: reset-button-pin {
+					marvell,pins = "mpp6";
+					marvell,function = "gpio";
+				};
+
 				poweroff: poweroff {
 					marvell,pins = "mpp8";
 					marvell,function = "gpio";
@@ -84,7 +101,7 @@
 			};
 
 			mdio {
-				phy0: ethernet-phy at 0 {
+				phy0: ethernet-phy at 0 { /* Marvell 88E1318 */
 					reg = <0>;
 				};
 			};
@@ -117,78 +134,76 @@
 	};
 
 	clocks {
-	       #address-cells = <1>;
-	       #size-cells = <0>;
-
-	       g762_clk: fixedclk {
+	       g762_clk: g762-oscillator {
 			 compatible = "fixed-clock";
 			 #clock-cells = <0>;
 			 clock-frequency = <8192>;
 	       };
 	};
 
-	gpio_leds {
+	gpio-leds {
 		compatible = "gpio-leds";
-		pinctrl-0 = < &power_led_pin
-			      &sata1_led_pin
-			      &sata2_led_pin
-			      &backup_led_pin >;
+		pinctrl-0 = <&power_led_pin
+			     &sata1_led_pin
+			     &sata2_led_pin
+			     &backup_led_pin>;
 		pinctrl-names = "default";
 
-		blue_power_led {
+		blue-power-led {
 			label = "rn102:blue:pwr";
-			gpios = <&gpio1 25 1>;  /* GPIO 57 Active Low */
+			gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "heartbeat";
 		};
 
-		green_sata1_led {
+		green-sata1-led {
 			label = "rn102:green:sata1";
-			gpios = <&gpio0 15 1>;  /* GPIO 15 Active Low */
+			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
 			default-state = "on";
 		};
 
-		green_sata2_led {
+		green-sata2-led {
 			label = "rn102:green:sata2";
-			gpios = <&gpio0 14 1>;   /* GPIO 14 Active Low */
+			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
 			default-state = "on";
 		};
 
-		green_backup_led {
+		green-backup-led {
 			label = "rn102:green:backup";
-			gpios = <&gpio1 24 1>;   /* GPIO 56 Active Low */
+			gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
 			default-state = "on";
 		};
 	};
 
-	gpio_keys {
+	gpio-keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		pinctrl-0 = <&power_button_pin
+			     &reset_button_pin
+			     &backup_button_pin>;
+		pinctrl-names = "default";
 
-		button at 1 {
+		power-button {
 			label = "Power Button";
-			linux,code = <116>;     /* KEY_POWER */
-			gpios = <&gpio1 30 0>;
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
 		};
 
-		button at 2 {
+		reset-button {
 			label = "Reset Button";
-			linux,code = <0x198>;   /* KEY_RESTART */
-			gpios = <&gpio0 6 1>;
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 		};
 
-		button at 3 {
+		backup-button {
 			label = "Backup Button";
-			linux,code = <133>;     /* KEY_COPY */
-			gpios = <&gpio1 26 1>;
+			linux,code = <KEY_COPY>;
+			gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
 		};
 	};
 
-	gpio_poweroff {
+	gpio-poweroff {
 		compatible = "gpio-poweroff";
 		pinctrl-0 = <&poweroff>;
 		pinctrl-names = "default";
-		gpios = <&gpio0 8 1>;
+		gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
 	};
-
 };
Signature · 1 line
1.8.4.4
#3 lore raw

PATCH v2 3/4 ARM: mvebu: NETGEAR ReadyNAS 104 .dts cleanup

In reply to Arnaud Ebalard

The patch does some cleanup work on NETGEAR ReadyNAS 104 .dts file. Changes are listed below:

- Completed conversion from value to macros for GPIO voltage level
- Converted all numeric input key values to macros
- Fixed all node names and labels to use respectively '-' and '_'
- Made button names more explicit
- Changed order of included files from general to local
- Removed useless clocks and gpio-keys properties
- Document ethernet PHY (Marvell 88E1318) via a comment
- Made G762 clock node name unique by including g762 in it

---
 arch/arm/boot/dts/armada-370-netgear-rn104.dts | 68 ++++++++++++--------------
 1 file changed, 32 insertions(+), 36 deletions(-)
arch/arm/boot/dts/armada-370-netgear-rn104.dts +32 -36
index 50b5150..e48e5fb 100644
@@ -11,8 +11,9 @@
 
 /dts-v1/;
 
-#include "armada-370.dtsi"
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include "armada-370.dtsi"
 
 / {
 	model = "NETGEAR ReadyNAS 104";
@@ -59,12 +60,12 @@
 					marvell,function = "gpio";
 				};
 
-				backup_key_pin: backup-key-pin {
+				backup_button_pin: backup-button-pin {
 					marvell,pins = "mpp52";
 					marvell,function = "gpio";
 				};
 
-				power_key_pin: power-key-pin {
+				power_button_pin: power-button-pin {
 					marvell,pins = "mpp62";
 					marvell,function = "gpio";
 				};
@@ -79,18 +80,18 @@
 					marvell,function = "gpio";
 				};
 
-				reset_key_pin: reset-key-pin {
+				reset_button_pin: reset-button-pin {
 					marvell,pins = "mpp65";
 					marvell,function = "gpio";
 				};
 			};
 
 			mdio {
-				phy0: ethernet-phy at 0 {
+				phy0: ethernet-phy at 0 { /* Marvell 88E1318 */
 					reg = <0>;
 				};
 
-				phy1: ethernet-phy at 1 {
+				phy1: ethernet-phy at 1 { /* Marvell 88E1318 */
 					reg = <1>;
 				};
 			};
@@ -136,90 +137,85 @@
 	};
 
 	clocks {
-	       #address-cells = <1>;
-	       #size-cells = <0>;
-
-	       g762_clk: fixedclk {
+	       g762_clk: g762-oscillator {
 			 compatible = "fixed-clock";
 			 #clock-cells = <0>;
 			 clock-frequency = <8192>;
 	       };
 	};
 
-	gpio_leds {
+	gpio-leds {
 		compatible = "gpio-leds";
 		pinctrl-0 = <&backup_led_pin &power_led_pin>;
 		pinctrl-names = "default";
 
-		blue_backup_led {
+		blue-backup-led {
 			label = "rn104:blue:backup";
-			gpios = <&gpio1 31 0>;   /* GPIO 63 Active High */
+			gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
 			default-state = "off";
 		};
 
-		blue_power_led {
+		blue-power-led {
 			label = "rn104:blue:pwr";
-			gpios = <&gpio2 0 1>;    /* GPIO 64 Active Low */
+			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "keep";
 		};
 
-		sata1_led {
+		blue-sata1-led {
 			label = "rn104:blue:sata1";
 			gpios = <&pca9554 0 GPIO_ACTIVE_LOW>;
 			default-state = "off";
 		};
 
-		sata2_led {
+		blue-sata2-led {
 			label = "rn104:blue:sata2";
 			gpios = <&pca9554 1 GPIO_ACTIVE_LOW>;
 			default-state = "off";
 		};
 
-		sata3_led {
+		blue-sata3-led {
 			label = "rn104:blue:sata3";
 			gpios = <&pca9554 2 GPIO_ACTIVE_LOW>;
 			default-state = "off";
 		};
 
-		sata4_led {
+		blue-sata4-led {
 			label = "rn104:blue:sata4";
 			gpios = <&pca9554 3 GPIO_ACTIVE_LOW>;
 			default-state = "off";
 		};
 	};
 
-	gpio_keys {
+	gpio-keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		pinctrl-0 = <&backup_key_pin
-			     &power_key_pin
-			     &reset_key_pin>;
+		pinctrl-0 = <&backup_button_pin
+			     &power_button_pin
+			     &reset_button_pin>;
 		pinctrl-names = "default";
 
-		button at 1 {
+		backup-button {
 			label = "Backup Button";
-			linux,code = <133>;     /* KEY_COPY */
-			gpios = <&gpio1 20 1>;
+			linux,code = <KEY_COPY>;
+			gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
 		};
 
-		button at 2 {
+		power-button {
 			label = "Power Button";
-			linux,code = <116>;     /* KEY_POWER */
-			gpios = <&gpio1 30 0>;
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
 		};
 
-		button at 3 {
+		reset-button {
 			label = "Reset Button";
-			linux,code = <0x198>;   /* KEY_RESTART */
-			gpios = <&gpio2 1 1>;
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
 		};
 	};
 
-	gpio_poweroff {
+	gpio-poweroff {
 		compatible = "gpio-poweroff";
 		pinctrl-0 = <&poweroff>;
 		pinctrl-names = "default";
-		gpios = <&gpio1 28 1>;
+		gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
 	};
 };
Signature · 1 line
1.8.4.4
#4 lore raw

PATCH v2 4/4 ARM: Fix whitespaces in NETGEAR ReadyNAS .dts files

In reply to Arnaud Ebalard

This patch provides some whitespace cleanup for NETGEAR ReadyNAS Duo v2 and 102 .dts files:

- Fixed bad spaces
- Added some space between nodes to improve readability

---
 arch/arm/boot/dts/armada-370-netgear-rn102.dts     |  1 +
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  | 48 ++++++++++++++--------
 2 files changed, 32 insertions(+), 17 deletions(-)
arch/arm/boot/dts/armada-370-netgear-rn102.dts +1 -0
index 6411105..29541a4 100644
@@ -64,6 +64,7 @@
 					marvell,pins = "mpp57";
 					marvell,function = "gpio";
 				};
+
 				sata1_led_pin: sata1-led-pin {
 					marvell,pins = "mpp15";
 					marvell,function = "gpio";
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts +31 -17

117 lines not on this page · raw message

Signature · 1 line
1.8.4.4
#5 lore raw

v2 cover ARM: mvebu/kirkwood: NETGEAR ReadyNAS .dts files cleanup

In reply to Arnaud Ebalard
Quoted 26 lines · Arnaud Ebalard

Hi,

This series provides some cleanup for all NETGEAR ReadyNAS .dts files (Duo v2, 102 and 104). This is mostly based on suggestions from Sebastian during RN2120 .dts submission. Jason, two remarks:

- Patch 1/4 applies on top of previous gpio-poweroff patch for Duo v2
- Patch 3/4 applies on NXP PCA 9554 patch for RN104

As requested, last patch (4/4) contains whitespace cleanups for those .dts (in fact, mainly Duo v2 and a single hunk for RN102).

This v2 mainly removes PHY compatible strings for simple comments.

Comments welcome,

Cheers,

a+

Arnaud Ebalard (4):
ARM: kirkwood: NETGEAR ReadyNAS Duo v2 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 102 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 104 .dts cleanup
ARM: Fix whitespaces in NETGEAR ReadyNAS .dts files

Quoted 4 lines
 arch/arm/boot/dts/armada-370-netgear-rn102.dts     | 82 ++++++++++--------
 arch/arm/boot/dts/armada-370-netgear-rn104.dts     | 68 +++++++--------
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  | 99 +++++++++++++---------
 3 files changed, 141 insertions(+), 108 deletions(-)

whole series applied to mvebu/dt. There was a small conflict with Sebastian's pinctrl work. Please double check and let me know if anything is amiss.

thx,

Jason.

#6 lore raw

v2 cover ARM: mvebu/kirkwood: NETGEAR ReadyNAS .dts files cleanup

Quoted 6 lines · Jason Cooper
Quoted 6 lines

Arnaud Ebalard (4):
ARM: kirkwood: NETGEAR ReadyNAS Duo v2 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 102 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 104 .dts cleanup
ARM: Fix whitespaces in NETGEAR ReadyNAS .dts files

Quoted 8 lines
Quoted 4 lines
 arch/arm/boot/dts/armada-370-netgear-rn102.dts     | 82 ++++++++++--------
 arch/arm/boot/dts/armada-370-netgear-rn104.dts     | 68 +++++++--------
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  | 99 +++++++++++++---------
 3 files changed, 141 insertions(+), 108 deletions(-)

whole series applied to mvebu/dt. There was a small conflict with Sebastian's pinctrl work. Please double check and let me know if anything is amiss.

All three .dts files look as they should in your branch.

#7 lore raw

v2 cover ARM: mvebu/kirkwood: NETGEAR ReadyNAS .dts files cleanup

Quoted 14 lines · Arnaud Ebalard
Quoted 11 lines · Jason Cooper
Quoted 10 lines

Arnaud Ebalard (4):
ARM: kirkwood: NETGEAR ReadyNAS Duo v2 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 102 .dts cleanup
ARM: mvebu: NETGEAR ReadyNAS 104 .dts cleanup
ARM: Fix whitespaces in NETGEAR ReadyNAS .dts files

 arch/arm/boot/dts/armada-370-netgear-rn102.dts     | 82 ++++++++++--------
 arch/arm/boot/dts/armada-370-netgear-rn104.dts     | 68 +++++++--------
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  | 99 +++++++++++++---------
 3 files changed, 141 insertions(+), 108 deletions(-)
Quoted 5 lines
Quoted 3 lines

whole series applied to mvebu/dt. There was a small conflict with Sebastian's pinctrl work. Please double check and let me know if anything is amiss.

All three .dts files look as they should in your branch.

Great!

thx,

Jason.