From: simon.guinot@sequanux.org (Simon Guinot)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] ARM: Kirkwood: Convert NS2 to gpio-poweroff.
Date: Wed, 9 Jan 2013 09:41:13 +0100 [thread overview]
Message-ID: <20130109084112.GQ1357@kw.sim.vm.gnt> (raw)
In-Reply-To: <1356704050-5047-1-git-send-email-andrew@lunn.ch>
On Fri, Dec 28, 2012 at 03:14:10PM +0100, Andrew Lunn wrote:
> Remove C code and add a Device Tree node in its place.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>
> This is untested. I've been known to get the active hi/low the wrong
> way around so that the board powers off as the driver loads at boot
> time. So it would be very good to have a tested-by: sign off.
>
>
> arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 6 ++++++
> arch/arm/mach-kirkwood/board-ns2.c | 14 --------------
> 2 files changed, 6 insertions(+), 14 deletions(-)
Tested-by: Simon Guinot <simon.guinot@sequanux.org>
Andrew, do you want me to rebase your patch on the top of the pinctrl
conversion one ?
Simon
>
> diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
> index 9bc6785..58c4103 100644
> --- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
> +++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
> @@ -60,4 +60,10 @@
> gpios = <&gpio0 12 0>;
> };
> };
> +
> + gpio_poweroff {
> + compatible = "gpio-poweroff";
> + gpios = <&gpio0 31 0>;
> + };
> +
> };
> diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
> index 8821720..f263449 100644
> --- a/arch/arm/mach-kirkwood/board-ns2.c
> +++ b/arch/arm/mach-kirkwood/board-ns2.c
> @@ -15,7 +15,6 @@
> #include <linux/init.h>
> #include <linux/platform_device.h>
> #include <linux/mv643xx_eth.h>
> -#include <linux/gpio.h>
> #include <linux/of.h>
> #include "common.h"
> #include "mpp.h"
> @@ -59,13 +58,6 @@ static unsigned int ns2_mpp_config[] __initdata = {
> 0
> };
>
> -#define NS2_GPIO_POWER_OFF 31
> -
> -static void ns2_power_off(void)
> -{
> - gpio_set_value(NS2_GPIO_POWER_OFF, 1);
> -}
> -
> void __init ns2_init(void)
> {
> /*
> @@ -77,10 +69,4 @@ void __init ns2_init(void)
> of_machine_is_compatible("lacie,netspace_mini_v2"))
> ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
> kirkwood_ge00_init(&ns2_ge00_data);
> -
> - if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 &&
> - gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0)
> - pm_power_off = ns2_power_off;
> - else
> - pr_err("ns2: failed to configure power-off GPIO\n");
> }
> --
> 1.7.10.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130109/4287e2b0/attachment.sig>
next prev parent reply other threads:[~2013-01-09 8:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-28 14:14 [PATCH 1/5] ARM: Kirkwood: Convert NS2 to gpio-poweroff Andrew Lunn
2012-12-29 1:07 ` Simon Guinot
2012-12-29 7:55 ` Andrew Lunn
2012-12-29 10:11 ` Simon Guinot
2013-01-09 8:41 ` Simon Guinot [this message]
2013-01-09 8:54 ` Andrew Lunn
2013-01-23 13:35 ` Jason Cooper
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=20130109084112.GQ1357@kw.sim.vm.gnt \
--to=simon.guinot@sequanux.org \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox