diff mbox

[v2,3/7] ARM: dts: kirkwood: gpio-leds fixes for linkstation ls-wxl/wsxl

Message ID 1453304038-28345-4-git-send-email-rogershimizu@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Shimizu Jan. 20, 2016, 3:33 p.m. UTC
Make all leds initially to "off" state except power indicator, so pins below
change from active_low to active_high:
  - gpio-leds: "lswxl:red:func" pin
  - gpio-leds: "lswxl:red:hdderr{0,1}" pin

Fixes: e54e4b1b622e ("ARM: dts: add buffalo linkstation ls-wxl/wsxl")
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
---
 arch/arm/boot/dts/kirkwood-lswxl.dts | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Andrew Lunn Jan. 20, 2016, 5:16 p.m. UTC | #1
On Thu, Jan 21, 2016 at 12:33:54AM +0900, Roger Shimizu wrote:
> Make all leds initially to "off" state except power indicator, so pins below
> change from active_low to active_high:

So what happens when you echo 1 to /sys/class/led/lswxl:red:func/brightness ?

1 should turn the LED on, 0 off. This is what
GPIO_ACTIVE_LOW/GPIO_ACTIVE_HIGH is about, and these are independent
of the initial off/on state.

   Andrew

>   - gpio-leds: "lswxl:red:func" pin
>   - gpio-leds: "lswxl:red:hdderr{0,1}" pin
> 
> Fixes: e54e4b1b622e ("ARM: dts: add buffalo linkstation ls-wxl/wsxl")
> Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
> ---
>  arch/arm/boot/dts/kirkwood-lswxl.dts | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-lswxl.dts b/arch/arm/boot/dts/kirkwood-lswxl.dts
> index 0e93f6d19259..f4700a60065b 100644
> --- a/arch/arm/boot/dts/kirkwood-lswxl.dts
> +++ b/arch/arm/boot/dts/kirkwood-lswxl.dts
> @@ -206,18 +206,17 @@
>  
>  		led@5 {
>  			label = "lswxl:red:func";
> -			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
> -			default-state = "keep";
> +			gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
>  		};
>  
>  		led@6 {
>  			label = "lswxl:red:hdderr0";
> -			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
> +			gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
>  		};
>  
>  		led@7 {
>  			label = "lswxl:red:hdderr1";
> -			gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
> +			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
>  		};
>  	};
>  
> -- 
> 2.1.4
>
Roger Shimizu Jan. 21, 2016, 12:16 a.m. UTC | #2
On Thu, Jan 21, 2016 at 2:16 AM, Andrew Lunn <andrew@lunn.ch> wrote:
> On Thu, Jan 21, 2016 at 12:33:54AM +0900, Roger Shimizu wrote:
>> Make all leds initially to "off" state except power indicator, so pins below
>> change from active_low to active_high:
>
> So what happens when you echo 1 to /sys/class/led/lswxl:red:func/brightness ?
>
> 1 should turn the LED on, 0 off. This is what
> GPIO_ACTIVE_LOW/GPIO_ACTIVE_HIGH is about, and these are independent
> of the initial off/on state.

after reboot,
# cat /sys/class/leds/lswxl\:red\:func/brightness
0
# echo 1 > /sys/class/leds/lswxl\:red\:func/brightness

1st command shows the initial value is 0.
2nd command will turn the LED to on state.

I guess board will set the value to 0 when boot, so as
GPIO_ACTIVE_LOW/GPIO_ACTIVE_HIGH can change the initial state of LED.

Cheers,
Roger
Andrew Lunn Jan. 21, 2016, 12:30 a.m. UTC | #3
On Thu, Jan 21, 2016 at 12:33:54AM +0900, Roger Shimizu wrote:
> Make all leds initially to "off" state except power indicator, so pins below
> change from active_low to active_high:
>   - gpio-leds: "lswxl:red:func" pin
>   - gpio-leds: "lswxl:red:hdderr{0,1}" pin

Hi Roger

So the patch is correct, but the changelog is not really correct. Better to say:

The GPIOs controlling the LEDs are active high, not low.

Please resend, and add my:

Reviewd-by: Andrew Lunn <andrew@lunn.ch>

	    Andrew

> 
> Fixes: e54e4b1b622e ("ARM: dts: add buffalo linkstation ls-wxl/wsxl")
> Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
> ---
>  arch/arm/boot/dts/kirkwood-lswxl.dts | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-lswxl.dts b/arch/arm/boot/dts/kirkwood-lswxl.dts
> index 0e93f6d19259..f4700a60065b 100644
> --- a/arch/arm/boot/dts/kirkwood-lswxl.dts
> +++ b/arch/arm/boot/dts/kirkwood-lswxl.dts
> @@ -206,18 +206,17 @@
>  
>  		led@5 {
>  			label = "lswxl:red:func";
> -			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
> -			default-state = "keep";
> +			gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
>  		};
>  
>  		led@6 {
>  			label = "lswxl:red:hdderr0";
> -			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
> +			gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
>  		};
>  
>  		led@7 {
>  			label = "lswxl:red:hdderr1";
> -			gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
> +			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
>  		};
>  	};
>  
> -- 
> 2.1.4
>
diff mbox

Patch

diff --git a/arch/arm/boot/dts/kirkwood-lswxl.dts b/arch/arm/boot/dts/kirkwood-lswxl.dts
index 0e93f6d19259..f4700a60065b 100644
--- a/arch/arm/boot/dts/kirkwood-lswxl.dts
+++ b/arch/arm/boot/dts/kirkwood-lswxl.dts
@@ -206,18 +206,17 @@ 
 
 		led@5 {
 			label = "lswxl:red:func";
-			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
-			default-state = "keep";
+			gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
 		};
 
 		led@6 {
 			label = "lswxl:red:hdderr0";
-			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
 		};
 
 		led@7 {
 			label = "lswxl:red:hdderr1";
-			gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
 		};
 	};