diff options
author | Rod Whitby <rod@whitby.id.au> | 2008-02-01 18:03:56 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-02-04 08:15:26 -0500 |
commit | 1208ebf25b654a48f075c191de1d6410af7062b0 (patch) | |
tree | fe258e89ed5427d5265ce416f0768cb2df333ae0 /arch | |
parent | 78225913709915d02a0a8025a1efcb767c6bdfe0 (diff) |
[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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/configs/ixp4xx_defconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/dsmg600-setup.c | 36 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/nas100d-setup.c | 31 | ||||
-rw-r--r-- | 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 2d5ae33f0ba0..77fe3b005141 100644 --- a/arch/arm/configs/ixp4xx_defconfig +++ b/arch/arm/configs/ixp4xx_defconfig | |||
@@ -1330,8 +1330,8 @@ CONFIG_LEDS_CLASS=y | |||
1330 | # | 1330 | # |
1331 | # LED drivers | 1331 | # LED drivers |
1332 | # | 1332 | # |
1333 | CONFIG_LEDS_IXP4XX=y | 1333 | # CONFIG_LEDS_IXP4XX is not set |
1334 | # CONFIG_LEDS_GPIO is not set | 1334 | CONFIG_LEDS_GPIO=y |
1335 | 1335 | ||
1336 | # | 1336 | # |
1337 | # LED Triggers | 1337 | # LED Triggers |
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c index a1c44efc45f6..d0e129566fbc 100644 --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/serial.h> | 15 | #include <linux/serial.h> |
16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
17 | #include <linux/leds.h> | ||
17 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
18 | #include <linux/i2c-gpio.h> | 19 | #include <linux/i2c-gpio.h> |
19 | 20 | ||
@@ -58,29 +59,28 @@ static struct i2c_board_info __initdata dsmg600_i2c_board_info [] = { | |||
58 | }, | 59 | }, |
59 | }; | 60 | }; |
60 | 61 | ||
61 | #ifdef CONFIG_LEDS_CLASS | 62 | static struct gpio_led dsmg600_led_pins[] = { |
62 | static struct resource dsmg600_led_resources[] = { | ||
63 | { | 63 | { |
64 | .name = "power", | 64 | .name = "power", |
65 | .start = DSMG600_LED_PWR_GPIO, | 65 | .gpio = DSMG600_LED_PWR_GPIO, |
66 | .end = DSMG600_LED_PWR_GPIO, | ||
67 | .flags = IXP4XX_GPIO_HIGH, | ||
68 | }, | 66 | }, |
69 | { | 67 | { |
70 | .name = "wlan", | 68 | .name = "wlan", |
71 | .start = DSMG600_LED_WLAN_GPIO, | 69 | .gpio = DSMG600_LED_WLAN_GPIO, |
72 | .end = DSMG600_LED_WLAN_GPIO, | 70 | .active_low = true, |
73 | .flags = IXP4XX_GPIO_LOW, | ||
74 | }, | 71 | }, |
75 | }; | 72 | }; |
76 | 73 | ||
74 | static struct gpio_led_platform_data dsmg600_led_data = { | ||
75 | .num_leds = ARRAY_SIZE(dsmg600_led_pins), | ||
76 | .leds = dsmg600_led_pins, | ||
77 | }; | ||
78 | |||
77 | static struct platform_device dsmg600_leds = { | 79 | static struct platform_device dsmg600_leds = { |
78 | .name = "IXP4XX-GPIO-LED", | 80 | .name = "leds-gpio", |
79 | .id = -1, | 81 | .id = -1, |
80 | .num_resources = ARRAY_SIZE(dsmg600_led_resources), | 82 | .dev.platform_data = &dsmg600_led_data, |
81 | .resource = dsmg600_led_resources, | ||
82 | }; | 83 | }; |
83 | #endif | ||
84 | 84 | ||
85 | static struct resource dsmg600_uart_resources[] = { | 85 | static struct resource dsmg600_uart_resources[] = { |
86 | { | 86 | { |
@@ -128,6 +128,7 @@ static struct platform_device dsmg600_uart = { | |||
128 | static struct platform_device *dsmg600_devices[] __initdata = { | 128 | static struct platform_device *dsmg600_devices[] __initdata = { |
129 | &dsmg600_i2c_gpio, | 129 | &dsmg600_i2c_gpio, |
130 | &dsmg600_flash, | 130 | &dsmg600_flash, |
131 | &dsmg600_leds, | ||
131 | }; | 132 | }; |
132 | 133 | ||
133 | static void dsmg600_power_off(void) | 134 | static void dsmg600_power_off(void) |
@@ -175,11 +176,6 @@ static void __init dsmg600_init(void) | |||
175 | (void)platform_device_register(&dsmg600_uart); | 176 | (void)platform_device_register(&dsmg600_uart); |
176 | 177 | ||
177 | platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); | 178 | platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); |
178 | |||
179 | #ifdef CONFIG_LEDS_CLASS | ||
180 | /* We don't care whether or not this works. */ | ||
181 | (void)platform_device_register(&dsmg600_leds); | ||
182 | #endif | ||
183 | } | 179 | } |
184 | 180 | ||
185 | MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") | 181 | 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 dc782d06c2b1..5801579ae959 100644 --- a/arch/arm/mach-ixp4xx/nas100d-setup.c +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c | |||
@@ -46,35 +46,34 @@ static struct i2c_board_info __initdata nas100d_i2c_board_info [] = { | |||
46 | }, | 46 | }, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | #ifdef CONFIG_LEDS_IXP4XX | 49 | static struct gpio_led nas100d_led_pins[] = { |
50 | static struct resource nas100d_led_resources[] = { | ||
51 | { | 50 | { |
52 | .name = "wlan", /* green led */ | 51 | .name = "wlan", /* green led */ |
53 | .start = NAS100D_LED_WLAN_GPIO, | 52 | .gpio = NAS100D_LED_WLAN_GPIO, |
54 | .end = NAS100D_LED_WLAN_GPIO, | 53 | .active_low = true, |
55 | .flags = IXP4XX_GPIO_LOW, | ||
56 | }, | 54 | }, |
57 | { | 55 | { |
58 | .name = "power", /* blue power led (off=flashing) */ | 56 | .name = "power", /* blue power led (off=flashing) */ |
59 | .start = NAS100D_LED_PWR_GPIO, | 57 | .gpio = NAS100D_LED_PWR_GPIO, |
60 | .end = NAS100D_LED_PWR_GPIO, | 58 | .active_low = true, |
61 | .flags = IXP4XX_GPIO_LOW, | ||
62 | }, | 59 | }, |
63 | { | 60 | { |
64 | .name = "disk", /* yellow led */ | 61 | .name = "disk", /* yellow led */ |
65 | .start = NAS100D_LED_DISK_GPIO, | 62 | .gpio = NAS100D_LED_DISK_GPIO, |
66 | .end = NAS100D_LED_DISK_GPIO, | 63 | .active_low = true, |
67 | .flags = IXP4XX_GPIO_LOW, | ||
68 | }, | 64 | }, |
69 | }; | 65 | }; |
70 | 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 | |||
71 | static struct platform_device nas100d_leds = { | 72 | static struct platform_device nas100d_leds = { |
72 | .name = "IXP4XX-GPIO-LED", | 73 | .name = "leds-gpio", |
73 | .id = -1, | 74 | .id = -1, |
74 | .num_resources = ARRAY_SIZE(nas100d_led_resources), | 75 | .dev.platform_data = &nas100d_led_data, |
75 | .resource = nas100d_led_resources, | ||
76 | }; | 76 | }; |
77 | #endif | ||
78 | 77 | ||
79 | static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = { | 78 | static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = { |
80 | .sda_pin = NAS100D_SDA_PIN, | 79 | .sda_pin = NAS100D_SDA_PIN, |
@@ -135,9 +134,7 @@ static struct platform_device nas100d_uart = { | |||
135 | static struct platform_device *nas100d_devices[] __initdata = { | 134 | static struct platform_device *nas100d_devices[] __initdata = { |
136 | &nas100d_i2c_gpio, | 135 | &nas100d_i2c_gpio, |
137 | &nas100d_flash, | 136 | &nas100d_flash, |
138 | #ifdef CONFIG_LEDS_IXP4XX | ||
139 | &nas100d_leds, | 137 | &nas100d_leds, |
140 | #endif | ||
141 | }; | 138 | }; |
142 | 139 | ||
143 | static void nas100d_power_off(void) | 140 | 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 16d091c98ea6..41d55c84164a 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -54,41 +54,37 @@ static struct i2c_board_info __initdata nslu2_i2c_board_info [] = { | |||
54 | }, | 54 | }, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #ifdef CONFIG_LEDS_IXP4XX | 57 | static struct gpio_led nslu2_led_pins[] = { |
58 | static struct resource nslu2_led_resources[] = { | ||
59 | { | 58 | { |
60 | .name = "ready", /* green led */ | 59 | .name = "ready", /* green led */ |
61 | .start = NSLU2_LED_GRN_GPIO, | 60 | .gpio = NSLU2_LED_GRN_GPIO, |
62 | .end = NSLU2_LED_GRN_GPIO, | ||
63 | .flags = IXP4XX_GPIO_HIGH, | ||
64 | }, | 61 | }, |
65 | { | 62 | { |
66 | .name = "status", /* red led */ | 63 | .name = "status", /* red led */ |
67 | .start = NSLU2_LED_RED_GPIO, | 64 | .gpio = NSLU2_LED_RED_GPIO, |
68 | .end = NSLU2_LED_RED_GPIO, | ||
69 | .flags = IXP4XX_GPIO_HIGH, | ||
70 | }, | 65 | }, |
71 | { | 66 | { |
72 | .name = "disk-1", | 67 | .name = "disk-1", |
73 | .start = NSLU2_LED_DISK1_GPIO, | 68 | .gpio = NSLU2_LED_DISK1_GPIO, |
74 | .end = NSLU2_LED_DISK1_GPIO, | 69 | .active_low = true, |
75 | .flags = IXP4XX_GPIO_LOW, | ||
76 | }, | 70 | }, |
77 | { | 71 | { |
78 | .name = "disk-2", | 72 | .name = "disk-2", |
79 | .start = NSLU2_LED_DISK2_GPIO, | 73 | .gpio = NSLU2_LED_DISK2_GPIO, |
80 | .end = NSLU2_LED_DISK2_GPIO, | 74 | .active_low = true, |
81 | .flags = IXP4XX_GPIO_LOW, | ||
82 | }, | 75 | }, |
83 | }; | 76 | }; |
84 | 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 | |||
85 | static struct platform_device nslu2_leds = { | 83 | static struct platform_device nslu2_leds = { |
86 | .name = "IXP4XX-GPIO-LED", | 84 | .name = "leds-gpio", |
87 | .id = -1, | 85 | .id = -1, |
88 | .num_resources = ARRAY_SIZE(nslu2_led_resources), | 86 | .dev.platform_data = &nslu2_led_data, |
89 | .resource = nslu2_led_resources, | ||
90 | }; | 87 | }; |
91 | #endif | ||
92 | 88 | ||
93 | static struct platform_device nslu2_i2c_gpio = { | 89 | static struct platform_device nslu2_i2c_gpio = { |
94 | .name = "i2c-gpio", | 90 | .name = "i2c-gpio", |
@@ -151,9 +147,7 @@ static struct platform_device *nslu2_devices[] __initdata = { | |||
151 | &nslu2_i2c_gpio, | 147 | &nslu2_i2c_gpio, |
152 | &nslu2_flash, | 148 | &nslu2_flash, |
153 | &nslu2_beeper, | 149 | &nslu2_beeper, |
154 | #ifdef CONFIG_LEDS_IXP4XX | ||
155 | &nslu2_leds, | 150 | &nslu2_leds, |
156 | #endif | ||
157 | }; | 151 | }; |
158 | 152 | ||
159 | static void nslu2_power_off(void) | 153 | static void nslu2_power_off(void) |