Skip to contentSkip to conversation

ARM: dts: i.MX51 babbage: Support diagnostic LED

PATCH New Liu Ying 3 participants 6 messages Feb 4, 2014 – Feb 10, 2014

Subsystems (2)
lore
Share & tools
lore

Liu Ying

author
#0 lore raw

PATCH 1/1 ARM: dts: i.MX51 babbage: Support diagnostic LED

The D25 LED controlled by gpio on the i.MX51 babbage board is a diagnostic LED according to the board design. This patch adds the relevant device tree nodes to the i.MX51 babbage device tree file to support this LED.

---
 arch/arm/boot/dts/imx51-babbage.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/boot/dts/imx51-babbage.dts +17 -0
index be1407c..8d6a74b 100644
@@ -81,6 +81,17 @@
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pin_gpio2_6>;
+
+		led-diagnostic {
+			label = "diagnostic";
+			gpios = <&gpio2 6 0>;
+		};
+	};
+
 	sound {
 		compatible = "fsl,imx51-babbage-sgtl5000",
 			     "fsl,imx-audio-sgtl5000";
@@ -280,6 +291,12 @@
 				MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000
 			>;
 		};
+
+		led_pin_gpio2_6: led_gpio2_6 {
+			fsl,pins = <
+				MX51_PAD_EIM_D22__GPIO2_6 0x80000000
+			>;
+		};
 	};
 };
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: dts: i.MX51 babbage: Support diagnostic LED

Quoted 16 lines · Liu Ying

The D25 LED controlled by gpio on the i.MX51 babbage board is a diagnostic LED according to the board design. This patch adds the relevant device tree nodes to the i.MX51 babbage device tree file to support this LED.

---
 arch/arm/boot/dts/imx51-babbage.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/boot/dts/imx51-babbage.dts +0 -0
index be1407c..8d6a74b 100644
@@ -81,6 +81,17 @@
 		};

arch/arm/boot/dts/imx51-babbage.dts line 91

Quoted 10 lines
arch/arm/boot/dts/imx51-babbage.dts +8 -0
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pin_gpio2_6>;
+
+		led-diagnostic {
+			label = "diagnostic";
+			gpios = <&gpio2 6 0>;

Just out of curiosity, how will you use/trigger the led?

arch/arm/boot/dts/imx51-babbage.dts line 295

Quoted 12 lines
arch/arm/boot/dts/imx51-babbage.dts +5 -0
+		};
+	};
+
 	sound {
 		compatible = "fsl,imx51-babbage-sgtl5000",
 			     "fsl,imx-audio-sgtl5000";
@@ -280,6 +291,12 @@
 				MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000
 			>;
 		};
+
+		led_pin_gpio2_6: led_gpio2_6 {

This might be copied from some existing file, but I would hope the name can be more generic, something like the following

	pinctrl_gpio_leds: gpioledsgrp {

, so that when we have more gpio controlled leds to add, we can just add more pins into the same group without concerning the name.

Shawn

Quoted 11 lines
arch/arm/boot/dts/imx51-babbage.dts +4 -0
+			fsl,pins = <
+				MX51_PAD_EIM_D22__GPIO2_6 0x80000000
+			>;
+		};
 	};
 };
 
Signature · 1 line
1.7.9.5
#2 lore raw

???????????, 10 ??????? 2014, 11:02 +08:00 ?? Shawn Guo <[email protected]>:

Quoted 20 lines · Liu Ying

Review

Quoted 11 lines

The D25 LED controlled by gpio on the i.MX51 babbage board is a diagnostic LED according to the board design. This patch adds the relevant device tree nodes to the i.MX51 babbage device tree file to support this LED.

---
 arch/arm/boot/dts/imx51-babbage.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/imx51-babbage.dts

Quoted 7 lines

index be1407c..8d6a74b 100644

arch/arm/boot/dts/imx51-babbage.dts +0 -0
@@ -81,6 +81,17 @@
 		};
 	};
 
Quoted 10 lines

arch/arm/boot/dts/imx51-babbage.dts line 91

Quoted 8 lines
arch/arm/boot/dts/imx51-babbage.dts +8 -0
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pin_gpio2_6>;
+
+		led-diagnostic {
+			label = "diagnostic";
+			gpios = <&gpio2 6 0>;

Just out of curiosity, how will you use/trigger the led?

And GPIO bindings should be used to specify active level, GPIO_ACTIVE_HIGH in this case.

---

author
#3 lore raw

PATCH 1/1 ARM: dts: i.MX51 babbage: Support diagnostic LED

Quoted 32 lines · Alexander Shiyan

???????????, 10 ??????? 2014, 11:02 +08:00 ?? Shawn Guo <[email protected]>:

Quoted 20 lines · Liu Ying

Review

Quoted 11 lines

The D25 LED controlled by gpio on the i.MX51 babbage board is a diagnostic LED according to the board design. This patch adds the relevant device tree nodes to the i.MX51 babbage device tree file to support this LED.

---
 arch/arm/boot/dts/imx51-babbage.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/imx51-babbage.dts

Quoted 7 lines

index be1407c..8d6a74b 100644

arch/arm/boot/dts/imx51-babbage.dts +0 -0
@@ -81,6 +81,17 @@
 		};
 	};
 
Quoted 10 lines

arch/arm/boot/dts/imx51-babbage.dts line 91

Quoted 8 lines
arch/arm/boot/dts/imx51-babbage.dts +8 -0
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pin_gpio2_6>;
+
+		led-diagnostic {
+			label = "diagnostic";
+			gpios = <&gpio2 6 0>;

Just out of curiosity, how will you use/trigger the led?

Quoted 2 lines

And GPIO bindings should be used to specify active level, GPIO_ACTIVE_HIGH in this case.

Based on Linux 3.14-rc2, this gives me no single output:
grep GPIO_ACTIVE arch/arm/boot/dts/ -nr | grep imx

So, this patch follows the old approach.

I agree to use GPIO_ACTIVE_HIGH/GPIO_ACTIVE_LOW macros. How about generating dedicated patch sets for this purpose? Actually, I had one set for i.MX51 platforms.

Regards,
Liu Ying

#4 lore raw

PATCH 1/1 ARM: dts: i.MX51 babbage: Support diagnostic LED

Quoted 15 lines · Liu Ying
Quoted 15 lines
Quoted 14 lines

arch/arm/boot/dts/imx51-babbage.dts line 91

Quoted 12 lines
arch/arm/boot/dts/imx51-babbage.dts +8 -0
@@ -81,6 +81,17 @@
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pin_gpio2_6>;
+
+		led-diagnostic {
+			label = "diagnostic";
+			gpios = <&gpio2 6 0>;

Just out of curiosity, how will you use/trigger the led?

Quoted 5 lines
Quoted 2 lines

And GPIO bindings should be used to specify active level, GPIO_ACTIVE_HIGH in this case.

Based on Linux 3.14-rc2, this gives me no single output:
grep GPIO_ACTIVE arch/arm/boot/dts/ -nr | grep imx

If you grep linux-next, you will find quite a few.

Quoted 6 lines

So, this patch follows the old approach.

I agree to use GPIO_ACTIVE_HIGH/GPIO_ACTIVE_LOW macros. How about generating dedicated patch sets for this purpose? Actually, I had one set for i.MX51 platforms.

I prefer to have this change in the same patch.

Shawn

author
#5 lore raw

PATCH 1/1 ARM: dts: i.MX51 babbage: Support diagnostic LED

In reply to Shawn Guo
Quoted 19 lines · Shawn Guo
Quoted 18 lines · Liu Ying

The D25 LED controlled by gpio on the i.MX51 babbage board is a diagnostic LED according to the board design. This patch adds the relevant device tree nodes to the i.MX51 babbage device tree file to support this LED.

---
 arch/arm/boot/dts/imx51-babbage.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/boot/dts/imx51-babbage.dts +0 -0
index be1407c..8d6a74b 100644
@@ -81,6 +81,17 @@
 		};
 	};
 
Quoted 11 lines

arch/arm/boot/dts/imx51-babbage.dts line 91

Quoted 8 lines
arch/arm/boot/dts/imx51-babbage.dts +8 -0
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pin_gpio2_6>;
+
+		led-diagnostic {
+			label = "diagnostic";
+			gpios = <&gpio2 6 0>;

Just out of curiosity, how will you use/trigger the led?

Switch on the LED:
echo 1 > /sys/class/leds/diagnostic/brightness

Switch off the LED:
echo 0 > /sys/class/leds/diagnostic/brightness

Quoted 16 lines

arch/arm/boot/dts/imx51-babbage.dts line 295

Quoted 12 lines
arch/arm/boot/dts/imx51-babbage.dts +5 -0
+		};
+	};
+
 	sound {
 		compatible = "fsl,imx51-babbage-sgtl5000",
 			     "fsl,imx-audio-sgtl5000";
@@ -280,6 +291,12 @@
 				MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000
 			>;
 		};
+
+		led_pin_gpio2_6: led_gpio2_6 {

This might be copied from some existing file, but I would hope the name can be more generic, something like the following

Quoted 5 lines
	pinctrl_gpio_leds: gpioledsgrp {

, so that when we have more gpio controlled leds to add, we can just add more pins into the same group without concerning the name.

Agree. I will address this comment in patch v2. Thanks!

Regards,
Liu Ying

Quoted 13 lines
Quoted 12 lines
arch/arm/boot/dts/imx51-babbage.dts +4 -0
+			fsl,pins = <
+				MX51_PAD_EIM_D22__GPIO2_6 0x80000000
+			>;
+		};
 	};
 };
 
Signature · 1 line
1.7.9.5