Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
[pandora-kernel.git] / arch / arm / mach-ux500 / board-mop500.c
index a10abc7..6e1907f 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/mfd/ab8500.h>
 #include <linux/regulator/ab8500.h>
 #include <linux/mfd/tc3589x.h>
+#include <linux/mfd/tps6105x.h>
 #include <linux/mfd/ab8500/gpio.h>
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
@@ -51,7 +52,7 @@ static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
         * on value present in GpioSel1 to GpioSel6 and AlternatFunction
         * register. This is the array of 7 configuration settings.
         * One has to compile time decide these settings. Below is the
-        * explaination of these setting
+        * explanation of these setting
         * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
         * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
         * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
@@ -92,6 +93,15 @@ struct platform_device ab8500_device = {
        .resource = ab8500_resources,
 };
 
+/*
+ * TPS61052
+ */
+
+static struct tps6105x_platform_data mop500_tps61052_data = {
+       .mode = TPS6105X_MODE_VOLTAGE,
+       .regulator_data = &tps61052_regulator,
+};
+
 /*
  * TC35892
  */
@@ -162,14 +172,21 @@ static struct lp5521_platform_data __initdata lp5521_sec_data = {
        .clock_mode     = LP5521_CLOCK_EXT,
 };
 
-static struct i2c_board_info mop500_i2c0_devices[] = {
+static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
        {
                I2C_BOARD_INFO("tc3589x", 0x42),
                .irq            = NOMADIK_GPIO_TO_IRQ(217),
                .platform_data  = &mop500_tc35892_data,
        },
+       /* I2C0 devices only available prior to HREFv60 */
+       {
+               I2C_BOARD_INFO("tps61052", 0x33),
+               .platform_data  = &mop500_tps61052_data,
+       },
 };
 
+#define NUM_PRE_V60_I2C0_DEVICES 1
+
 static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
        {
                /* lp5521 LED driver, 1st device */
@@ -407,6 +424,8 @@ static void __init mop500_uart_init(void)
 
 static void __init mop500_init_machine(void)
 {
+       int i2c0_devs;
+
        /*
         * The HREFv60 board removed a GPIO expander and routed
         * all these GPIO pins to the internal GPIO controller
@@ -430,8 +449,11 @@ static void __init mop500_init_machine(void)
 
        platform_device_register(&ab8500_device);
 
-       i2c_register_board_info(0, mop500_i2c0_devices,
-                               ARRAY_SIZE(mop500_i2c0_devices));
+       i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
+       if (machine_is_hrefv60())
+               i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
+
+       i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
        i2c_register_board_info(2, mop500_i2c2_devices,
                                ARRAY_SIZE(mop500_i2c2_devices));
 }