]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-ixp4xx/nas100d-setup.c
[ARM] 4805/1: ixp4xx: Use leds-gpio driver instead of IXP4XX-GPIO-LED driver
[linux-2.6-omap-h63xx.git] / arch / arm / mach-ixp4xx / nas100d-setup.c
index 9a31444d9214e82aea76b803c6bff835ce187829..5801579ae95912821daf0469954f746a95ee71f7 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/serial.h>
 #include <linux/serial_8250.h>
 #include <linux/leds.h>
+#include <linux/i2c.h>
+#include <linux/i2c-gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -38,46 +40,52 @@ static struct platform_device nas100d_flash = {
        .resource               = &nas100d_flash_resource,
 };
 
-#ifdef CONFIG_LEDS_IXP4XX
-static struct resource nas100d_led_resources[] = {
+static struct i2c_board_info __initdata nas100d_i2c_board_info [] = {
+       {
+               I2C_BOARD_INFO("rtc-pcf8563", 0x51),
+       },
+};
+
+static struct gpio_led nas100d_led_pins[] = {
        {
                .name           = "wlan",   /* green led */
-               .start          = 0,
-               .end            = 0,
-               .flags          = IXP4XX_GPIO_LOW,
+               .gpio           = NAS100D_LED_WLAN_GPIO,
+               .active_low     = true,
        },
        {
-               .name           = "ready",  /* blue power led (off is flashing!) */
-               .start          = 15,
-               .end            = 15,
-               .flags          = IXP4XX_GPIO_LOW,
+               .name           = "power",  /* blue power led (off=flashing) */
+               .gpio           = NAS100D_LED_PWR_GPIO,
+               .active_low     = true,
        },
        {
                .name           = "disk",   /* yellow led */
-               .start          = 3,
-               .end            = 3,
-               .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 = {
+static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
        .sda_pin                = NAS100D_SDA_PIN,
        .scl_pin                = NAS100D_SCL_PIN,
 };
 
-static struct platform_device nas100d_i2c_controller = {
-       .name                   = "IXP4XX-I2C",
+static struct platform_device nas100d_i2c_gpio = {
+       .name                   = "i2c-gpio",
        .id                     = 0,
-       .dev.platform_data      = &nas100d_i2c_gpio_pins,
-       .num_resources          = 0,
+       .dev     = {
+               .platform_data  = &nas100d_i2c_gpio_data,
+       },
 };
 
 static struct resource nas100d_uart_resources[] = {
@@ -124,11 +132,9 @@ static struct platform_device nas100d_uart = {
 };
 
 static struct platform_device *nas100d_devices[] __initdata = {
-       &nas100d_i2c_controller,
+       &nas100d_i2c_gpio,
        &nas100d_flash,
-#ifdef CONFIG_LEDS_IXP4XX
        &nas100d_leds,
-#endif
 };
 
 static void nas100d_power_off(void)
@@ -155,7 +161,11 @@ static void __init nas100d_init(void)
 
        pm_power_off = nas100d_power_off;
 
-       /* This is only useful on a modified machine, but it is valuable
+       i2c_register_board_info(0, nas100d_i2c_board_info,
+                               ARRAY_SIZE(nas100d_i2c_board_info));
+
+       /*
+        * This is only useful on a modified machine, but it is valuable
         * to have it first in order to see debug messages, and so that
         * it does *not* get removed if platform_add_devices fails!
         */