diff options
author | Suresh Mangipudi <smangipudi@nvidia.com> | 2012-08-31 17:20:14 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:34:02 -0700 |
commit | 20e0879beb44a3f2fc9b46f842d6e78abb48e1ad (patch) | |
tree | 4cf8c4a3fd8fe638782830d435da339727f20a3f | |
parent | 20c8de1be729d9e5b5974b2f356ab1ef92392124 (diff) |
arm: tegra: usb_phy: enable pllu_regulator
Change to enable the pllu regulator.
Change-Id: I6f8beb00c71e55b017c10576bf0aa990e09b362d
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/130990
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Rebase-Id: Rdc45b9788887c16eeb927350f87b6be579ab7424
-rw-r--r-- | arch/arm/mach-tegra/board-dalmore-power.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-pluto-power.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra_usb_phy.h | 1 | ||||
-rw-r--r-- | drivers/usb/phy/phy-tegra-usb.c | 21 |
4 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-dalmore-power.c b/arch/arm/mach-tegra/board-dalmore-power.c index 449414502c5b..8ff3b5061c1b 100644 --- a/arch/arm/mach-tegra/board-dalmore-power.c +++ b/arch/arm/mach-tegra/board-dalmore-power.c @@ -178,8 +178,10 @@ static struct regulator_consumer_supply max77663_sd1_supply[] = { }; static struct regulator_consumer_supply max77663_sd2_supply[] = { + REGULATOR_SUPPLY("avdd_usb_pll", "tegra-udc.0"), REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.0"), REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.1"), + REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.2"), REGULATOR_SUPPLY("vddio_cam", "tegrra_camera"), REGULATOR_SUPPLY("avdd_osc", NULL), REGULATOR_SUPPLY("vddio_sys", NULL), diff --git a/arch/arm/mach-tegra/board-pluto-power.c b/arch/arm/mach-tegra/board-pluto-power.c index dbd3fe76f653..00c9f01fd17a 100644 --- a/arch/arm/mach-tegra/board-pluto-power.c +++ b/arch/arm/mach-tegra/board-pluto-power.c @@ -59,8 +59,10 @@ static struct regulator_consumer_supply palmas_smps7_supply[] = { }; static struct regulator_consumer_supply palmas_smps8_supply[] = { + REGULATOR_SUPPLY("avdd_usb_pll", "tegra-udc.0"), REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.0"), REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.1"), + REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.2"), REGULATOR_SUPPLY("avdd_osc", NULL), REGULATOR_SUPPLY("vddio_sys", NULL), REGULATOR_SUPPLY("vddio_bb", NULL), diff --git a/arch/arm/mach-tegra/tegra_usb_phy.h b/arch/arm/mach-tegra/tegra_usb_phy.h index aacba98c3f7b..1b62804fd567 100644 --- a/arch/arm/mach-tegra/tegra_usb_phy.h +++ b/arch/arm/mach-tegra/tegra_usb_phy.h @@ -82,6 +82,7 @@ struct tegra_usb_phy { struct regulator *vdd_reg; struct regulator *hsic_reg; struct regulator *vbus_reg; + struct regulator *pllu_reg; struct tegra_usb_phy_ops *ops; struct tegra_xtal_freq *freq; struct usb_phy *ulpi_vp; diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index 6ddfacbebdab..1aea424cbbab 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -182,10 +182,20 @@ static int tegra_usb_phy_get_clocks(struct tegra_usb_phy *phy) { int err = 0; + phy->pllu_reg = regulator_get(&phy->pdev->dev, "avdd_usb_pll"); + if (IS_ERR_OR_NULL(phy->vdd_reg)) { + ERR("Couldn't get regulator avdd_usb_pll: %ld\n", + PTR_ERR(phy->vdd_reg)); + phy->pllu_reg = NULL; + return PTR_ERR(phy->vdd_reg); + } + regulator_enable(phy->pllu_reg); + phy->pllu_clk = clk_get_sys(NULL, "pll_u"); if (IS_ERR(phy->pllu_clk)) { ERR("inst:[%d] Can't get pllu_clk clock\n", phy->inst); - return PTR_ERR(phy->pllu_clk); + err = PTR_ERR(phy->pllu_clk); + goto fail_pll; } clk_prepare_enable(phy->pllu_clk); @@ -233,6 +243,10 @@ fail_ctrlr_clk: clk_disable_unprepare(phy->pllu_clk); clk_put(phy->pllu_clk); +fail_pll: + regulator_disable(phy->pllu_reg); + regulator_put(phy->pllu_reg); + return err; } @@ -275,6 +289,11 @@ void tegra_usb_phy_close(struct usb_phy *x) tegra_usb_phy_release_clocks(phy); + + if (phy->pllu_reg) { + regulator_disable(phy->pllu_reg); + regulator_put(phy->pllu_reg); + } } irqreturn_t tegra_usb_phy_irq(struct tegra_usb_phy *phy) |