summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Cherry <tcherry@nvidia.com>2010-12-13 11:18:28 -0800
committerBharat Nihalani <bnihalani@nvidia.com>2010-12-16 22:48:40 -0800
commitb6e60c1de3c59961789d0e74070d78bf05bfcd17 (patch)
treeacf2f40d564d24ebda5c38ca7dbae23a1277874a /arch
parent7deba5c31ac3b15762156955d617306e89819672 (diff)
max8907c regulator for whistler
Change-Id: I03149a2ca8d7fd1724a450612ac37c750167d7cd Reviewed-on: http://git-master/r/11699 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-whistler-power.c172
1 files changed, 171 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-power.c b/arch/arm/mach-tegra/board-whistler-power.c
index 22f57135cac7..46aeef1001c9 100644
--- a/arch/arm/mach-tegra/board-whistler-power.c
+++ b/arch/arm/mach-tegra/board-whistler-power.c
@@ -20,7 +20,8 @@
#include <linux/platform_device.h>
#include <linux/resource.h>
#include <linux/regulator/machine.h>
-#include <linux/mfd/tps6586x.h>
+#include <linux/mfd/max8907c.h>
+#include <linux/regulator/max8907c-regulator.h>
#include <linux/gpio.h>
#include <mach/suspend.h>
#include <linux/io.h>
@@ -33,6 +34,165 @@
#include "wakeups-t2.h"
#include "board.h"
+#define PMC_CTRL 0x0
+ #define PMC_CTRL_INTR_LOW (1 << 17)
+
+static struct regulator_consumer_supply max8907c_SD1_supply[] = {
+ REGULATOR_SUPPLY("vdd_cpu", NULL),
+};
+
+static struct regulator_consumer_supply max8907c_SD2_supply[] = {
+ REGULATOR_SUPPLY("vdd_core", NULL),
+};
+
+static struct regulator_consumer_supply max8907c_SD3_supply[] = {
+ REGULATOR_SUPPLY("vddio_sys", NULL),
+};
+
+static struct regulator_consumer_supply max8907c_LDO1_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO2_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO3_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO4_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO5_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO6_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO7_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO8_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO9_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO10_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO11_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO12_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO13_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO14_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO15_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO16_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO17_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO18_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO19_supply[] = {
+};
+
+static struct regulator_consumer_supply max8907c_LDO20_supply[] = {
+};
+
+#define MAX8907C_REGULATOR_DEVICE(_id, _minmv, _maxmv) \
+static struct regulator_init_data max8907c_##_id##_data = { \
+ .constraints = { \
+ .min_uV = (_minmv), \
+ .max_uV = (_maxmv), \
+ .valid_modes_mask = (REGULATOR_MODE_NORMAL | \
+ REGULATOR_MODE_STANDBY), \
+ .valid_ops_mask = (REGULATOR_CHANGE_MODE | \
+ REGULATOR_CHANGE_STATUS | \
+ REGULATOR_CHANGE_VOLTAGE), \
+ }, \
+ .num_consumer_supplies = ARRAY_SIZE(max8907c_##_id##_supply), \
+ .consumer_supplies = max8907c_##_id##_supply, \
+}; \
+static struct platform_device max8907c_##_id##_device = { \
+ .name = "max8907c-regulator", \
+ .id = MAX8907C_##_id, \
+ .dev = { \
+ .platform_data = &max8907c_##_id##_data, \
+ }, \
+}
+
+MAX8907C_REGULATOR_DEVICE(SD1, 637500, 1425000);
+MAX8907C_REGULATOR_DEVICE(SD2, 650000, 2225000);
+MAX8907C_REGULATOR_DEVICE(SD3, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO1, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO2, 650000, 2225000);
+MAX8907C_REGULATOR_DEVICE(LDO3, 650000, 2225000);
+MAX8907C_REGULATOR_DEVICE(LDO4, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO5, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO6, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO7, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO8, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO9, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO10, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO11, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO12, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO13, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO14, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO15, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO16, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO17, 650000, 2225000);
+MAX8907C_REGULATOR_DEVICE(LDO18, 650000, 2225000);
+MAX8907C_REGULATOR_DEVICE(LDO19, 750000, 3900000);
+MAX8907C_REGULATOR_DEVICE(LDO20, 750000, 3900000);
+
+static struct platform_device *whistler_max8907c_power_devices[] = {
+ &max8907c_SD1_device,
+ &max8907c_SD2_device,
+ &max8907c_SD3_device,
+ &max8907c_LDO1_device,
+ &max8907c_LDO2_device,
+ &max8907c_LDO3_device,
+ &max8907c_LDO4_device,
+ &max8907c_LDO5_device,
+ &max8907c_LDO6_device,
+ &max8907c_LDO7_device,
+ &max8907c_LDO8_device,
+ &max8907c_LDO9_device,
+ &max8907c_LDO10_device,
+ &max8907c_LDO11_device,
+ &max8907c_LDO12_device,
+ &max8907c_LDO13_device,
+ &max8907c_LDO14_device,
+ &max8907c_LDO15_device,
+ &max8907c_LDO16_device,
+ &max8907c_LDO17_device,
+ &max8907c_LDO18_device,
+ &max8907c_LDO19_device,
+ &max8907c_LDO20_device,
+};
+
+static struct max8907c_platform_data max8907c_pdata = {
+ .num_subdevs = ARRAY_SIZE(whistler_max8907c_power_devices),
+ .subdevs = whistler_max8907c_power_devices,
+};
+
+static struct i2c_board_info __initdata whistler_regulators[] = {
+ {
+ I2C_BOARD_INFO("max8907c", 0x3C),
+ .platform_data = &max8907c_pdata,
+ },
+};
+
static struct tegra_suspend_platform_data whistler_suspend_data = {
.cpu_timer = 2000,
.cpu_off_timer = 0,
@@ -50,6 +210,16 @@ static struct tegra_suspend_platform_data whistler_suspend_data = {
int __init whistler_regulator_init(void)
{
+ void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
+ u32 pmc_ctrl;
+
+ /* configure the power management controller to trigger PMU
+ * interrupts when low */
+ pmc_ctrl = readl(pmc + PMC_CTRL);
+ writel(pmc_ctrl | PMC_CTRL_INTR_LOW, pmc + PMC_CTRL);
+
+ i2c_register_board_info(4, whistler_regulators, 1);
+
tegra_init_suspend(&whistler_suspend_data);
return 0;