diff options
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-power.c')
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-power.c | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-power.c b/arch/arm/mach-tegra/board-enterprise-power.c index c17c3eaf5cfa..bbe39ec4ad3e 100644 --- a/arch/arm/mach-tegra/board-enterprise-power.c +++ b/arch/arm/mach-tegra/board-enterprise-power.c @@ -44,7 +44,6 @@ #include "board.h" #include "board-enterprise.h" #include "pm.h" -#include "wakeups-t3.h" #include "tegra3_tsensor.h" #define PMC_CTRL 0x0 @@ -141,9 +140,10 @@ static struct regulator_consumer_supply tps80031_smps4_supply_a03[] = { REGULATOR_SUPPLY("vddf_core_emmc", NULL), }; -static struct regulator_consumer_supply tps80031_vana_supply_common[] = { +static struct regulator_consumer_supply tps80031_vana_supply_a02[] = { REGULATOR_SUPPLY("unused_vana", NULL), }; +#define tps80031_vana_supply_a03 tps80031_vana_supply_a02 static struct regulator_consumer_supply tps80031_ldo1_supply_a02[] = { REGULATOR_SUPPLY("avdd_dsi_csi", NULL), @@ -269,23 +269,24 @@ TPS_PDATA_INIT(smps1, common, 600, 2100, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_ TPS_PDATA_INIT(smps2, common, 600, 2100, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(smps3, common, 600, 2100, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0); TPS_PDATA_INIT(smps4, a02, 600, 2100, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); -TPS_PDATA_INIT(smps4, a03, 600, 2100, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0); +TPS_PDATA_INIT(smps4, a03, 600, 2100, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldo1, a02, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, 0, 0); TPS_PDATA_INIT(ldo1, a03, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldo2, common, 1000, 3300, 0, 1, 1, 1, 1000, 1, 1, 0, 0, 0); TPS_PDATA_INIT(ldo3, common, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, PWR_OFF_ON_SLEEP, 0); TPS_PDATA_INIT(ldo4, a02, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0); -TPS_PDATA_INIT(ldo4, a03, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, 0, 0); +TPS_PDATA_INIT(ldo4, a03, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldo5, common, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0); TPS_PDATA_INIT(ldo6, a02, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldo6, a03, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldo7, a02, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); -TPS_PDATA_INIT(ldo7, a03, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0); +TPS_PDATA_INIT(ldo7, a03, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldoln, a02, 1000, 3300, tps80031_rails(SMPS3), 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldoln, a03, 1000, 3300, tps80031_rails(VIO), 0, 0, 0, -1, 0, 0, 0, PWR_REQ_INPUT_PREQ1, 0); TPS_PDATA_INIT(ldousb, a02, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, USBLDO_INPUT_VSYS, PWR_OFF_ON_SLEEP, 0); -TPS_PDATA_INIT(ldousb, a03, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, USBLDO_INPUT_VSYS, PWR_OFF_ON_SLEEP, 0); -TPS_PDATA_INIT(vana, common, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0); +TPS_PDATA_INIT(ldousb, a03, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, USBLDO_INPUT_VSYS, PWR_REQ_INPUT_PREQ1, 0); +TPS_PDATA_INIT(vana, a02, 1000, 3300, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0); +TPS_PDATA_INIT(vana, a03, 1000, 3300, 0, 0, 0, 0, -1, 0, 1, 0, PWR_OFF_ON_SLEEP, 0); TPS_PDATA_INIT(vbus, common, 0, 5000, 0, 0, 0, 0, -1, 0, 0, (VBUS_SW_ONLY | VBUS_DISCHRG_EN_PDN), 0, 100000); static struct tps80031_rtc_platform_data rtc_data = { @@ -298,6 +299,7 @@ static struct tps80031_rtc_platform_data rtc_data = { .tm_min = 2, .tm_sec = 3, }, + .msecure_gpio = TEGRA_GPIO_PF7, }; int battery_charger_init(void *board_data) @@ -309,7 +311,6 @@ int battery_charger_init(void *board_data) " charger fails\n", __func__); } gpio_direction_output(TEGRA_GPIO_PF6, 1); - tegra_gpio_enable(TEGRA_GPIO_PF6); return 0; } @@ -362,7 +363,6 @@ static struct tps80031_bg_platform_data battery_gauge_data = { TPS_REG(SMPS1, smps1, common), \ TPS_REG(SMPS2, smps2, common), \ TPS_REG(SMPS3, smps3, common), \ - TPS_REG(VANA, vana, common), \ TPS_REG(LDO2, ldo2, common), \ TPS_REG(LDO3, ldo3, common), \ TPS_REG(LDO5, ldo5, common), \ @@ -374,8 +374,8 @@ static struct tps80031_bg_platform_data battery_gauge_data = { static struct tps80031_subdev_info tps80031_devs_a02[] = { - TPS80031_DEVS_COMMON, TPS_REG(VIO, vio, a02), + TPS80031_DEVS_COMMON, TPS_REG(SMPS4, smps4, a02), TPS_REG(LDO1, ldo1, a02), TPS_REG(LDO4, ldo4, a02), @@ -383,12 +383,13 @@ static struct tps80031_subdev_info tps80031_devs_a02[] = { TPS_REG(LDO7, ldo7, a02), TPS_REG(LDOLN, ldoln, a02), TPS_REG(LDOUSB, ldousb, a02), + TPS_REG(VANA, vana, a02), }; static struct tps80031_subdev_info tps80031_devs_a03[] = { - TPS80031_DEVS_COMMON, TPS_REG(VIO, vio, a03), + TPS80031_DEVS_COMMON, TPS_REG(SMPS4, smps4, a03), TPS_REG(LDO1, ldo1, a03), TPS_REG(LDO4, ldo4, a03), @@ -396,10 +397,11 @@ static struct tps80031_subdev_info tps80031_devs_a03[] = { TPS_REG(LDO7, ldo7, a03), TPS_REG(LDOLN, ldoln, a03), TPS_REG(LDOUSB, ldousb, a03), + TPS_REG(VANA, vana, a03), }; -struct tps80031_clk32k_init_data clk32k_idata[] = { +static struct tps80031_clk32k_init_data clk32k_idata[] = { { .clk32k_nr = TPS80031_CLOCK32K_G, .enable = true, @@ -410,6 +412,23 @@ struct tps80031_clk32k_init_data clk32k_idata[] = { .enable = true, .ext_ctrl_flag = 0, }, + + +}; + +static struct tps80031_gpio_init_data gpio_idata_a03[] = { + { + .gpio_nr = TPS80031_GPIO_REGEN1, + .ext_ctrl_flag = PWR_REQ_INPUT_PREQ1, + }, + { + .gpio_nr = TPS80031_GPIO_REGEN2, + .ext_ctrl_flag = PWR_REQ_INPUT_PREQ1, + }, + { + .gpio_nr = TPS80031_GPIO_SYSEN, + .ext_ctrl_flag = PWR_REQ_INPUT_PREQ1, + }, }; static struct tps80031_pupd_init_data pupd_idata[] = { @@ -463,7 +482,7 @@ static struct regulator_consumer_supply fixed_reg_vdd_fuse_en_supply[] = { static struct regulator_consumer_supply gpio_reg_sdmmc3_vdd_sel_supply[] = { REGULATOR_SUPPLY("vddio_sdmmc3_2v85_1v8", NULL), REGULATOR_SUPPLY("sdmmc3_compu_pu", NULL), - REGULATOR_SUPPLY("vddio_sdmmc3", NULL), + REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.2"), REGULATOR_SUPPLY("vsys_3v7", NULL), }; @@ -644,8 +663,12 @@ FIXED_REG(8, lcd_1v8_en, NULL, ADD_FIXED_REG(cam_ldo_1v8_en) static struct platform_device *fixed_regs_devices_a02[] = { - FIXED_REGS_COMMON, - ADD_FIXED_REG(pmu_3v3_en), + ADD_FIXED_REG(pmu_5v15_en), \ + ADD_FIXED_REG(pmu_3v3_en), \ + ADD_FIXED_REG(pmu_hdmi_5v0_en), \ + ADD_FIXED_REG(vdd_fuse_en), \ + ADD_FIXED_REG(cam_ldo_2v8_en), \ + ADD_FIXED_REG(cam_ldo_1v8_en) }; static struct platform_device *fixed_regs_devices_a03[] = { @@ -661,7 +684,6 @@ static struct platform_device *gpio_regs_devices[] = { static int __init enterprise_fixed_regulator_init(void) { - int i; struct board_info board_info; struct platform_device **fixed_regs_devices; int nfixreg_devs; @@ -676,27 +698,11 @@ static int __init enterprise_fixed_regulator_init(void) nfixreg_devs = ARRAY_SIZE(fixed_regs_devices_a03); } - for (i = 0; i < nfixreg_devs; ++i) { - struct fixed_voltage_config *fixed_reg_pdata = - fixed_regs_devices[i]->dev.platform_data; - if (fixed_reg_pdata->gpio < TEGRA_NR_GPIOS) - tegra_gpio_enable(fixed_reg_pdata->gpio); - } return platform_add_devices(fixed_regs_devices, nfixreg_devs); } static int __init enterprise_gpio_regulator_init(void) { - int i, j; - - for (i = 0; i < ARRAY_SIZE(gpio_regs_devices); ++i) { - struct gpio_regulator_config *gpio_reg_pdata = - gpio_regs_devices[i]->dev.platform_data; - for (j = 0; j < gpio_reg_pdata->nr_gpios; ++j) { - if (gpio_reg_pdata->gpios[j].gpio < TEGRA_NR_GPIOS) - tegra_gpio_enable(gpio_reg_pdata->gpios[j].gpio); - } - } return platform_add_devices(gpio_regs_devices, ARRAY_SIZE(gpio_regs_devices)); } @@ -742,6 +748,8 @@ int __init enterprise_regulator_init(void) battery_gauge_data.battery_present = 0; } + tegra_gpio_enable(TEGRA_GPIO_PF7); + if (board_info.fab < BOARD_FAB_A03) { tps_platform.num_subdevs = ARRAY_SIZE(tps80031_devs_a02); tps_platform.subdevs = tps80031_devs_a02; @@ -750,6 +758,8 @@ int __init enterprise_regulator_init(void) tps_platform.subdevs = tps80031_devs_a03; tps_platform.pupd_init_data = pupd_idata; tps_platform.pupd_init_data_size = ARRAY_SIZE(pupd_idata); + tps_platform.gpio_init_data = gpio_idata_a03; + tps_platform.gpio_init_data_size = ARRAY_SIZE(gpio_idata_a03); } i2c_register_board_info(4, enterprise_regulators, 1); @@ -835,8 +845,6 @@ void __init enterprise_bpc_mgmt_init(void) { int int_gpio = TEGRA_GPIO_TO_IRQ(TEGRA_BPC_TRIGGER); - tegra_gpio_enable(TEGRA_BPC_TRIGGER); - #ifdef CONFIG_SMP cpumask_setall(&(bpc_mgmt_platform_data.affinity_mask)); irq_set_affinity_hint(int_gpio, |