From 197f707a5b4da92c0f9309ec39797c875ee7f426 Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Sat, 26 Jan 2008 02:01:04 +0000 Subject: [PATCH] Added patches from the LEDs maintainer git-svn-id: svn+ssh://svn.nslu2-linux.org/svnroot/kernel/trunk@992 b5a20c14-2c16-0410-a384-e21c7d08ac7b --- patches/2.6.25/ixp4xx-fix-leds-names.patch | 87 +++++++ .../ixp4xx-remove-ixp4xx-gpio-led-driver.patch | 284 +++++++++++++++++++++ patches/2.6.25/ixp4xx-use-leds-gpio.patch | 245 ++++++++++++++++++ 3 files changed, 616 insertions(+) create mode 100644 patches/2.6.25/ixp4xx-fix-leds-names.patch create mode 100644 patches/2.6.25/ixp4xx-remove-ixp4xx-gpio-led-driver.patch create mode 100644 patches/2.6.25/ixp4xx-use-leds-gpio.patch diff --git a/patches/2.6.25/ixp4xx-fix-leds-names.patch b/patches/2.6.25/ixp4xx-fix-leds-names.patch new file mode 100644 index 0000000..41f1e79 --- /dev/null +++ b/patches/2.6.25/ixp4xx-fix-leds-names.patch @@ -0,0 +1,87 @@ +From 3c405e6eacdcba7e49f595352d53ee44e3f1692c Mon Sep 17 00:00:00 2001 +From: A Nonymous +Date: Fri, 25 Jan 2008 22:52:47 +1030 +Subject: [PATCH] ixp4xx: Fix LED names according to API requirements + +Signed-off-by: A Nonymous +--- + arch/arm/mach-ixp4xx/dsmg600-setup.c | 4 ++-- + arch/arm/mach-ixp4xx/nas100d-setup.c | 6 +++--- + arch/arm/mach-ixp4xx/nslu2-setup.c | 8 ++++---- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c +index 1909ad5..d53ec19 100644 +--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c ++++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c +@@ -51,11 +51,11 @@ static struct platform_device dsmg600_i2c_controller = { + + static struct gpio_led dsmg600_led_pins[] = { + { +- .name = "power", ++ .name = "dsmg600:green:power", + .gpio = DSMG600_LED_PWR_GPIO, + }, + { +- .name = "wlan", ++ .name = "dsmg600:green:wlan", + .gpio = DSMG600_LED_WLAN_GPIO, + .active_low = true, + }, +diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c +index 68e18cb..80e8780 100644 +--- a/arch/arm/mach-ixp4xx/nas100d-setup.c ++++ b/arch/arm/mach-ixp4xx/nas100d-setup.c +@@ -40,17 +40,17 @@ static struct platform_device nas100d_flash = { + + static struct gpio_led nas100d_led_pins[] = { + { +- .name = "wlan", /* green led */ ++ .name = "nas100d:green:wlan", + .gpio = NAS100D_LED_WLAN_GPIO, + .active_low = true, + }, + { +- .name = "power", /* blue power led (off=flashing) */ ++ .name = "nas100d:blue:power", /* (off=flashing) */ + .gpio = NAS100D_LED_PWR_GPIO, + .active_low = true, + }, + { +- .name = "disk", /* yellow led */ ++ .name = "nas100d:yellow:disk", + .gpio = NAS100D_LED_DISK_GPIO, + .active_low = true, + }, +diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c +index 6a39862..fba10dd 100644 +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c ++++ b/arch/arm/mach-ixp4xx/nslu2-setup.c +@@ -48,20 +48,20 @@ static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = { + + static struct gpio_led nslu2_led_pins[] = { + { +- .name = "ready", /* green led */ ++ .name = "nslu2:green:ready", + .gpio = NSLU2_LED_GRN_GPIO, + }, + { +- .name = "status", /* red led */ ++ .name = "nslu2:red:status", + .gpio = NSLU2_LED_RED_GPIO, + }, + { +- .name = "disk-1", ++ .name = "nslu2:green:disk-1", + .gpio = NSLU2_LED_DISK1_GPIO, + .active_low = true, + }, + { +- .name = "disk-2", ++ .name = "nslu2:green:disk-2", + .gpio = NSLU2_LED_DISK2_GPIO, + .active_low = true, + }, +-- +1.5.2.5 + diff --git a/patches/2.6.25/ixp4xx-remove-ixp4xx-gpio-led-driver.patch b/patches/2.6.25/ixp4xx-remove-ixp4xx-gpio-led-driver.patch new file mode 100644 index 0000000..61d43de --- /dev/null +++ b/patches/2.6.25/ixp4xx-remove-ixp4xx-gpio-led-driver.patch @@ -0,0 +1,284 @@ +From bd70bd41a75c8fd171113c889c50a1c7af39ea3c Mon Sep 17 00:00:00 2001 +From: Rod Whitby +Date: Fri, 25 Jan 2008 23:11:54 +1030 +Subject: [PATCH] ixp4xx: Remove IXP4XX-GPIO-LED driver + +All boards using the IXP4XX-GPIO-LED driver have been updated to use +the generic leds-gpio driver instead. + +Signed-off-by: Rod Whitby +--- + arch/arm/configs/ixp4xx_defconfig | 1 - + drivers/leds/Kconfig | 9 -- + drivers/leds/Makefile | 1 - + drivers/leds/leds-ixp4xx-gpio.c | 214 ------------------------------------- + 4 files changed, 0 insertions(+), 225 deletions(-) + delete mode 100644 drivers/leds/leds-ixp4xx-gpio.c + +diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig +index 77fe3b0..d535040 100644 +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -1330,7 +1330,6 @@ CONFIG_LEDS_CLASS=y + # + # LED drivers + # +-# CONFIG_LEDS_IXP4XX is not set + CONFIG_LEDS_GPIO=y + + # +diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig +index ec568fa..2773ee8 100644 +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -39,15 +39,6 @@ config LEDS_SPITZ + This option enables support for the LEDs on Sharp Zaurus + SL-Cxx00 series (C1000, C3000, C3100). + +-config LEDS_IXP4XX +- tristate "LED Support for GPIO connected LEDs on IXP4XX processors" +- depends on LEDS_CLASS && ARCH_IXP4XX +- help +- This option enables support for the LEDs connected to GPIO +- outputs of the Intel IXP4XX processors. To be useful the +- particular board must have LEDs and they must be connected +- to the GPIO lines. If unsure, say Y. +- + config LEDS_TOSA + tristate "LED Support for the Sharp SL-6000 series" + depends on LEDS_CLASS && PXA_SHARPSL +diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile +index a60de1b..531c139 100644 +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -8,7 +8,6 @@ obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o + obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o + obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o + obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o +-obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o + obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o + obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o + obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o +diff --git a/drivers/leds/leds-ixp4xx-gpio.c b/drivers/leds/leds-ixp4xx-gpio.c +deleted file mode 100644 +index 7dcf0b9..0000000 +--- a/drivers/leds/leds-ixp4xx-gpio.c ++++ /dev/null +@@ -1,214 +0,0 @@ +-/* +- * IXP4XX GPIO driver LED driver +- * +- * Author: John Bowler +- * +- * Copyright (c) 2006 John Bowler +- * +- * Permission is hereby granted, free of charge, to any +- * person obtaining a copy of this software and associated +- * documentation files (the "Software"), to deal in the +- * Software without restriction, including without +- * limitation the rights to use, copy, modify, merge, +- * publish, distribute, sublicense, and/or sell copies of +- * the Software, and to permit persons to whom the +- * Software is furnished to do so, subject to the +- * following conditions: +- * +- * The above copyright notice and this permission notice +- * shall be included in all copies or substantial portions +- * of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +- * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +- * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +- * OTHER DEALINGS IN THE SOFTWARE. +- * +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-extern spinlock_t gpio_lock; +- +-/* Up to 16 gpio lines are possible. */ +-#define GPIO_MAX 16 +-static struct ixp4xxgpioled_device { +- struct led_classdev ancestor; +- int flags; +-} ixp4xxgpioled_devices[GPIO_MAX]; +- +-void ixp4xxgpioled_brightness_set(struct led_classdev *pled, +- enum led_brightness value) +-{ +- const struct ixp4xxgpioled_device *const ixp4xx_dev = +- container_of(pled, struct ixp4xxgpioled_device, ancestor); +- const u32 gpio_pin = ixp4xx_dev - ixp4xxgpioled_devices; +- +- if (gpio_pin < GPIO_MAX && ixp4xx_dev->ancestor.name != 0) { +- /* Set or clear the 'gpio_pin' bit according to the style +- * and the required setting (value > 0 == on) +- */ +- const int gpio_value = +- (value > 0) == (ixp4xx_dev->flags != IXP4XX_GPIO_LOW) ? +- IXP4XX_GPIO_HIGH : IXP4XX_GPIO_LOW; +- +- { +- unsigned long flags; +- spin_lock_irqsave(&gpio_lock, flags); +- gpio_line_set(gpio_pin, gpio_value); +- spin_unlock_irqrestore(&gpio_lock, flags); +- } +- } +-} +- +-/* LEDs are described in resources, the following iterates over the valid +- * LED resources. +- */ +-#define for_all_leds(i, pdev) \ +- for (i=0; inum_resources; ++i) \ +- if (pdev->resource[i].start < GPIO_MAX && \ +- pdev->resource[i].name != 0) +- +-/* The following applies 'operation' to each LED from the given platform, +- * the function always returns 0 to allow tail call elimination. +- */ +-static int apply_to_all_leds(struct platform_device *pdev, +- void (*operation)(struct led_classdev *pled)) +-{ +- int i; +- +- for_all_leds(i, pdev) +- operation(&ixp4xxgpioled_devices[pdev->resource[i].start].ancestor); +- return 0; +-} +- +-#ifdef CONFIG_PM +-static int ixp4xxgpioled_suspend(struct platform_device *pdev, +- pm_message_t state) +-{ +- return apply_to_all_leds(pdev, led_classdev_suspend); +-} +- +-static int ixp4xxgpioled_resume(struct platform_device *pdev) +-{ +- return apply_to_all_leds(pdev, led_classdev_resume); +-} +-#endif +- +-static void ixp4xxgpioled_remove_one_led(struct led_classdev *pled) +-{ +- led_classdev_unregister(pled); +- pled->name = 0; +-} +- +-static int ixp4xxgpioled_remove(struct platform_device *pdev) +-{ +- return apply_to_all_leds(pdev, ixp4xxgpioled_remove_one_led); +-} +- +-static int ixp4xxgpioled_probe(struct platform_device *pdev) +-{ +- /* The board level has to tell the driver where the +- * LEDs are connected - there is no way to find out +- * electrically. It must also say whether the GPIO +- * lines are active high or active low. +- * +- * To do this read the num_resources (the number of +- * LEDs) and the struct resource (the data for each +- * LED). The name comes from the resource, and it +- * isn't copied. +- */ +- int i; +- +- for_all_leds(i, pdev) { +- const u8 gpio_pin = pdev->resource[i].start; +- int rc; +- +- if (ixp4xxgpioled_devices[gpio_pin].ancestor.name == 0) { +- unsigned long flags; +- +- spin_lock_irqsave(&gpio_lock, flags); +- gpio_line_config(gpio_pin, IXP4XX_GPIO_OUT); +- /* The config can, apparently, reset the state, +- * I suspect the gpio line may be an input and +- * the config may cause the line to be latched, +- * so the setting depends on how the LED is +- * connected to the line (which affects how it +- * floats if not driven). +- */ +- gpio_line_set(gpio_pin, IXP4XX_GPIO_HIGH); +- spin_unlock_irqrestore(&gpio_lock, flags); +- +- ixp4xxgpioled_devices[gpio_pin].flags = +- pdev->resource[i].flags & IORESOURCE_BITS; +- +- ixp4xxgpioled_devices[gpio_pin].ancestor.name = +- pdev->resource[i].name; +- +- /* This is how a board manufacturer makes the LED +- * come on on reset - the GPIO line will be high, so +- * make the LED light when the line is low... +- */ +- if (ixp4xxgpioled_devices[gpio_pin].flags != IXP4XX_GPIO_LOW) +- ixp4xxgpioled_devices[gpio_pin].ancestor.brightness = 100; +- else +- ixp4xxgpioled_devices[gpio_pin].ancestor.brightness = 0; +- +- ixp4xxgpioled_devices[gpio_pin].ancestor.flags = 0; +- +- ixp4xxgpioled_devices[gpio_pin].ancestor.brightness_set = +- ixp4xxgpioled_brightness_set; +- +- ixp4xxgpioled_devices[gpio_pin].ancestor.default_trigger = 0; +- } +- +- rc = led_classdev_register(&pdev->dev, +- &ixp4xxgpioled_devices[gpio_pin].ancestor); +- if (rc < 0) { +- ixp4xxgpioled_devices[gpio_pin].ancestor.name = 0; +- ixp4xxgpioled_remove(pdev); +- return rc; +- } +- } +- +- return 0; +-} +- +-static struct platform_driver ixp4xxgpioled_driver = { +- .probe = ixp4xxgpioled_probe, +- .remove = ixp4xxgpioled_remove, +-#ifdef CONFIG_PM +- .suspend = ixp4xxgpioled_suspend, +- .resume = ixp4xxgpioled_resume, +-#endif +- .driver = { +- .name = "IXP4XX-GPIO-LED", +- }, +-}; +- +-static int __init ixp4xxgpioled_init(void) +-{ +- return platform_driver_register(&ixp4xxgpioled_driver); +-} +- +-static void __exit ixp4xxgpioled_exit(void) +-{ +- platform_driver_unregister(&ixp4xxgpioled_driver); +-} +- +-module_init(ixp4xxgpioled_init); +-module_exit(ixp4xxgpioled_exit); +- +-MODULE_AUTHOR("John Bowler "); +-MODULE_DESCRIPTION("IXP4XX GPIO LED driver"); +-MODULE_LICENSE("Dual MIT/GPL"); +-- +1.5.2.5 + diff --git a/patches/2.6.25/ixp4xx-use-leds-gpio.patch b/patches/2.6.25/ixp4xx-use-leds-gpio.patch new file mode 100644 index 0000000..670d02a --- /dev/null +++ b/patches/2.6.25/ixp4xx-use-leds-gpio.patch @@ -0,0 +1,245 @@ +From 1a98a764ad629f116b00f9d1a3485275b300cb82 Mon Sep 17 00:00:00 2001 +From: Rod Whitby +Date: Fri, 25 Jan 2008 22:41:06 +1030 +Subject: [PATCH] ixp4xx: Use leds-gpio driver instead of IXP4XX-GPIO-LED driver + +These are the only three boards to use the IXP4XX-GPIO-LED driver, and +they can all use the new leds-gpio driver instead with no change in +functionality. + +Signed-off-by: Rod Whitby +--- + arch/arm/configs/ixp4xx_defconfig | 4 +- + arch/arm/mach-ixp4xx/dsmg600-setup.c | 36 +++++++++++++++------------------ + arch/arm/mach-ixp4xx/nas100d-setup.c | 31 +++++++++++++---------------- + arch/arm/mach-ixp4xx/nslu2-setup.c | 34 +++++++++++++------------------ + 4 files changed, 46 insertions(+), 59 deletions(-) + +diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig +index 2d5ae33..77fe3b0 100644 +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -1330,8 +1330,8 @@ CONFIG_LEDS_CLASS=y + # + # LED drivers + # +-CONFIG_LEDS_IXP4XX=y +-# CONFIG_LEDS_GPIO is not set ++# CONFIG_LEDS_IXP4XX is not set ++CONFIG_LEDS_GPIO=y + + # + # LED Triggers +diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c +index 1e75e10..1909ad5 100644 +--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c ++++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -48,29 +49,28 @@ static struct platform_device dsmg600_i2c_controller = { + .dev.platform_data = &dsmg600_i2c_gpio_pins, + }; + +-#ifdef CONFIG_LEDS_CLASS +-static struct resource dsmg600_led_resources[] = { ++static struct gpio_led dsmg600_led_pins[] = { + { +- .name = "power", +- .start = DSMG600_LED_PWR_GPIO, +- .end = DSMG600_LED_PWR_GPIO, +- .flags = IXP4XX_GPIO_HIGH, ++ .name = "power", ++ .gpio = DSMG600_LED_PWR_GPIO, + }, + { +- .name = "wlan", +- .start = DSMG600_LED_WLAN_GPIO, +- .end = DSMG600_LED_WLAN_GPIO, +- .flags = IXP4XX_GPIO_LOW, ++ .name = "wlan", ++ .gpio = DSMG600_LED_WLAN_GPIO, ++ .active_low = true, + }, + }; + ++static struct gpio_led_platform_data dsmg600_led_data = { ++ .num_leds = ARRAY_SIZE(dsmg600_led_pins), ++ .leds = dsmg600_led_pins, ++}; ++ + static struct platform_device dsmg600_leds = { +- .name = "IXP4XX-GPIO-LED", +- .id = -1, +- .num_resources = ARRAY_SIZE(dsmg600_led_resources), +- .resource = dsmg600_led_resources, ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &dsmg600_led_data, + }; +-#endif + + static struct resource dsmg600_uart_resources[] = { + { +@@ -118,6 +118,7 @@ static struct platform_device dsmg600_uart = { + static struct platform_device *dsmg600_devices[] __initdata = { + &dsmg600_i2c_controller, + &dsmg600_flash, ++ &dsmg600_leds, + }; + + static void dsmg600_power_off(void) +@@ -162,11 +163,6 @@ static void __init dsmg600_init(void) + (void)platform_device_register(&dsmg600_uart); + + platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); +- +-#ifdef CONFIG_LEDS_CLASS +- /* We don't care whether or not this works. */ +- (void)platform_device_register(&dsmg600_leds); +-#endif + } + + MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") +diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c +index ea334f3..68e18cb 100644 +--- a/arch/arm/mach-ixp4xx/nas100d-setup.c ++++ b/arch/arm/mach-ixp4xx/nas100d-setup.c +@@ -38,35 +38,34 @@ static struct platform_device nas100d_flash = { + .resource = &nas100d_flash_resource, + }; + +-#ifdef CONFIG_LEDS_IXP4XX +-static struct resource nas100d_led_resources[] = { ++static struct gpio_led nas100d_led_pins[] = { + { + .name = "wlan", /* green led */ +- .start = NAS100D_LED_WLAN_GPIO, +- .end = NAS100D_LED_WLAN_GPIO, +- .flags = IXP4XX_GPIO_LOW, ++ .gpio = NAS100D_LED_WLAN_GPIO, ++ .active_low = true, + }, + { + .name = "power", /* blue power led (off=flashing) */ +- .start = NAS100D_LED_PWR_GPIO, +- .end = NAS100D_LED_PWR_GPIO, +- .flags = IXP4XX_GPIO_LOW, ++ .gpio = NAS100D_LED_PWR_GPIO, ++ .active_low = true, + }, + { + .name = "disk", /* yellow led */ +- .start = NAS100D_LED_DISK_GPIO, +- .end = NAS100D_LED_DISK_GPIO, +- .flags = IXP4XX_GPIO_LOW, ++ .gpio = NAS100D_LED_DISK_GPIO, ++ .active_low = true, + }, + }; + ++static struct gpio_led_platform_data nas100d_led_data = { ++ .num_leds = ARRAY_SIZE(nas100d_led_pins), ++ .leds = nas100d_led_pins, ++}; ++ + static struct platform_device nas100d_leds = { +- .name = "IXP4XX-GPIO-LED", ++ .name = "leds-gpio", + .id = -1, +- .num_resources = ARRAY_SIZE(nas100d_led_resources), +- .resource = nas100d_led_resources, ++ .dev.platform_data = &nas100d_led_data, + }; +-#endif + + static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = { + .sda_pin = NAS100D_SDA_PIN, +@@ -126,9 +125,7 @@ static struct platform_device nas100d_uart = { + static struct platform_device *nas100d_devices[] __initdata = { + &nas100d_i2c_controller, + &nas100d_flash, +-#ifdef CONFIG_LEDS_IXP4XX + &nas100d_leds, +-#endif + }; + + static void nas100d_power_off(void) +diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c +index 9bf8ccb..6a39862 100644 +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c ++++ b/arch/arm/mach-ixp4xx/nslu2-setup.c +@@ -46,41 +46,37 @@ static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = { + .scl_pin = NSLU2_SCL_PIN, + }; + +-#ifdef CONFIG_LEDS_IXP4XX +-static struct resource nslu2_led_resources[] = { ++static struct gpio_led nslu2_led_pins[] = { + { + .name = "ready", /* green led */ +- .start = NSLU2_LED_GRN_GPIO, +- .end = NSLU2_LED_GRN_GPIO, +- .flags = IXP4XX_GPIO_HIGH, ++ .gpio = NSLU2_LED_GRN_GPIO, + }, + { + .name = "status", /* red led */ +- .start = NSLU2_LED_RED_GPIO, +- .end = NSLU2_LED_RED_GPIO, +- .flags = IXP4XX_GPIO_HIGH, ++ .gpio = NSLU2_LED_RED_GPIO, + }, + { + .name = "disk-1", +- .start = NSLU2_LED_DISK1_GPIO, +- .end = NSLU2_LED_DISK1_GPIO, +- .flags = IXP4XX_GPIO_LOW, ++ .gpio = NSLU2_LED_DISK1_GPIO, ++ .active_low = true, + }, + { + .name = "disk-2", +- .start = NSLU2_LED_DISK2_GPIO, +- .end = NSLU2_LED_DISK2_GPIO, +- .flags = IXP4XX_GPIO_LOW, ++ .gpio = NSLU2_LED_DISK2_GPIO, ++ .active_low = true, + }, + }; + ++static struct gpio_led_platform_data nslu2_led_data = { ++ .num_leds = ARRAY_SIZE(nslu2_led_pins), ++ .leds = nslu2_led_pins, ++}; ++ + static struct platform_device nslu2_leds = { +- .name = "IXP4XX-GPIO-LED", ++ .name = "leds-gpio", + .id = -1, +- .num_resources = ARRAY_SIZE(nslu2_led_resources), +- .resource = nslu2_led_resources, ++ .dev.platform_data = &nslu2_led_data, + }; +-#endif + + static struct platform_device nslu2_i2c_controller = { + .name = "IXP4XX-I2C", +@@ -142,9 +138,7 @@ static struct platform_device *nslu2_devices[] __initdata = { + &nslu2_i2c_controller, + &nslu2_flash, + &nslu2_beeper, +-#ifdef CONFIG_LEDS_IXP4XX + &nslu2_leds, +-#endif + }; + + static void nslu2_power_off(void) +-- +1.5.2.5 + -- 2.11.4.GIT