diff options
author | Preetham Chandru <pchandru@nvidia.com> | 2011-10-05 18:54:25 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2011-10-11 03:16:44 -0700 |
commit | 698f68a7721581177de5d67b47bcc62be10b2506 (patch) | |
tree | 03357b38e73f8a6e6a635032b664ffba6072e767 /arch/arm | |
parent | 896c91729dd756af6ecd79d894edf53915982cfe (diff) |
arm: tegra: harmony: Add Regulators & config PMC interrupt
Added regulators and configured the PMC interrupt polarity to low.
Bug: 879944
Change-Id: I94bc2cb78c311cc7fe9c713592b49ecfe4cf8176
Signed-off-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-on: http://git-master/r/56226
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-by: Allen Martin <amartin@nvidia.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-power.c | 124 |
1 files changed, 94 insertions, 30 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c index 0b4912b8bc50..a8da38f53f27 100644 --- a/arch/arm/mach-tegra/board-harmony-power.c +++ b/arch/arm/mach-tegra/board-harmony-power.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 NVIDIA, Inc. + * Copyright (C) 2010-2011 NVIDIA, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -21,7 +21,9 @@ #include <linux/regulator/machine.h> #include <linux/mfd/tps6586x.h> +#include <linux/io.h> +#include <mach/iomap.h> #include <mach/irqs.h> #include "board-harmony.h" @@ -29,26 +31,68 @@ #define PMC_CTRL 0x0 #define PMC_CTRL_INTR_LOW (1 << 17) +static struct regulator_consumer_supply tps658621_sm0_supply[] = { + REGULATOR_SUPPLY("vdd_core", NULL), +}; + +static struct regulator_consumer_supply tps658621_sm1_supply[] = { + REGULATOR_SUPPLY("vdd_cpu", NULL), +}; + +static struct regulator_consumer_supply tps658621_sm2_supply[] = { + REGULATOR_SUPPLY("vdd_sm2", NULL), +}; + static struct regulator_consumer_supply tps658621_ldo0_supply[] = { - REGULATOR_SUPPLY("pex_clk", NULL), -}; - -static struct regulator_init_data ldo0_data = { - .constraints = { - .min_uV = 1250 * 1000, - .max_uV = 3300 * 1000, - .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(tps658621_ldo0_supply), - .consumer_supplies = tps658621_ldo0_supply, + REGULATOR_SUPPLY("p_cam_avdd", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo1_supply[] = { + REGULATOR_SUPPLY("avdd_pll", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo2_supply[] = { + REGULATOR_SUPPLY("vdd_rtc", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo3_supply[] = { + REGULATOR_SUPPLY("avdd_usb", NULL), + REGULATOR_SUPPLY("avdd_usb_pll", NULL), + REGULATOR_SUPPLY("avdd_lvds", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo4_supply[] = { + REGULATOR_SUPPLY("avdd_osc", NULL), + REGULATOR_SUPPLY("vddio_sys", "panjit_touch"), }; -#define HARMONY_REGULATOR_INIT(_id, _minmv, _maxmv) \ - static struct regulator_init_data _id##_data = { \ +static struct regulator_consumer_supply tps658621_ldo5_supply[] = { + REGULATOR_SUPPLY("vcore_mmc", "sdhci-tegra.1"), + REGULATOR_SUPPLY("vcore_mmc", "sdhci-tegra.3"), +}; + +static struct regulator_consumer_supply tps658621_ldo6_supply[] = { + REGULATOR_SUPPLY("avdd_vdac", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo7_supply[] = { + REGULATOR_SUPPLY("avdd_hdmi", NULL), + REGULATOR_SUPPLY("vdd_fuse", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo8_supply[] = { + REGULATOR_SUPPLY("avdd_hdmi_pll", NULL), +}; + +static struct regulator_consumer_supply tps658621_ldo9_supply[] = { + REGULATOR_SUPPLY("avdd_2v85", NULL), + REGULATOR_SUPPLY("vdd_ddr_rx", NULL), + REGULATOR_SUPPLY("avdd_amp", NULL), +}; + + +#define REGULATOR_INIT(_id, _minmv, _maxmv) \ + { \ .constraints = { \ .min_uV = (_minmv)*1000, \ .max_uV = (_maxmv)*1000, \ @@ -58,20 +102,27 @@ static struct regulator_init_data ldo0_data = { REGULATOR_CHANGE_STATUS | \ REGULATOR_CHANGE_VOLTAGE), \ }, \ + .num_consumer_supplies = ARRAY_SIZE(tps658621_##_id##_supply),\ + .consumer_supplies = tps658621_##_id##_supply, \ } -HARMONY_REGULATOR_INIT(sm0, 725, 1500); -HARMONY_REGULATOR_INIT(sm1, 725, 1500); -HARMONY_REGULATOR_INIT(sm2, 3000, 4550); -HARMONY_REGULATOR_INIT(ldo1, 725, 1500); -HARMONY_REGULATOR_INIT(ldo2, 725, 1500); -HARMONY_REGULATOR_INIT(ldo3, 1250, 3300); -HARMONY_REGULATOR_INIT(ldo4, 1700, 2475); -HARMONY_REGULATOR_INIT(ldo5, 1250, 3300); -HARMONY_REGULATOR_INIT(ldo6, 1250, 3300); -HARMONY_REGULATOR_INIT(ldo7, 1250, 3300); -HARMONY_REGULATOR_INIT(ldo8, 1250, 3300); -HARMONY_REGULATOR_INIT(ldo9, 1250, 3300); +static struct regulator_init_data sm0_data = REGULATOR_INIT(sm0, 725, 1500); +static struct regulator_init_data sm1_data = REGULATOR_INIT(sm1, 725, 1500); +static struct regulator_init_data sm2_data = REGULATOR_INIT(sm2, 3000, 4550); +static struct regulator_init_data ldo0_data = REGULATOR_INIT(ldo0, 1250, 3300); +static struct regulator_init_data ldo1_data = REGULATOR_INIT(ldo1, 725, 1500); +static struct regulator_init_data ldo2_data = REGULATOR_INIT(ldo2, 725, 1500); +static struct regulator_init_data ldo3_data = REGULATOR_INIT(ldo3, 1250, 3300); +static struct regulator_init_data ldo4_data = REGULATOR_INIT(ldo4, 1700, 2475); +static struct regulator_init_data ldo5_data = REGULATOR_INIT(ldo5, 1250, 3300); +static struct regulator_init_data ldo6_data = REGULATOR_INIT(ldo6, 1250, 3300); +static struct regulator_init_data ldo7_data = REGULATOR_INIT(ldo7, 1250, 3300); +static struct regulator_init_data ldo8_data = REGULATOR_INIT(ldo8, 1250, 3300); +static struct regulator_init_data ldo9_data = REGULATOR_INIT(ldo9, 1250, 3300); + +static struct tps6586x_rtc_platform_data rtc_data = { + .irq = TEGRA_NR_IRQS + TPS6586X_INT_RTC_ALM1, +}; #define TPS_REG(_id, _data) \ { \ @@ -94,6 +145,11 @@ static struct tps6586x_subdev_info tps_devs[] = { TPS_REG(LDO_7, &ldo7_data), TPS_REG(LDO_8, &ldo8_data), TPS_REG(LDO_9, &ldo9_data), + { + .id = 0, + .name = "tps6586x-rtc", + .platform_data = &rtc_data, + }, }; static struct tps6586x_platform_data tps_platform = { @@ -113,6 +169,14 @@ static struct i2c_board_info __initdata harmony_regulators[] = { int __init harmony_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, harmony_regulators, 1); return 0; |