Skip to contentSkip to conversation

ARM: socfpga: Add support for HPS LEDs on SoCKit

PATCH New Marek Vasut 3 participants 5 messages Mar 19, 2016 – Mar 21, 2016 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: socfpga: Add support for HPS LEDs on SoCKit

Add support for the blue LEDs on the SoCFPGA SoCkit board.

---
 arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | 32 +++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +32 -0
index b61f22f..1461690 100644
@@ -39,6 +39,34 @@
 		ethernet0 = &gmac1;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		hps_led0 {
+			label = "hps:blue:led0";
+			gpios = <&portb 24 0>;	/* HPS_GPIO53 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led1 {
+			label = "hps:blue:led1";
+			gpios = <&portb 25 0>;	/* HPS_GPIO54 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led2 {
+			label = "hps:blue:led2";
+			gpios = <&portb 26 0>;	/* HPS_GPIO55 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led3 {
+			label = "hps:blue:led3";
+			gpios = <&portb 27 0>;	/* HPS_GPIO56 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
 	regulator_3_3v: vcc3p3-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "VCC3P3";
@@ -61,6 +89,10 @@
 	rxc-skew-ps = <2000>;
 };
 
+&gpio1 {	/* GPIO 30..57 */
+	status = "okay";
+};
+
 &gpio2 {
 	status = "okay";
 };
Signature · 1 line
2.7.0
#1 lore raw

PATCH 2/2 ARM: socfpga: Add support for HPS KEYs/SWs on SoCKit

Add support for the keys and flip-switches on the SoCFPGA SoCkit board.

---
 arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | 62 ++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +61 -1
index 1461690..02e22f5 100644
@@ -67,6 +67,62 @@
 		};
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		hps_sw0 {
+			label = "hps_sw0";
+			gpios = <&portc 20 0>;	/* HPS_GPI7 */
+			linux,input-type = <5>;	/* EV_SW */
+			linux,code = <0x0>;	/* SW_LID */
+		};
+
+		hps_sw1 {
+			label = "hps_sw1";
+			gpios = <&portc 19 0>;	/* HPS_GPI6 */
+			linux,input-type = <5>;	/* EV_SW */
+			linux,code = <0x5>;	/* SW_DOCK */
+		};
+
+		hps_sw2 {
+			label = "hps_sw2";
+			gpios = <&portc 18 0>;	/* HPS_GPI5 */
+			linux,input-type = <5>;	/* EV_SW */
+			linux,code = <0xa>;	/* SW_KEYPAD_SLIDE */
+		};
+
+		hps_sw3 {
+			label = "hps_sw3";
+			gpios = <&portc 17 0>;	/* HPS_GPI4 */
+			linux,input-type = <5>;	/* EV_SW */
+			linux,code = <0xc>;	/* SW_ROTATE_LOCK */
+		};
+
+		hps_hkey0 {
+			label = "hps_hkey0";
+			gpios = <&portc 21 1>;	/* HPS_GPI8 */
+			linux,code = <187>;	/* KEY_F17 */
+		};
+
+		hps_hkey1 {
+			label = "hps_hkey1";
+			gpios = <&portc 22 1>;	/* HPS_GPI9 */
+			linux,code = <188>;	/* KEY_F18 */
+		};
+
+		hps_hkey2 {
+			label = "hps_hkey2";
+			gpios = <&portc 23 1>;	/* HPS_GPI10 */
+			linux,code = <189>;	/* KEY_F19 */
+		};
+
+		hps_hkey3 {
+			label = "hps_hkey3";
+			gpios = <&portc 24 1>;	/* HPS_GPI11 */
+			linux,code = <190>;	/* KEY_F20 */
+		};
+	};
+
 	regulator_3_3v: vcc3p3-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "VCC3P3";
@@ -89,11 +145,15 @@
 	rxc-skew-ps = <2000>;
 };
 
+&gpio0 {	/* GPIO 0..29 */
+	status = "okay";
+};
+
 &gpio1 {	/* GPIO 30..57 */
 	status = "okay";
 };
 
-&gpio2 {
+&gpio2 {	/* GPIO 58..66 (HLGPI 0..13 at offset 13) */
 	status = "okay";
 };
 
Signature · 1 line
2.7.0
#2 lore raw

PATCH 2/2 ARM: socfpga: Add support for HPS KEYs/SWs on SoCKit

arch/arm/boot/dts/socfpga_cyclone5_sockit.dts

Quoted 12 lines · Marek Vasut

Add support for the keys and flip-switches on the SoCFPGA SoCkit board.

---
 arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | 62 ++++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +0 -0
index 1461690..02e22f5 100644

Both patches applied!

Thanks,
Dinh

#3 lore raw

PATCH 1/2 ARM: socfpga: Add support for HPS LEDs on SoCKit

In reply to Marek Vasut

Hi!

Quoted 34 lines · Marek Vasut

Add support for the blue LEDs on the SoCFPGA SoCkit board.

---
 arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | 32 +++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +18 -0
index b61f22f..1461690 100644
@@ -39,6 +39,34 @@
 		ethernet0 = &gmac1;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		hps_led0 {
+			label = "hps:blue:led0";
+			gpios = <&portb 24 0>;	/* HPS_GPIO53 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led1 {
+			label = "hps:blue:led1";
+			gpios = <&portb 25 0>;	/* HPS_GPIO54 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led2 {
+			label = "hps:blue:led2";
+			gpios = <&portb 26 0>;	/* HPS_GPIO55 */

arch/arm/boot/dts/socfpga_cyclone5_sockit.dts line 69

Quoted 10 lines
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +10 -0
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led3 {
+			label = "hps:blue:led3";
+			gpios = <&portb 27 0>;	/* HPS_GPIO56 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+

I'd personally remove the default-triggers.
Otherwise looks good to me.

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           | Steffen Trumtrar            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw

PATCH 1/2 ARM: socfpga: Add support for HPS LEDs on SoCKit

Quoted 2 lines · Steffen Trumtrar

Hi!

Hi!

Quoted 40 lines
Quoted 38 lines · Marek Vasut

Add support for the blue LEDs on the SoCFPGA SoCkit board.

---
 arch/arm/boot/dts/socfpga_cyclone5_sockit.dts | 32 +++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +22 -0
index b61f22f..1461690 100644
@@ -39,6 +39,34 @@
 		ethernet0 = &gmac1;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		hps_led0 {
+			label = "hps:blue:led0";
+			gpios = <&portb 24 0>;	/* HPS_GPIO53 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led1 {
+			label = "hps:blue:led1";
+			gpios = <&portb 25 0>;	/* HPS_GPIO54 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led2 {
+			label = "hps:blue:led2";
+			gpios = <&portb 26 0>;	/* HPS_GPIO55 */
+			linux,default-trigger = "heartbeat";
+		};
+
+		hps_led3 {
Quoted 8 lines

arch/arm/boot/dts/socfpga_cyclone5_sockit.dts line 69

Quoted 6 lines
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +6 -0
+			label = "hps:blue:led3";
+			gpios = <&portb 27 0>;	/* HPS_GPIO56 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+

I'd personally remove the default-triggers.

At least the LEDs appear to do something and are not completely dead, but either way is fine with me. The heartbeat effect is also not amusing.

Quoted 1 line

Otherwise looks good to me.

Thanks for the review :)

Signature · 2 lines
Best regards,
Marek Vasut