[ARM] 4805/1: 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 <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Rod Whitby and committed by Russell King 1208ebf2 78225913

+51 -64
+2 -2
arch/arm/configs/ixp4xx_defconfig
··· 1330 # 1331 # LED drivers 1332 # 1333 - CONFIG_LEDS_IXP4XX=y 1334 - # CONFIG_LEDS_GPIO is not set 1335 1336 # 1337 # LED Triggers
··· 1330 # 1331 # LED drivers 1332 # 1333 + # CONFIG_LEDS_IXP4XX is not set 1334 + CONFIG_LEDS_GPIO=y 1335 1336 # 1337 # LED Triggers
+17 -21
arch/arm/mach-ixp4xx/dsmg600-setup.c
··· 14 #include <linux/kernel.h> 15 #include <linux/serial.h> 16 #include <linux/serial_8250.h> 17 #include <linux/i2c.h> 18 #include <linux/i2c-gpio.h> 19 ··· 59 }, 60 }; 61 62 - #ifdef CONFIG_LEDS_CLASS 63 - static struct resource dsmg600_led_resources[] = { 64 { 65 - .name = "power", 66 - .start = DSMG600_LED_PWR_GPIO, 67 - .end = DSMG600_LED_PWR_GPIO, 68 - .flags = IXP4XX_GPIO_HIGH, 69 }, 70 { 71 - .name = "wlan", 72 - .start = DSMG600_LED_WLAN_GPIO, 73 - .end = DSMG600_LED_WLAN_GPIO, 74 - .flags = IXP4XX_GPIO_LOW, 75 }, 76 }; 77 78 - static struct platform_device dsmg600_leds = { 79 - .name = "IXP4XX-GPIO-LED", 80 - .id = -1, 81 - .num_resources = ARRAY_SIZE(dsmg600_led_resources), 82 - .resource = dsmg600_led_resources, 83 }; 84 - #endif 85 86 static struct resource dsmg600_uart_resources[] = { 87 { ··· 128 static struct platform_device *dsmg600_devices[] __initdata = { 129 &dsmg600_i2c_gpio, 130 &dsmg600_flash, 131 }; 132 133 static void dsmg600_power_off(void) ··· 176 (void)platform_device_register(&dsmg600_uart); 177 178 platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); 179 - 180 - #ifdef CONFIG_LEDS_CLASS 181 - /* We don't care whether or not this works. */ 182 - (void)platform_device_register(&dsmg600_leds); 183 - #endif 184 } 185 186 MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
··· 14 #include <linux/kernel.h> 15 #include <linux/serial.h> 16 #include <linux/serial_8250.h> 17 + #include <linux/leds.h> 18 #include <linux/i2c.h> 19 #include <linux/i2c-gpio.h> 20 ··· 58 }, 59 }; 60 61 + static struct gpio_led dsmg600_led_pins[] = { 62 { 63 + .name = "power", 64 + .gpio = DSMG600_LED_PWR_GPIO, 65 }, 66 { 67 + .name = "wlan", 68 + .gpio = DSMG600_LED_WLAN_GPIO, 69 + .active_low = true, 70 }, 71 }; 72 73 + static struct gpio_led_platform_data dsmg600_led_data = { 74 + .num_leds = ARRAY_SIZE(dsmg600_led_pins), 75 + .leds = dsmg600_led_pins, 76 }; 77 + 78 + static struct platform_device dsmg600_leds = { 79 + .name = "leds-gpio", 80 + .id = -1, 81 + .dev.platform_data = &dsmg600_led_data, 82 + }; 83 84 static struct resource dsmg600_uart_resources[] = { 85 { ··· 128 static struct platform_device *dsmg600_devices[] __initdata = { 129 &dsmg600_i2c_gpio, 130 &dsmg600_flash, 131 + &dsmg600_leds, 132 }; 133 134 static void dsmg600_power_off(void) ··· 175 (void)platform_device_register(&dsmg600_uart); 176 177 platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); 178 } 179 180 MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
+16 -19
arch/arm/mach-ixp4xx/nas100d-setup.c
··· 46 }, 47 }; 48 49 - #ifdef CONFIG_LEDS_IXP4XX 50 - static struct resource nas100d_led_resources[] = { 51 { 52 .name = "wlan", /* green led */ 53 - .start = NAS100D_LED_WLAN_GPIO, 54 - .end = NAS100D_LED_WLAN_GPIO, 55 - .flags = IXP4XX_GPIO_LOW, 56 }, 57 { 58 .name = "power", /* blue power led (off=flashing) */ 59 - .start = NAS100D_LED_PWR_GPIO, 60 - .end = NAS100D_LED_PWR_GPIO, 61 - .flags = IXP4XX_GPIO_LOW, 62 }, 63 { 64 .name = "disk", /* yellow led */ 65 - .start = NAS100D_LED_DISK_GPIO, 66 - .end = NAS100D_LED_DISK_GPIO, 67 - .flags = IXP4XX_GPIO_LOW, 68 }, 69 }; 70 71 - static struct platform_device nas100d_leds = { 72 - .name = "IXP4XX-GPIO-LED", 73 - .id = -1, 74 - .num_resources = ARRAY_SIZE(nas100d_led_resources), 75 - .resource = nas100d_led_resources, 76 }; 77 - #endif 78 79 static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = { 80 .sda_pin = NAS100D_SDA_PIN, ··· 134 static struct platform_device *nas100d_devices[] __initdata = { 135 &nas100d_i2c_gpio, 136 &nas100d_flash, 137 - #ifdef CONFIG_LEDS_IXP4XX 138 &nas100d_leds, 139 - #endif 140 }; 141 142 static void nas100d_power_off(void)
··· 46 }, 47 }; 48 49 + static struct gpio_led nas100d_led_pins[] = { 50 { 51 .name = "wlan", /* green led */ 52 + .gpio = NAS100D_LED_WLAN_GPIO, 53 + .active_low = true, 54 }, 55 { 56 .name = "power", /* blue power led (off=flashing) */ 57 + .gpio = NAS100D_LED_PWR_GPIO, 58 + .active_low = true, 59 }, 60 { 61 .name = "disk", /* yellow led */ 62 + .gpio = NAS100D_LED_DISK_GPIO, 63 + .active_low = true, 64 }, 65 }; 66 67 + static struct gpio_led_platform_data nas100d_led_data = { 68 + .num_leds = ARRAY_SIZE(nas100d_led_pins), 69 + .leds = nas100d_led_pins, 70 }; 71 + 72 + static struct platform_device nas100d_leds = { 73 + .name = "leds-gpio", 74 + .id = -1, 75 + .dev.platform_data = &nas100d_led_data, 76 + }; 77 78 static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = { 79 .sda_pin = NAS100D_SDA_PIN, ··· 135 static struct platform_device *nas100d_devices[] __initdata = { 136 &nas100d_i2c_gpio, 137 &nas100d_flash, 138 &nas100d_leds, 139 }; 140 141 static void nas100d_power_off(void)
+16 -22
arch/arm/mach-ixp4xx/nslu2-setup.c
··· 54 }, 55 }; 56 57 - #ifdef CONFIG_LEDS_IXP4XX 58 - static struct resource nslu2_led_resources[] = { 59 { 60 .name = "ready", /* green led */ 61 - .start = NSLU2_LED_GRN_GPIO, 62 - .end = NSLU2_LED_GRN_GPIO, 63 - .flags = IXP4XX_GPIO_HIGH, 64 }, 65 { 66 .name = "status", /* red led */ 67 - .start = NSLU2_LED_RED_GPIO, 68 - .end = NSLU2_LED_RED_GPIO, 69 - .flags = IXP4XX_GPIO_HIGH, 70 }, 71 { 72 .name = "disk-1", 73 - .start = NSLU2_LED_DISK1_GPIO, 74 - .end = NSLU2_LED_DISK1_GPIO, 75 - .flags = IXP4XX_GPIO_LOW, 76 }, 77 { 78 .name = "disk-2", 79 - .start = NSLU2_LED_DISK2_GPIO, 80 - .end = NSLU2_LED_DISK2_GPIO, 81 - .flags = IXP4XX_GPIO_LOW, 82 }, 83 }; 84 85 - static struct platform_device nslu2_leds = { 86 - .name = "IXP4XX-GPIO-LED", 87 - .id = -1, 88 - .num_resources = ARRAY_SIZE(nslu2_led_resources), 89 - .resource = nslu2_led_resources, 90 }; 91 - #endif 92 93 static struct platform_device nslu2_i2c_gpio = { 94 .name = "i2c-gpio", ··· 147 &nslu2_i2c_gpio, 148 &nslu2_flash, 149 &nslu2_beeper, 150 - #ifdef CONFIG_LEDS_IXP4XX 151 &nslu2_leds, 152 - #endif 153 }; 154 155 static void nslu2_power_off(void)
··· 54 }, 55 }; 56 57 + static struct gpio_led nslu2_led_pins[] = { 58 { 59 .name = "ready", /* green led */ 60 + .gpio = NSLU2_LED_GRN_GPIO, 61 }, 62 { 63 .name = "status", /* red led */ 64 + .gpio = NSLU2_LED_RED_GPIO, 65 }, 66 { 67 .name = "disk-1", 68 + .gpio = NSLU2_LED_DISK1_GPIO, 69 + .active_low = true, 70 }, 71 { 72 .name = "disk-2", 73 + .gpio = NSLU2_LED_DISK2_GPIO, 74 + .active_low = true, 75 }, 76 }; 77 78 + static struct gpio_led_platform_data nslu2_led_data = { 79 + .num_leds = ARRAY_SIZE(nslu2_led_pins), 80 + .leds = nslu2_led_pins, 81 }; 82 + 83 + static struct platform_device nslu2_leds = { 84 + .name = "leds-gpio", 85 + .id = -1, 86 + .dev.platform_data = &nslu2_led_data, 87 + }; 88 89 static struct platform_device nslu2_i2c_gpio = { 90 .name = "i2c-gpio", ··· 151 &nslu2_i2c_gpio, 152 &nslu2_flash, 153 &nslu2_beeper, 154 &nslu2_leds, 155 }; 156 157 static void nslu2_power_off(void)