Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / arm / mach-iop32x / n2100.c
index 390a97d..28f164e 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <linux/mm.h>
 #include <linux/init.h>
+#include <linux/f75375s.h>
+#include <linux/leds-pca9532.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -25,6 +27,7 @@
 #include <linux/serial_core.h>
 #include <linux/serial_8250.h>
 #include <linux/mtd/physmap.h>
+#include <linux/i2c.h>
 #include <linux/platform_device.h>
 #include <linux/reboot.h>
 #include <asm/hardware.h>
@@ -199,6 +202,71 @@ static struct platform_device n2100_serial_device = {
        .resource       = &n2100_uart_resource,
 };
 
+static struct f75375s_platform_data n2100_f75375s = {
+       .pwm            = { 255, 255 },
+       .pwm_enable = { 0, 0 },
+};
+
+static struct pca9532_platform_data n2100_leds = {
+       .leds = {
+       {       .name = "n2100:red:satafail0",
+               .state = PCA9532_OFF,
+               .type = PCA9532_TYPE_LED,
+       },
+       {       .name = "n2100:red:satafail1",
+               .state = PCA9532_OFF,
+               .type = PCA9532_TYPE_LED,
+       },
+       {       .name = "n2100:blue:usb",
+               .state = PCA9532_OFF,
+               .type = PCA9532_TYPE_LED,
+       },
+       {       .type = PCA9532_TYPE_NONE },
+
+       {       .type = PCA9532_TYPE_NONE },
+       {       .type = PCA9532_TYPE_NONE },
+       {       .type = PCA9532_TYPE_NONE },
+       {       .name = "n2100:red:usb",
+               .state = PCA9532_OFF,
+               .type = PCA9532_TYPE_LED,
+       },
+
+       {       .type = PCA9532_TYPE_NONE }, /* power OFF gpio */
+       {       .type = PCA9532_TYPE_NONE }, /* reset gpio */
+       {       .type = PCA9532_TYPE_NONE },
+       {       .type = PCA9532_TYPE_NONE },
+
+       {       .type = PCA9532_TYPE_NONE },
+       {       .name = "n2100:orange:system",
+               .state = PCA9532_OFF,
+               .type = PCA9532_TYPE_LED,
+       },
+       {       .name = "n2100:red:system",
+               .state = PCA9532_OFF,
+               .type = PCA9532_TYPE_LED,
+       },
+       {       .name = "N2100 beeper"  ,
+               .state =  PCA9532_OFF,
+               .type = PCA9532_TYPE_N2100_BEEP,
+       },
+       },
+       .psc = { 0, 0 },
+       .pwm = { 0, 0 },
+};
+
+static struct i2c_board_info __initdata n2100_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("rs5c372b", 0x32),
+       },
+       {
+               I2C_BOARD_INFO("f75375", 0x2e),
+               .platform_data = &n2100_f75375s,
+       },
+       {
+               I2C_BOARD_INFO("pca9532", 0x60),
+               .platform_data = &n2100_leds,
+       },
+};
 
 /*
  * Pull PCA9532 GPIO #8 low to power off the machine.
@@ -248,6 +316,9 @@ static void __init n2100_init_machine(void)
        platform_device_register(&iop3xx_dma_0_channel);
        platform_device_register(&iop3xx_dma_1_channel);
 
+       i2c_register_board_info(0, n2100_i2c_devices,
+               ARRAY_SIZE(n2100_i2c_devices));
+
        pm_power_off = n2100_power_off;
 
        init_timer(&power_button_poll_timer);