summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/0124-leds-gpio-broken-with-current-git.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/0124-leds-gpio-broken-with-current-git.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/0124-leds-gpio-broken-with-current-git.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/0124-leds-gpio-broken-with-current-git.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/0124-leds-gpio-broken-with-current-git.patch
new file mode 100644
index 0000000000..dc6e190e89
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/0124-leds-gpio-broken-with-current-git.patch
@@ -0,0 +1,79 @@
1From c810e850d830330cf04225a4cff8e981e153f269 Mon Sep 17 00:00:00 2001
2From: David Brownell <david-b@pacbell.net>
3Date: Mon, 23 Feb 2009 14:08:14 -0800
4Subject: [PATCH 124/133] leds-gpio broken with current git?
5MIME-Version: 1.0
6Content-Type: text/plain; charset=utf-8
7Content-Transfer-Encoding: 8bit
8
9On Monday 23 February 2009, David Brownell wrote:
10>
11> > Perhaps something broke with Tony's RC1 merge?
12> > The LEDs are broken for me as well.
13>
14> Still works for me.  Did you maybe not enable the twl4030
15> GPIO support in Kconfig?
16
17Oh, and if you did *not*, please give this patch a try.
18I've been meaning to test it.
19
20- Dave
21
22==============
23Sometimes it's awkward to make sure that the array in the
24platform_data handed to the leds-gpio driver has only valid
25data ... some leds may not be always available, and coping
26with that currently requires patching or rebuilding the array.
27
28This patch fixes that by making it be OK to pass an invalid
29GPIO (such as "-EINVAL") ... such table entries are skipped.
30---
31 drivers/leds/leds-gpio.c | 12 +++++++++++-
32 1 files changed, 11 insertions(+), 1 deletions(-)
33
34diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
35index b13bd29..83737e6 100644
36--- a/drivers/leds/leds-gpio.c
37+++ b/drivers/leds/leds-gpio.c
38@@ -90,13 +90,19 @@ static int gpio_led_probe(struct platform_device *pdev)
39 cur_led = &pdata->leds[i];
40 led_dat = &leds_data[i];
41
42+ /* skip leds that aren't available */
43+ led_dat->gpio = cur_led->gpio;
44+ if (!gpio_is_valid(led_dat->gpio)) {
45+ dev_dbg(&pdev->dev, "skipping %s\n", cur_led->name);
46+ continue;
47+ }
48+
49 ret = gpio_request(cur_led->gpio, cur_led->name);
50 if (ret < 0)
51 goto err;
52
53 led_dat->cdev.name = cur_led->name;
54 led_dat->cdev.default_trigger = cur_led->default_trigger;
55- led_dat->gpio = cur_led->gpio;
56 led_dat->can_sleep = gpio_cansleep(cur_led->gpio);
57 led_dat->active_low = cur_led->active_low;
58 if (pdata->gpio_blink_set) {
59@@ -124,6 +130,8 @@ static int gpio_led_probe(struct platform_device *pdev)
60 err:
61 if (i > 0) {
62 for (i = i - 1; i >= 0; i--) {
63+ if (!gpio_is_valid(leds_data[i].gpio))
64+ continue;
65 led_classdev_unregister(&leds_data[i].cdev);
66 cancel_work_sync(&leds_data[i].work);
67 gpio_free(leds_data[i].gpio);
68@@ -144,6 +152,8 @@ static int __devexit gpio_led_remove(struct platform_device *pdev)
69 leds_data = platform_get_drvdata(pdev);
70
71 for (i = 0; i < pdata->num_leds; i++) {
72+ if (!gpio_is_valid(leds_data[i].gpio))
73+ continue;
74 led_classdev_unregister(&leds_data[i].cdev);
75 cancel_work_sync(&leds_data[i].work);
76 gpio_free(leds_data[i].gpio);
77--
781.6.0.4.790.gaa14a
79