All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Willy Tarreau <w@1wt.eu>
Subject: ARM: dts: rockchip: fix the MiQi board's LED definition
Date: Sat, 11 Feb 2017 09:56:45 +0100	[thread overview]
Message-ID: <1486803405-14625-1-git-send-email-w@1wt.eu> (raw)

The MiQi board's green LED doesn't work at all with the mainline kernel.
There are multiple reasons to this. First, the gpio number is wrong, it
is declared on gpio220 (chip 7 pin 4) instead of gpio218 (chip 7 pin 2).
Second, a pinctrl is referenced, also declared with the same wrong value
while it is not unused. Third, the GPIO polarity was wrong (active low
instead of active high) with the default value set to "default-on",
resulting in the LED being turned off even when the GPIO is correct.

This patch fixes all these inconsistencies at once since these they are
related to each other, and also restores the "timer" trigger which is
the same as the one used by the kernels shipped with the board.

It's important to note that during the port to mainline, the led's label
was changed from "System" to "miqi:green:user", so scripts making use of
the name will still not work until they're fixed.

Fixes: 162718c (v4.7)
Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 arch/arm/boot/dts/rk3288-miqi.dts | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index f751372..2f4c635 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -68,11 +68,9 @@
 		compatible = "gpio-leds";
 
 		work {
-			gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
 			label = "miqi:green:user";
-			linux,default-trigger = "default-on";
-			pinctrl-names = "default";
-			pinctrl-0 = <&led_ctl>;
+			linux,default-trigger = "timer";
 		};
 	};
 
@@ -363,12 +361,6 @@
 		};
 	};
 
-	leds {
-		led_ctl: led-ctl {
-			rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
-		};
-	};
-
 	sdmmc {
 		/*
 		 * Default drive strength isn't enough to achieve even
-- 
2.8.0.rc2.1.gbe9624a

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: w@1wt.eu (Willy Tarreau)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM: dts: rockchip: fix the MiQi board's LED definition
Date: Sat, 11 Feb 2017 09:56:45 +0100	[thread overview]
Message-ID: <1486803405-14625-1-git-send-email-w@1wt.eu> (raw)

The MiQi board's green LED doesn't work at all with the mainline kernel.
There are multiple reasons to this. First, the gpio number is wrong, it
is declared on gpio220 (chip 7 pin 4) instead of gpio218 (chip 7 pin 2).
Second, a pinctrl is referenced, also declared with the same wrong value
while it is not unused. Third, the GPIO polarity was wrong (active low
instead of active high) with the default value set to "default-on",
resulting in the LED being turned off even when the GPIO is correct.

This patch fixes all these inconsistencies at once since these they are
related to each other, and also restores the "timer" trigger which is
the same as the one used by the kernels shipped with the board.

It's important to note that during the port to mainline, the led's label
was changed from "System" to "miqi:green:user", so scripts making use of
the name will still not work until they're fixed.

Fixes: 162718c (v4.7)
Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 arch/arm/boot/dts/rk3288-miqi.dts | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
index f751372..2f4c635 100644
--- a/arch/arm/boot/dts/rk3288-miqi.dts
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
@@ -68,11 +68,9 @@
 		compatible = "gpio-leds";
 
 		work {
-			gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
 			label = "miqi:green:user";
-			linux,default-trigger = "default-on";
-			pinctrl-names = "default";
-			pinctrl-0 = <&led_ctl>;
+			linux,default-trigger = "timer";
 		};
 	};
 
@@ -363,12 +361,6 @@
 		};
 	};
 
-	leds {
-		led_ctl: led-ctl {
-			rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
-		};
-	};
-
 	sdmmc {
 		/*
 		 * Default drive strength isn't enough to achieve even
-- 
2.8.0.rc2.1.gbe9624a

             reply	other threads:[~2017-02-11  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11  8:56 Willy Tarreau [this message]
2017-02-11  8:56 ` ARM: dts: rockchip: fix the MiQi board's LED definition Willy Tarreau
     [not found] ` <1486803405-14625-1-git-send-email-w-K+wRfnb2/UA@public.gmane.org>
2017-02-11 16:30   ` Heiko Stuebner
2017-02-11 16:30     ` Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486803405-14625-1-git-send-email-w@1wt.eu \
    --to=w@1wt.eu \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.