* [PATCH 0/2] Misc LED-related IGEPv2 patches
@ 2010-12-12 18:34 Laurent Pinchart
2010-12-12 18:35 ` [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output Laurent Pinchart
2010-12-12 18:35 ` [PATCH 2/2] omap3: igepv2: LED gpio-led:green:d1 is active low Laurent Pinchart
0 siblings, 2 replies; 5+ messages in thread
From: Laurent Pinchart @ 2010-12-12 18:34 UTC (permalink / raw)
To: linux-omap; +Cc: eballetbo
Hi,
Here are two small patches for the IGEPv2 board file to cleanup LED support and
configure the heartbeat LED as active low.
The second patch is valid for revision C hardware, I don't know if the LED is
active low on revision B hardware as well.
Laurent Pinchart (2):
omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output
omap3: igepv2: LED gpio-led:green:d1 is active low
arch/arm/mach-omap2/board-igep0020.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output
2010-12-12 18:34 [PATCH 0/2] Misc LED-related IGEPv2 patches Laurent Pinchart
@ 2010-12-12 18:35 ` Laurent Pinchart
2010-12-13 8:56 ` Enric Balletbò i Serra
2010-12-12 18:35 ` [PATCH 2/2] omap3: igepv2: LED gpio-led:green:d1 is active low Laurent Pinchart
1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2010-12-12 18:35 UTC (permalink / raw)
To: linux-omap; +Cc: eballetbo
gpio_direction_output() has a value argument, there's no need to call
gpio_set_value() explicitly right after.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
arch/arm/mach-omap2/board-igep0020.c | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 5e035a5..20b88c1 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -342,24 +342,21 @@ static void __init igep2_leds_init(void)
static inline void igep2_leds_init(void)
{
if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
- (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {
+ (gpio_direction_output(IGEP2_GPIO_LED0_RED, 0) == 0))
gpio_export(IGEP2_GPIO_LED0_RED, 0);
- gpio_set_value(IGEP2_GPIO_LED0_RED, 0);
- } else
+ else
pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
- (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {
+ (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 0) == 0))
gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
- gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
- } else
+ else
pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
- (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
+ (gpio_direction_output(IGEP2_GPIO_LED1_RED, 0) == 0))
gpio_export(IGEP2_GPIO_LED1_RED, 0);
- gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
- } else
+ else
pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
}
@@ -397,10 +394,9 @@ static int igep2_twl_gpio_setup(struct device *dev,
/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
- && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) {
+ && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 0) == 0))
gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
- gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0);
- } else
+ else
pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
#else
igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
--
1.7.2.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] omap3: igepv2: LED gpio-led:green:d1 is active low
2010-12-12 18:34 [PATCH 0/2] Misc LED-related IGEPv2 patches Laurent Pinchart
2010-12-12 18:35 ` [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output Laurent Pinchart
@ 2010-12-12 18:35 ` Laurent Pinchart
2010-12-13 15:25 ` Enric Balletbò i Serra
1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2010-12-12 18:35 UTC (permalink / raw)
To: linux-omap; +Cc: eballetbo
Make sure the LED is turned off at boot time, and configure the GPIO LED
device as active low.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
arch/arm/mach-omap2/board-igep0020.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 20b88c1..41a4b25 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -317,6 +317,7 @@ static struct gpio_led igep2_gpio_leds[] = {
.name = "gpio-led:green:d1",
.default_trigger = "heartbeat",
.gpio = -EINVAL, /* gets replaced */
+ .active_low = 1,
},
};
@@ -394,7 +395,7 @@ static int igep2_twl_gpio_setup(struct device *dev,
/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
- && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 0) == 0))
+ && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0))
gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
else
pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
--
1.7.2.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output
2010-12-12 18:35 ` [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output Laurent Pinchart
@ 2010-12-13 8:56 ` Enric Balletbò i Serra
0 siblings, 0 replies; 5+ messages in thread
From: Enric Balletbò i Serra @ 2010-12-13 8:56 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-omap
2010/12/12 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> gpio_direction_output() has a value argument, there's no need to call
> gpio_set_value() explicitly right after.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> arch/arm/mach-omap2/board-igep0020.c | 20 ++++++++------------
> 1 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 5e035a5..20b88c1 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -342,24 +342,21 @@ static void __init igep2_leds_init(void)
> static inline void igep2_leds_init(void)
> {
> if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) &&
> - (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {
> + (gpio_direction_output(IGEP2_GPIO_LED0_RED, 0) == 0))
> gpio_export(IGEP2_GPIO_LED0_RED, 0);
> - gpio_set_value(IGEP2_GPIO_LED0_RED, 0);
> - } else
> + else
> pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
>
> if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) &&
> - (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {
> + (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 0) == 0))
> gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
> - gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
> - } else
> + else
> pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
>
> if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) &&
> - (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
> + (gpio_direction_output(IGEP2_GPIO_LED1_RED, 0) == 0))
> gpio_export(IGEP2_GPIO_LED1_RED, 0);
> - gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
> - } else
> + else
> pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
>
> }
> @@ -397,10 +394,9 @@ static int igep2_twl_gpio_setup(struct device *dev,
> /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
> #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
> if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
> - && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) {
> + && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 0) == 0))
> gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
> - gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0);
> - } else
> + else
> pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
> #else
> igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
> --
> 1.7.2.2
>
>
Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
--
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 2/2] omap3: igepv2: LED gpio-led:green:d1 is active low
2010-12-12 18:35 ` [PATCH 2/2] omap3: igepv2: LED gpio-led:green:d1 is active low Laurent Pinchart
@ 2010-12-13 15:25 ` Enric Balletbò i Serra
0 siblings, 0 replies; 5+ messages in thread
From: Enric Balletbò i Serra @ 2010-12-13 15:25 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-omap
2010/12/12 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Make sure the LED is turned off at boot time, and configure the GPIO LED
> device as active low.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> arch/arm/mach-omap2/board-igep0020.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 20b88c1..41a4b25 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -317,6 +317,7 @@ static struct gpio_led igep2_gpio_leds[] = {
> .name = "gpio-led:green:d1",
> .default_trigger = "heartbeat",
> .gpio = -EINVAL, /* gets replaced */
> + .active_low = 1,
> },
> };
>
> @@ -394,7 +395,7 @@ static int igep2_twl_gpio_setup(struct device *dev,
> /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
> #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE)
> if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0)
> - && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 0) == 0))
> + && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0))
> gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0);
> else
> pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n");
> --
> 1.7.2.2
>
>
Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
--
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
end of thread, other threads:[~2010-12-13 15:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-12 18:34 [PATCH 0/2] Misc LED-related IGEPv2 patches Laurent Pinchart
2010-12-12 18:35 ` [PATCH 1/2] omap3: igepv2: Don't call gpio_set_value right after gpio_direction_output Laurent Pinchart
2010-12-13 8:56 ` Enric Balletbò i Serra
2010-12-12 18:35 ` [PATCH 2/2] omap3: igepv2: LED gpio-led:green:d1 is active low Laurent Pinchart
2010-12-13 15:25 ` Enric Balletbò i Serra
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.