From: arnaud.patard@rtp-net.org (Arnaud Patard (Rtp))
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: iop32x: fix power off handling for the EM7210 board
Date: Thu, 30 Jan 2014 00:19:18 +0100 [thread overview]
Message-ID: <87lhxyfkax.fsf@lebrac.rtp-net.org> (raw)
In-Reply-To: <1391005215-8520-1-git-send-email-linus.walleij@linaro.org> (Linus Walleij's message of "Wed, 29 Jan 2014 15:20:15 +0100")
Linus Walleij <linus.walleij@linaro.org> writes:
> This board was missed when converting all the others to proper
> abstracted GPIO handling. Fix it up the right way by requesting
> and driving GPIO line 0 high through gpiolib to power off the
> machine.
>
> Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v1->v2:
> - Request the power off and set the power off hook with a
> device_initcall() so we know the GPIO driver is available
> when requesting the line.
> - Refer to POWER OFF rather than RESET everywhere.
>
> ARM SoC folks, if you're happy with this fix, please apply it
> directly to fixes in the ARM SoC tree.
> ---
> arch/arm/mach-iop32x/em7210.c | 32 +++++++++++++++++++++++++++-----
> 1 file changed, 27 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
> index 177cd073a83b..77e1ff057303 100644
> --- a/arch/arm/mach-iop32x/em7210.c
> +++ b/arch/arm/mach-iop32x/em7210.c
> @@ -23,6 +23,7 @@
> #include <linux/mtd/physmap.h>
> #include <linux/platform_device.h>
> #include <linux/i2c.h>
> +#include <linux/gpio.h>
> #include <mach/hardware.h>
> #include <linux/io.h>
> #include <linux/irq.h>
> @@ -176,11 +177,35 @@ static struct platform_device em7210_serial_device = {
> .resource = &em7210_uart_resource,
> };
>
> +#define EM7210_HARDWARE_POWER 0
> +
> void em7210_power_off(void)
> {
> - *IOP3XX_GPOE &= 0xfe;
> - *IOP3XX_GPOD |= 0x01;
> + int ret;
> +
> + ret = gpio_direction_output(EM7210_HARDWARE_POWER, 1);
btw, any reason for not using gpio_direction_output() in
em7210_request_gpios() and gpio_set_value() here ? (just wondering)
I can't test it on my ss4000e but at least this patch looks fine.
Arnaud
next prev parent reply other threads:[~2014-01-29 23:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-29 14:20 [PATCH v2] ARM: iop32x: fix power off handling for the EM7210 board Linus Walleij
2014-01-29 23:19 ` Arnaud Patard (Rtp) [this message]
2014-01-30 8:56 ` Linus Walleij
2014-01-31 6:11 ` Kevin Hilman
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=87lhxyfkax.fsf@lebrac.rtp-net.org \
--to=arnaud.patard@rtp-net.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 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.