* leds-gpio broken with current git?
@ 2009-01-15 14:19 Koen Kooi
2009-01-15 15:58 ` David Brownell
0 siblings, 1 reply; 6+ messages in thread
From: Koen Kooi @ 2009-01-15 14:19 UTC (permalink / raw)
To: linux-omap@vger.kernel.org List
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Hi,
I've been playing with different kernels on beagleboard lately and it
seems that somewhere between 2.6.28rc8 and the final release leds-gpio
got broken for beagleboard:
Registered led device: beagleboard::usr0
Registered led device: beagleboard::usr1
leds-gpio: probe of leds-gpio failed with error -22
and in userspace:
root@beagleboard:~# ls /sys/class/leds/
root@beagleboard:~#
I'm currently too swamped with exams and testing the PM branch to do a
bisect for 3 blinkenlights, so if anyone has a suggestion were to
look....
regards,
Koen
[-- Attachment #2: Dit deel van het bericht is digitaal ondertekend --]
[-- Type: application/pgp-signature, Size: 186 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: leds-gpio broken with current git?
2009-01-15 14:19 leds-gpio broken with current git? Koen Kooi
@ 2009-01-15 15:58 ` David Brownell
2009-02-23 14:30 ` Kridner, Jason
0 siblings, 1 reply; 6+ messages in thread
From: David Brownell @ 2009-01-15 15:58 UTC (permalink / raw)
To: Koen Kooi; +Cc: linux-omap@vger.kernel.org List
On Thursday 15 January 2009, Koen Kooi wrote:
> I've been playing with different kernels on beagleboard lately and it
> seems that somewhere between 2.6.28rc8 and the final release leds-gpio
> got broken for beagleboard:
>
> Registered led device: beagleboard::usr0
> Registered led device: beagleboard::usr1
> leds-gpio: probe of leds-gpio failed with error -22
Works for me, no "-EINVAL", on 2.6.28-omap1 and no patches
that should affect GPIOs or LEDs. Last patch applied to
GIT is 15f75b6226c2d3b82062bb721e7cb9a1d6f35efd (musbhsdma).
OK, I'm just pulling a new batch of objects, I'm guessing
Tony snuck in RC1 already ... yes, I see he just sent a
post about that a few minutes ago. ;)
- Dave
--
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] 6+ messages in thread
* RE: leds-gpio broken with current git?
2009-01-15 15:58 ` David Brownell
@ 2009-02-23 14:30 ` Kridner, Jason
2009-02-23 21:04 ` David Brownell
0 siblings, 1 reply; 6+ messages in thread
From: Kridner, Jason @ 2009-02-23 14:30 UTC (permalink / raw)
To: David Brownell, Koen Kooi; +Cc: linux-omap@vger.kernel.org List
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of David Brownell
> Sent: Thursday, January 15, 2009 9:59 AM
> To: Koen Kooi
> Cc: linux-omap@vger.kernel.org List
> Subject: Re: leds-gpio broken with current git?
>
> On Thursday 15 January 2009, Koen Kooi wrote:
> > I've been playing with different kernels on beagleboard lately and
> it
> > seems that somewhere between 2.6.28rc8 and the final release leds-
> gpio
> > got broken for beagleboard:
> >
> > Registered led device: beagleboard::usr0
> > Registered led device: beagleboard::usr1
> > leds-gpio: probe of leds-gpio failed with error -22
>
> Works for me, no "-EINVAL", on 2.6.28-omap1 and no patches
> that should affect GPIOs or LEDs. Last patch applied to
> GIT is 15f75b6226c2d3b82062bb721e7cb9a1d6f35efd (musbhsdma).
>
> OK, I'm just pulling a new batch of objects, I'm guessing
> Tony snuck in RC1 already ... yes, I see he just sent a
> post about that a few minutes ago. ;)
Perhaps something broke with Tony's RC1 merge? The LEDs are broken for me as well.
>
> - Dave
>
> --
> 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] 6+ messages in thread
* Re: leds-gpio broken with current git?
2009-02-23 14:30 ` Kridner, Jason
@ 2009-02-23 21:04 ` David Brownell
2009-02-23 22:08 ` David Brownell
0 siblings, 1 reply; 6+ messages in thread
From: David Brownell @ 2009-02-23 21:04 UTC (permalink / raw)
To: Kridner, Jason; +Cc: Koen Kooi, linux-omap@vger.kernel.org List
On Monday 23 February 2009, Kridner, Jason wrote:
>
> > Works for me, no "-EINVAL", on 2.6.28-omap1 and no patches
> > that should affect GPIOs or LEDs. Last patch applied to
> > GIT is 15f75b6226c2d3b82062bb721e7cb9a1d6f35efd (musbhsdma).
> >
> > OK, I'm just pulling a new batch of objects, I'm guessing
> > Tony snuck in RC1 already ... yes, I see he just sent a
> > post about that a few minutes ago. ;)
>
> Perhaps something broke with Tony's RC1 merge?
> The LEDs are broken for me as well.
Still works for me. Did you maybe not enable the twl4030
GPIO support in Kconfig?
- dave
--
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] 6+ messages in thread
* Re: leds-gpio broken with current git?
2009-02-23 21:04 ` David Brownell
@ 2009-02-23 22:08 ` David Brownell
2009-02-25 15:45 ` Jason Kridner
0 siblings, 1 reply; 6+ messages in thread
From: David Brownell @ 2009-02-23 22:08 UTC (permalink / raw)
To: Kridner, Jason; +Cc: Koen Kooi, linux-omap@vger.kernel.org List
On Monday 23 February 2009, David Brownell wrote:
>
> > Perhaps something broke with Tony's RC1 merge?
> > The LEDs are broken for me as well.
>
> Still works for me. Did you maybe not enable the twl4030
> GPIO support in Kconfig?
Oh, and if you did *not*, please give this patch a try.
I've been meaning to test it.
- Dave
==============
Sometimes it's awkward to make sure that the array in the
platform_data handed to the leds-gpio driver has only valid
data ... some leds may not be always available, and coping
with that currently requires patching or rebuilding the array.
This patch fixes that by making it be OK to pass an invalid
GPIO (such as "-EINVAL") ... such table entries are skipped.
---
drivers/leds/leds-gpio.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -90,13 +90,19 @@ static int gpio_led_probe(struct platfor
cur_led = &pdata->leds[i];
led_dat = &leds_data[i];
+ /* skip leds that aren't available */
+ led_dat->gpio = cur_led->gpio;
+ if (!gpio_is_valid(led_dat->gpio)) {
+ dev_dbg(&pdev->dev, "skipping %s\n", cur_led->name);
+ continue;
+ }
+
ret = gpio_request(cur_led->gpio, cur_led->name);
if (ret < 0)
goto err;
led_dat->cdev.name = cur_led->name;
led_dat->cdev.default_trigger = cur_led->default_trigger;
- led_dat->gpio = cur_led->gpio;
led_dat->can_sleep = gpio_cansleep(cur_led->gpio);
led_dat->active_low = cur_led->active_low;
if (pdata->gpio_blink_set) {
@@ -125,6 +131,8 @@ static int gpio_led_probe(struct platfor
err:
if (i > 0) {
for (i = i - 1; i >= 0; i--) {
+ if (!gpio_is_valid(leds_data[i].gpio))
+ continue;
led_classdev_unregister(&leds_data[i].cdev);
cancel_work_sync(&leds_data[i].work);
gpio_free(leds_data[i].gpio);
@@ -145,6 +153,8 @@ static int __devexit gpio_led_remove(str
leds_data = platform_get_drvdata(pdev);
for (i = 0; i < pdata->num_leds; i++) {
+ if (!gpio_is_valid(leds_data[i].gpio))
+ continue;
led_classdev_unregister(&leds_data[i].cdev);
cancel_work_sync(&leds_data[i].work);
gpio_free(leds_data[i].gpio);
--
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] 6+ messages in thread
* Re: leds-gpio broken with current git?
2009-02-23 22:08 ` David Brownell
@ 2009-02-25 15:45 ` Jason Kridner
0 siblings, 0 replies; 6+ messages in thread
From: Jason Kridner @ 2009-02-25 15:45 UTC (permalink / raw)
To: David Brownell
Cc: Jason Kridner, Koen Kooi, linux-omap@vger.kernel.org List,
Diego Dompe
On Feb 23, 2009, at 4:08 PM, David Brownell wrote:
> On Monday 23 February 2009, David Brownell wrote:
>>
>>> Perhaps something broke with Tony's RC1 merge?
>>> The LEDs are broken for me as well.
>>
>> Still works for me. Did you maybe not enable the twl4030
>> GPIO support in Kconfig?
>
> Oh, and if you did *not*, please give this patch a try.
> I've been meaning to test it.
Thanks, the patch works. Not enabling the TWL4030 GPIO was the issue
and this patch provides a good method of not having all the GPIOs fail
due to the failure of just one. Diego assisted in the test, as I had
first taken the approach of removing the failing GPIO.
>
>
> - Dave
>
>
> ==============
> Sometimes it's awkward to make sure that the array in the
> platform_data handed to the leds-gpio driver has only valid
> data ... some leds may not be always available, and coping
> with that currently requires patching or rebuilding the array.
>
> This patch fixes that by making it be OK to pass an invalid
> GPIO (such as "-EINVAL") ... such table entries are skipped.
>
> ---
> drivers/leds/leds-gpio.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -90,13 +90,19 @@ static int gpio_led_probe(struct platfor
> cur_led = &pdata->leds[i];
> led_dat = &leds_data[i];
>
> + /* skip leds that aren't available */
> + led_dat->gpio = cur_led->gpio;
> + if (!gpio_is_valid(led_dat->gpio)) {
> + dev_dbg(&pdev->dev, "skipping %s\n", cur_led->name);
> + continue;
> + }
> +
> ret = gpio_request(cur_led->gpio, cur_led->name);
> if (ret < 0)
> goto err;
>
> led_dat->cdev.name = cur_led->name;
> led_dat->cdev.default_trigger = cur_led->default_trigger;
> - led_dat->gpio = cur_led->gpio;
> led_dat->can_sleep = gpio_cansleep(cur_led->gpio);
> led_dat->active_low = cur_led->active_low;
> if (pdata->gpio_blink_set) {
> @@ -125,6 +131,8 @@ static int gpio_led_probe(struct platfor
> err:
> if (i > 0) {
> for (i = i - 1; i >= 0; i--) {
> + if (!gpio_is_valid(leds_data[i].gpio))
> + continue;
> led_classdev_unregister(&leds_data[i].cdev);
> cancel_work_sync(&leds_data[i].work);
> gpio_free(leds_data[i].gpio);
> @@ -145,6 +153,8 @@ static int __devexit gpio_led_remove(str
> leds_data = platform_get_drvdata(pdev);
>
> for (i = 0; i < pdata->num_leds; i++) {
> + if (!gpio_is_valid(leds_data[i].gpio))
> + continue;
> led_classdev_unregister(&leds_data[i].cdev);
> cancel_work_sync(&leds_data[i].work);
> gpio_free(leds_data[i].gpio);
> --
> 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] 6+ messages in thread
end of thread, other threads:[~2009-02-25 15:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 14:19 leds-gpio broken with current git? Koen Kooi
2009-01-15 15:58 ` David Brownell
2009-02-23 14:30 ` Kridner, Jason
2009-02-23 21:04 ` David Brownell
2009-02-23 22:08 ` David Brownell
2009-02-25 15:45 ` Jason Kridner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox