[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>
This commit is contained in:
parent
7822591370
commit
1208ebf25b
@ -1330,8 +1330,8 @@ CONFIG_LEDS_CLASS=y
|
|||||||
#
|
#
|
||||||
# LED drivers
|
# LED drivers
|
||||||
#
|
#
|
||||||
CONFIG_LEDS_IXP4XX=y
|
# CONFIG_LEDS_IXP4XX is not set
|
||||||
# CONFIG_LEDS_GPIO is not set
|
CONFIG_LEDS_GPIO=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# LED Triggers
|
# LED Triggers
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
#include <linux/serial_8250.h>
|
#include <linux/serial_8250.h>
|
||||||
|
#include <linux/leds.h>
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/i2c-gpio.h>
|
#include <linux/i2c-gpio.h>
|
||||||
|
|
||||||
@ -58,29 +59,28 @@ static struct i2c_board_info __initdata dsmg600_i2c_board_info [] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_LEDS_CLASS
|
static struct gpio_led dsmg600_led_pins[] = {
|
||||||
static struct resource dsmg600_led_resources[] = {
|
|
||||||
{
|
{
|
||||||
.name = "power",
|
.name = "power",
|
||||||
.start = DSMG600_LED_PWR_GPIO,
|
.gpio = DSMG600_LED_PWR_GPIO,
|
||||||
.end = DSMG600_LED_PWR_GPIO,
|
|
||||||
.flags = IXP4XX_GPIO_HIGH,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "wlan",
|
.name = "wlan",
|
||||||
.start = DSMG600_LED_WLAN_GPIO,
|
.gpio = DSMG600_LED_WLAN_GPIO,
|
||||||
.end = DSMG600_LED_WLAN_GPIO,
|
.active_low = true,
|
||||||
.flags = IXP4XX_GPIO_LOW,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device dsmg600_leds = {
|
static struct gpio_led_platform_data dsmg600_led_data = {
|
||||||
.name = "IXP4XX-GPIO-LED",
|
.num_leds = ARRAY_SIZE(dsmg600_led_pins),
|
||||||
.id = -1,
|
.leds = dsmg600_led_pins,
|
||||||
.num_resources = ARRAY_SIZE(dsmg600_led_resources),
|
};
|
||||||
.resource = dsmg600_led_resources,
|
|
||||||
|
static struct platform_device dsmg600_leds = {
|
||||||
|
.name = "leds-gpio",
|
||||||
|
.id = -1,
|
||||||
|
.dev.platform_data = &dsmg600_led_data,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct resource dsmg600_uart_resources[] = {
|
static struct resource dsmg600_uart_resources[] = {
|
||||||
{
|
{
|
||||||
@ -128,6 +128,7 @@ static struct platform_device dsmg600_uart = {
|
|||||||
static struct platform_device *dsmg600_devices[] __initdata = {
|
static struct platform_device *dsmg600_devices[] __initdata = {
|
||||||
&dsmg600_i2c_gpio,
|
&dsmg600_i2c_gpio,
|
||||||
&dsmg600_flash,
|
&dsmg600_flash,
|
||||||
|
&dsmg600_leds,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dsmg600_power_off(void)
|
static void dsmg600_power_off(void)
|
||||||
@ -175,11 +176,6 @@ static void __init dsmg600_init(void)
|
|||||||
(void)platform_device_register(&dsmg600_uart);
|
(void)platform_device_register(&dsmg600_uart);
|
||||||
|
|
||||||
platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
|
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")
|
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
|
||||||
|
@ -46,35 +46,34 @@ static struct i2c_board_info __initdata nas100d_i2c_board_info [] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_LEDS_IXP4XX
|
static struct gpio_led nas100d_led_pins[] = {
|
||||||
static struct resource nas100d_led_resources[] = {
|
|
||||||
{
|
{
|
||||||
.name = "wlan", /* green led */
|
.name = "wlan", /* green led */
|
||||||
.start = NAS100D_LED_WLAN_GPIO,
|
.gpio = NAS100D_LED_WLAN_GPIO,
|
||||||
.end = NAS100D_LED_WLAN_GPIO,
|
.active_low = true,
|
||||||
.flags = IXP4XX_GPIO_LOW,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "power", /* blue power led (off=flashing) */
|
.name = "power", /* blue power led (off=flashing) */
|
||||||
.start = NAS100D_LED_PWR_GPIO,
|
.gpio = NAS100D_LED_PWR_GPIO,
|
||||||
.end = NAS100D_LED_PWR_GPIO,
|
.active_low = true,
|
||||||
.flags = IXP4XX_GPIO_LOW,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "disk", /* yellow led */
|
.name = "disk", /* yellow led */
|
||||||
.start = NAS100D_LED_DISK_GPIO,
|
.gpio = NAS100D_LED_DISK_GPIO,
|
||||||
.end = NAS100D_LED_DISK_GPIO,
|
.active_low = true,
|
||||||
.flags = IXP4XX_GPIO_LOW,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device nas100d_leds = {
|
static struct gpio_led_platform_data nas100d_led_data = {
|
||||||
.name = "IXP4XX-GPIO-LED",
|
.num_leds = ARRAY_SIZE(nas100d_led_pins),
|
||||||
.id = -1,
|
.leds = nas100d_led_pins,
|
||||||
.num_resources = ARRAY_SIZE(nas100d_led_resources),
|
};
|
||||||
.resource = nas100d_led_resources,
|
|
||||||
|
static struct platform_device nas100d_leds = {
|
||||||
|
.name = "leds-gpio",
|
||||||
|
.id = -1,
|
||||||
|
.dev.platform_data = &nas100d_led_data,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
|
static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
|
||||||
.sda_pin = NAS100D_SDA_PIN,
|
.sda_pin = NAS100D_SDA_PIN,
|
||||||
@ -135,9 +134,7 @@ static struct platform_device nas100d_uart = {
|
|||||||
static struct platform_device *nas100d_devices[] __initdata = {
|
static struct platform_device *nas100d_devices[] __initdata = {
|
||||||
&nas100d_i2c_gpio,
|
&nas100d_i2c_gpio,
|
||||||
&nas100d_flash,
|
&nas100d_flash,
|
||||||
#ifdef CONFIG_LEDS_IXP4XX
|
|
||||||
&nas100d_leds,
|
&nas100d_leds,
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void nas100d_power_off(void)
|
static void nas100d_power_off(void)
|
||||||
|
@ -54,41 +54,37 @@ static struct i2c_board_info __initdata nslu2_i2c_board_info [] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_LEDS_IXP4XX
|
static struct gpio_led nslu2_led_pins[] = {
|
||||||
static struct resource nslu2_led_resources[] = {
|
|
||||||
{
|
{
|
||||||
.name = "ready", /* green led */
|
.name = "ready", /* green led */
|
||||||
.start = NSLU2_LED_GRN_GPIO,
|
.gpio = NSLU2_LED_GRN_GPIO,
|
||||||
.end = NSLU2_LED_GRN_GPIO,
|
|
||||||
.flags = IXP4XX_GPIO_HIGH,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "status", /* red led */
|
.name = "status", /* red led */
|
||||||
.start = NSLU2_LED_RED_GPIO,
|
.gpio = NSLU2_LED_RED_GPIO,
|
||||||
.end = NSLU2_LED_RED_GPIO,
|
|
||||||
.flags = IXP4XX_GPIO_HIGH,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "disk-1",
|
.name = "disk-1",
|
||||||
.start = NSLU2_LED_DISK1_GPIO,
|
.gpio = NSLU2_LED_DISK1_GPIO,
|
||||||
.end = NSLU2_LED_DISK1_GPIO,
|
.active_low = true,
|
||||||
.flags = IXP4XX_GPIO_LOW,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "disk-2",
|
.name = "disk-2",
|
||||||
.start = NSLU2_LED_DISK2_GPIO,
|
.gpio = NSLU2_LED_DISK2_GPIO,
|
||||||
.end = NSLU2_LED_DISK2_GPIO,
|
.active_low = true,
|
||||||
.flags = IXP4XX_GPIO_LOW,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device nslu2_leds = {
|
static struct gpio_led_platform_data nslu2_led_data = {
|
||||||
.name = "IXP4XX-GPIO-LED",
|
.num_leds = ARRAY_SIZE(nslu2_led_pins),
|
||||||
.id = -1,
|
.leds = nslu2_led_pins,
|
||||||
.num_resources = ARRAY_SIZE(nslu2_led_resources),
|
};
|
||||||
.resource = nslu2_led_resources,
|
|
||||||
|
static struct platform_device nslu2_leds = {
|
||||||
|
.name = "leds-gpio",
|
||||||
|
.id = -1,
|
||||||
|
.dev.platform_data = &nslu2_led_data,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct platform_device nslu2_i2c_gpio = {
|
static struct platform_device nslu2_i2c_gpio = {
|
||||||
.name = "i2c-gpio",
|
.name = "i2c-gpio",
|
||||||
@ -151,9 +147,7 @@ static struct platform_device *nslu2_devices[] __initdata = {
|
|||||||
&nslu2_i2c_gpio,
|
&nslu2_i2c_gpio,
|
||||||
&nslu2_flash,
|
&nslu2_flash,
|
||||||
&nslu2_beeper,
|
&nslu2_beeper,
|
||||||
#ifdef CONFIG_LEDS_IXP4XX
|
|
||||||
&nslu2_leds,
|
&nslu2_leds,
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void nslu2_power_off(void)
|
static void nslu2_power_off(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user