ARM: dalmore: Enable tps51632 cpu regulator
Pradeep Kumar [Tue, 7 Aug 2012 12:07:12 +0000 (17:07 +0530)]
Bug 978821

Change-Id: I2510465bfd485473f35380077fa640cee5df7992
Signed-off-by: Pradeep Kumar <pgoudagunta@nvidia.com>
Reviewed-on: http://git-master/r/121628
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

arch/arm/mach-tegra/board-dalmore-power.c

index fd205c3..62217fd 100644 (file)
@@ -22,6 +22,9 @@
 #include <linux/platform_device.h>
 #include <linux/resource.h>
 #include <linux/io.h>
+#include <linux/regulator/tps51632-regulator.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/driver.h>
 
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include "board-dalmore.h"
 
 
+/* TPS51632 DC-DC converter */
+static struct regulator_consumer_supply tps51632_dcdc_supply[] = {
+       REGULATOR_SUPPLY("vdd_cpu", NULL),
+};
+
+static struct regulator_init_data tps51632_init_data = {
+       .constraints = {                                                \
+               .min_uV = 500000,                                       \
+                       .max_uV = 1520000,                              \
+                       .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
+                                       REGULATOR_MODE_STANDBY),        \
+                       .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
+                                       REGULATOR_CHANGE_STATUS |       \
+                                       REGULATOR_CHANGE_VOLTAGE),      \
+                       .always_on = 1,                                 \
+                       .boot_on =  1,                                  \
+                       .apply_uV = 0,                                  \
+       },                                                              \
+       .num_consumer_supplies = ARRAY_SIZE(tps51632_dcdc_supply),      \
+               .consumer_supplies = tps51632_dcdc_supply,              \
+};
+
+static struct tps51632_regulator_platform_data tps51632_pdata = {
+       .reg_init_data = &tps51632_init_data,           \
+       .enable_pwm = false,                            \
+       .max_voltage_uV = 1520000,                      \
+       .base_voltage_uV = 500000,                      \
+       .slew_rate_uv_per_us = 6000,                    \
+};
+
+static struct i2c_board_info __initdata tps51632_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("tps51632", 0x43),
+               .platform_data  = &tps51632_pdata,
+       },
+};
+
 static int ac_online(void)
 {
        return 1;
@@ -66,12 +106,12 @@ static struct tegra_suspend_platform_data dalmore_suspend_data = {
        .sysclkreq_high = true,
 };
 
+
 int __init dalmore_regulator_init(void)
 {
-
+       i2c_register_board_info(4, tps51632_boardinfo, 1);
        platform_device_register(&dalmore_pda_power_device);
        return 0;
-
 }
 
 int __init dalmore_suspend_init(void)