From: Roger Quadros <ext-roger.quadros@nokia.com>
To: ext Kevin Hilman <khilman@deeprootsystems.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] OMAP3: RX51: support sleep indicator LEDs
Date: Mon, 05 Oct 2009 14:02:15 +0300 [thread overview]
Message-ID: <4AC9D237.6000309@nokia.com> (raw)
In-Reply-To: <1254497755-1822-1-git-send-email-khilman@deeprootsystems.com>
ext Kevin Hilman wrote:
> The sleep indicator LEDs can be enabled/disabled by toggling GPIO162.
> Request this GPIO in RX51 board init, disable by default and expose
> GPIO162 to userspace so LEDs can be toggled from userspace:
It would also make more sense to use gpio_export_link() to provide a named link
to userspace (e.g. sleep_ind, instead of GPIO162), as it is possible for gpio
number to change among board revisions and userspace shouldn't bother about that.
-roger
>
> To enable:
>
> # echo 1 > /sys/class/gpio/gpio162/value
>
> To disable:
>
> # echo 0 > /sys/class/gpio/gpio162/value
>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/board-rx51.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
> index f9196c3..6ad44d8 100644
> --- a/arch/arm/mach-omap2/board-rx51.c
> +++ b/arch/arm/mach-omap2/board-rx51.c
> @@ -31,6 +31,8 @@
> #include <mach/gpmc.h>
> #include <mach/usb.h>
>
> +#define RX51_GPIO_SLEEP_IND 162
> +
> static struct omap_lcd_config rx51_lcd_config = {
> .ctrl_name = "internal",
> };
> @@ -74,6 +76,11 @@ static void __init rx51_init(void)
> /* Ensure SDRC pins are mux'd for self-refresh */
> omap_cfg_reg(H16_34XX_SDRC_CKE0);
> omap_cfg_reg(H17_34XX_SDRC_CKE1);
> +
> + if (!(gpio_request(RX51_GPIO_SLEEP_IND, "SLEEP_IND"))) {
> + gpio_direction_output(RX51_GPIO_SLEEP_IND, 0);
> + gpio_export(RX51_GPIO_SLEEP_IND, 1);
> + }
> }
>
> static void __init rx51_map_io(void)
prev parent reply other threads:[~2009-10-05 11:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-02 15:35 [PATCH] OMAP3: RX51: support sleep indicator LEDs Kevin Hilman
2009-10-02 15:59 ` Jonathan McDowell
2009-10-02 16:18 ` Kevin Hilman
2009-10-05 11:31 ` Roger Quadros
2009-10-05 11:02 ` Roger Quadros [this message]
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=4AC9D237.6000309@nokia.com \
--to=ext-roger.quadros@nokia.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.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