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