Skip to content

Commit

Permalink
arm: tegra: sata: Fix LP0 resume problem
Browse files Browse the repository at this point in the history
- Fix a bug in ahci-tegra.c when checking if SATA is on when resuming
- Add codes to support PM315 which uses LDO1 regulator for SATA rails

bug 1206518

Change-Id: Iaa910b1948fbcf5e45491977fd8ed0b313d2e0ae
Signed-off-by: Yen Lin <yelin@nvidia.com>
Reviewed-on: http://git-master/r/188441
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Allen Martin <amartin@nvidia.com>
Reviewed-by: Peng Wu <pengw@nvidia.com>
Tested-by: Peng Wu <pengw@nvidia.com>
Reviewed-by: Eric Brower <ebrower@nvidia.com>
  • Loading branch information
yelin-nv authored and ebrower-nv committed Jan 4, 2013
1 parent 8bd060e commit c319d0e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions arch/arm/mach-tegra/board-cardhu-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ static struct regulator_consumer_supply tps6591x_ldo1_supply_0[] = {
REGULATOR_SUPPLY("vdd_pexa", NULL),
};

static struct regulator_consumer_supply tps6591x_ldo1_supply_pm315[] = {
REGULATOR_SUPPLY("avdd_pexb", NULL),
REGULATOR_SUPPLY("vdd_pexb", NULL),
REGULATOR_SUPPLY("avdd_pex_pll", NULL),
REGULATOR_SUPPLY("avdd_pexa", NULL),
REGULATOR_SUPPLY("vdd_pexa", NULL),
REGULATOR_SUPPLY("avdd_sata", NULL),
REGULATOR_SUPPLY("vdd_sata", NULL),
REGULATOR_SUPPLY("avdd_sata_pll", NULL),
REGULATOR_SUPPLY("avdd_plle", NULL),
};

static struct regulator_consumer_supply tps6591x_ldo2_supply_0[] = {
REGULATOR_SUPPLY("avdd_sata", NULL),
REGULATOR_SUPPLY("vdd_sata", NULL),
Expand Down Expand Up @@ -453,6 +465,14 @@ int __init cardhu_regulator_init(void)
pr_info("VSEL 1:0 %d%d\n",
tps62361_pdata.vsel1_def_state,
tps62361_pdata.vsel0_def_state);
} else if (board_info.board_id == BOARD_PM315) {
/* On PM315, SATA rails are on LDO1 */
pdata_ldo1_0.regulator.num_consumer_supplies =
ARRAY_SIZE(tps6591x_ldo1_supply_pm315);
pdata_ldo1_0.regulator.consumer_supplies =
tps6591x_ldo1_supply_pm315;
pdata_ldo2_0.regulator.num_consumer_supplies = 0;
pdata_ldo2_0.regulator.consumer_supplies = NULL;
}

if (((board_info.board_id == BOARD_E1291) ||
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/ahci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ static int tegra_ahci_controller_resume(struct platform_device *pdev)
}

spin_lock_irqsave(&host->lock, flags);
if (!tegra_hpriv->pg_state == SATA_ON) {
if (tegra_hpriv->pg_state == SATA_ON) {
dev_dbg(host->dev, "resume: SATA already powered on\n");
} else {
dev_dbg(host->dev, "resume: powering on SATA...\n");
Expand Down

0 comments on commit c319d0e

Please sign in to comment.