mach-ux500: configure board for the TPS61052 regulator v2
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 7 Mar 2011 10:48:15 +0000 (11:48 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 28 Mar 2011 06:54:23 +0000 (08:54 +0200)
This registers the TPS61052 regulator to the ux500 MOP/HREF boards.

Cc: Samuel Ortiz <samuel.ortiz@intel.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-ux500/Kconfig
arch/arm/mach-ux500/board-mop500-regulators.c
arch/arm/mach-ux500/board-mop500-regulators.h
arch/arm/mach-ux500/board-mop500.c

index 203b986280f54d8987f74f7b9a92d9bf5a10bc02..58626013aa322874bd0ebd33eb5ce22f2bb3ab1f 100644 (file)
@@ -23,6 +23,7 @@ menu "Ux500 target platform"
 config MACH_U8500
        bool "U8500 Development platform"
        depends on UX500_SOC_DB8500
+       select TPS6105X
        help
          Include support for the mop500 development platform.
 
index d4f33ebaf6376861ebca1c87742505b8c02d332a..9ed0f90cfe2368d33dc89f1b2a8679c69a8ddd8d 100644 (file)
 #include <linux/regulator/ab8500.h>
 #include "board-mop500-regulators.h"
 
+/*
+ * TPS61052 regulator
+ */
+static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
+       /*
+        * Boost converter supply to raise voltage on audio speaker, this
+        * is actually connected to three pins, VInVhfL (left amplifier)
+        * VInVhfR (right amplifier) and VIntDClassInt - all three must
+        * be connected to the same voltage.
+        */
+       REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
+};
+
+struct regulator_init_data tps61052_regulator = {
+       .constraints = {
+               .name = "vaudio-hf",
+               .min_uV = 4500000,
+               .max_uV = 4500000,
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
+       .consumer_supplies = tps61052_vaudio_consumers,
+};
+
 static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
        /* External displays, connector on board 2v5 power supply */
        REGULATOR_SUPPLY("vaux12v5", "mcde.0"),
index f979b892e4fa259f4822fa935e4bbc4fc8b926dd..94992158d96230ad42f65aca2fdfd5e05ceeb5ae 100644 (file)
@@ -17,5 +17,6 @@
 extern struct ab8500_regulator_reg_init
 ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
 extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
+extern struct regulator_init_data tps61052_regulator;
 
 #endif
index a10abc7d8eee9b6c30b1a7ef3d5bb11edf20b9b4..dc8746d7826ebd52407aa8a04d0f14edf7fa7af9 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>
@@ -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,7 +172,7 @@ 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),
@@ -170,6 +180,14 @@ static struct i2c_board_info mop500_i2c0_devices[] = {
        },
 };
 
+/* I2C0 devices only available prior to HREFv60 */
+static struct i2c_board_info __initdata mop500_i2c0_old_devices[] = {
+       {
+               I2C_BOARD_INFO("tps61052", 0x33),
+               .platform_data  = &mop500_tps61052_data,
+       },
+};
+
 static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
        {
                /* lp5521 LED driver, 1st device */
@@ -432,6 +450,9 @@ static void __init mop500_init_machine(void)
 
        i2c_register_board_info(0, mop500_i2c0_devices,
                                ARRAY_SIZE(mop500_i2c0_devices));
+       if (!machine_is_hrefv60())
+               i2c_register_board_info(0, mop500_i2c0_old_devices,
+                                       ARRAY_SIZE(mop500_i2c0_old_devices));
        i2c_register_board_info(2, mop500_i2c2_devices,
                                ARRAY_SIZE(mop500_i2c2_devices));
 }