* [PATCH] OMAP3: RX51: support sleep indicator LEDs
@ 2009-10-02 15:35 Kevin Hilman
2009-10-02 15:59 ` Jonathan McDowell
2009-10-05 11:02 ` Roger Quadros
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Hilman @ 2009-10-02 15:35 UTC (permalink / raw)
To: linux-omap
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:
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)
--
1.6.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] OMAP3: RX51: support sleep indicator LEDs
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:02 ` Roger Quadros
1 sibling, 1 reply; 5+ messages in thread
From: Jonathan McDowell @ 2009-10-02 15:59 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-omap
On Fri, Oct 02, 2009 at 08:35:55AM -0700, 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:
Wouldn't this be better done using the LED class subsystem?
> 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>
> ---
J.
--
101 things you can't have too much of : 16 - Time.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP3: RX51: support sleep indicator LEDs
2009-10-02 15:59 ` Jonathan McDowell
@ 2009-10-02 16:18 ` Kevin Hilman
2009-10-05 11:31 ` Roger Quadros
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2009-10-02 16:18 UTC (permalink / raw)
To: Jonathan McDowell; +Cc: linux-omap
Jonathan McDowell <noodles@earth.li> writes:
> On Fri, Oct 02, 2009 at 08:35:55AM -0700, 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:
>
> Wouldn't this be better done using the LED class subsystem?
No, these are HW controlled LEDs which blink based on whether the OMAP
is hitting retention or OFF mode etc. The software has no control
over the blinking of LEDs themselves. The GPIO simply enables them.
Kevin
>> 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>
>> ---
>
> J.
>
> --
> 101 things you can't have too much of : 16 - Time.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP3: RX51: support sleep indicator LEDs
2009-10-02 16:18 ` Kevin Hilman
@ 2009-10-05 11:31 ` Roger Quadros
0 siblings, 0 replies; 5+ messages in thread
From: Roger Quadros @ 2009-10-05 11:31 UTC (permalink / raw)
To: ext Kevin Hilman; +Cc: Jonathan McDowell, linux-omap@vger.kernel.org
ext Kevin Hilman wrote:
> Jonathan McDowell <noodles@earth.li> writes:
>
>> On Fri, Oct 02, 2009 at 08:35:55AM -0700, 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:
>> Wouldn't this be better done using the LED class subsystem?
>
> No, these are HW controlled LEDs which blink based on whether the OMAP
> is hitting retention or OFF mode etc. The software has no control
> over the blinking of LEDs themselves. The GPIO simply enables them.
>
> Kevin
>
Actually, i think it would make sense to use LED class subsystem, even if the
GPIO does not directly control LEDs because
1) it does indirectly control a group of LEDs. enable/disable
2) it solves our GPIO numbering problem. user-space does not need to care about
or track which GPIO to set/reset
3) Makes better sense from architecture point of view
User-space will write to /sys/class/leds/debug_leds/brightness
-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>
>>> ---
>> J.
>>
>> --
>> 101 things you can't have too much of : 16 - Time.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP3: RX51: support sleep indicator LEDs
2009-10-02 15:35 [PATCH] OMAP3: RX51: support sleep indicator LEDs Kevin Hilman
2009-10-02 15:59 ` Jonathan McDowell
@ 2009-10-05 11:02 ` Roger Quadros
1 sibling, 0 replies; 5+ messages in thread
From: Roger Quadros @ 2009-10-05 11:02 UTC (permalink / raw)
To: ext Kevin Hilman; +Cc: linux-omap@vger.kernel.org
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)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-05 11:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox