Skip to contentSkip to conversation

ARM: socfpga: socrates: enable gpio0/1

PATCH New Steffen Trumtrar 2 participants 5 messages May 29, 2015 – Jun 2, 2015 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: socfpga: socrates: enable gpio0/1

Enable the gpio0+1 controller.

---
 arch/arm/boot/dts/socfpga_cyclone5_socrates.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +8 -0
index a1814b457450..a81f33deaa3a 100644
@@ -36,6 +36,14 @@
 	status = "okay";
 };
 
+&gpio0 {
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
 &i2c0 {
 	status = "okay";
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 ARM: socfpga: socrates: add gpio-leds

The SOCrates has three HPS LEDs that can be turned on/off via gpio. Use the first one has heartbeat and add the other two as free LEDs.

---
 arch/arm/boot/dts/socfpga_cyclone5_socrates.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +23 -0
index a81f33deaa3a..019dd2fea208 100644
@@ -30,6 +30,9 @@
 		device_type = "memory";
 		reg = <0x0 0x40000000>; /* 1GB */
 	};
+
+	leds: gpio-leds {
+	};
 };
 
 &gmac1 {
@@ -53,6 +56,26 @@
 	};
 };
 
+&leds {
+	compatible = "gpio-leds";
+
+	led at 0 {
+		label = "led:green:heartbeat";
+		gpios = <&porta 28 1>;
+		linux,default-trigger = "heartbeat";
+	};
+
+	led at 1 {
+		label = "led:green:D7";
+		gpios = <&portb 19 1>;
+	};
+
+	led at 2 {
+		label = "led:green:D8";
+		gpios = <&portb 25 1>;
+	};
+};
+
 &mmc {
 	status = "okay";
 };
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/2 ARM: socfpga: socrates: add gpio-leds

Quoted 13 lines · Steffen Trumtrar

The SOCrates has three HPS LEDs that can be turned on/off via gpio. Use the first one has heartbeat and add the other two as free LEDs.

---
 arch/arm/boot/dts/socfpga_cyclone5_socrates.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +0 -0
index a81f33deaa3a..019dd2fea208 100644

arch/arm/boot/dts/socfpga_cyclone5_socrates.dts line 34

Quoted 5 lines
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +2 -0
@@ -30,6 +30,9 @@
 		device_type = "memory";
 		reg = <0x0 0x40000000>; /* 1GB */
 	};
+
+	leds: gpio-leds {

Wonder if you should just place all the led nodes under here instead of under the "&leds"?

Quoted 22 lines
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +14 -0
+	};
 };
 
 &gmac1 {
@@ -53,6 +56,26 @@
 	};
 };
 
+&leds {
+	compatible = "gpio-leds";
+
+	led at 0 {
+		label = "led:green:heartbeat";
+		gpios = <&porta 28 1>;
+		linux,default-trigger = "heartbeat";
+	};
+
+	led at 1 {
+		label = "led:green:D7";
+		gpios = <&portb 19 1>;
+	};

arch/arm/boot/dts/socfpga_cyclone5_socrates.dts line 81

Quoted 10 lines
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +7 -0
+
+	led at 2 {
+		label = "led:green:D8";
+		gpios = <&portb 25 1>;
+	};
+};
+
 &mmc {
 	status = "okay";
 };

Dinh

#3 lore raw

PATCH 2/2 ARM: socfpga: socrates: add gpio-leds

Quoted 9 lines · Dinh Nguyen
Quoted 8 lines · Steffen Trumtrar

The SOCrates has three HPS LEDs that can be turned on/off via gpio. Use the first one has heartbeat and add the other two as free LEDs.

---
 arch/arm/boot/dts/socfpga_cyclone5_socrates.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
Quoted 14 lines

arch/arm/boot/dts/socfpga_cyclone5_socrates.dts line 34

Quoted 10 lines
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +2 -0
index a81f33deaa3a..019dd2fea208 100644
@@ -30,6 +30,9 @@
 		device_type = "memory";
 		reg = <0x0 0x40000000>; /* 1GB */
 	};
+
+	leds: gpio-leds {

Wonder if you should just place all the led nodes under here instead of under the "&leds"?

patch applied as is.

Thanks,
Dinh

Applied
#4 lore raw

PATCH 1/2 ARM: socfpga: socrates: enable gpio0/1

In reply to Steffen Trumtrar
Quoted 17 lines · Steffen Trumtrar

Enable the gpio0+1 controller.

---
 arch/arm/boot/dts/socfpga_cyclone5_socrates.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +1 -0
index a1814b457450..a81f33deaa3a 100644
@@ -36,6 +36,14 @@
 	status = "okay";
 };
 
+&gpio0 {

arch/arm/boot/dts/socfpga_cyclone5_socrates.dts line 49

Quoted 10 lines
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts +7 -0
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
 &i2c0 {
 	status = "okay";
 

Applied.

Thanks,
Dinh