arm: tegra: usb_phy: enable pllu_regulator
Suresh Mangipudi [Fri, 31 Aug 2012 11:50:14 +0000 (16:50 +0530)]
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>

13 files changed:
arch/arm/mach-tegra/board-cardhu-pm298-power-rails.c
arch/arm/mach-tegra/board-cardhu-pm299-power-rails.c
arch/arm/mach-tegra/board-cardhu-power.c
arch/arm/mach-tegra/board-dalmore-power.c
arch/arm/mach-tegra/board-enterprise-power.c
arch/arm/mach-tegra/board-harmony-power.c
arch/arm/mach-tegra/board-kai-power.c
arch/arm/mach-tegra/board-pluto-power.c
arch/arm/mach-tegra/board-ventana-power.c
arch/arm/mach-tegra/board-whistler-power.c
arch/arm/mach-tegra/p852/board-p852-power.c
arch/arm/mach-tegra/tegra_usb_phy.h
arch/arm/mach-tegra/usb_phy.c

index 4797e47..9430fc0 100644 (file)
@@ -56,7 +56,10 @@ static struct regulator_consumer_supply max77663_sd1_supply[] = {
 
 static struct regulator_consumer_supply max77663_sd2_supply[] = {
        REGULATOR_SUPPLY("avdd_hdmi_pll", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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("vdd1v8_satelite", NULL),
        REGULATOR_SUPPLY("vddio_uart", NULL),
index 71574f8..3fe3b55 100644 (file)
@@ -70,7 +70,10 @@ static struct regulator_consumer_supply ricoh583_dc0_supply_0[] = {
 static struct regulator_consumer_supply ricoh583_dc2_supply_0[] = {
        REGULATOR_SUPPLY("vdd_gen1v8", NULL),
        REGULATOR_SUPPLY("avdd_hdmi_pll", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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_sdmmc", "sdhci-tegra.3"),
index 4394e2c..b98355e 100644 (file)
@@ -77,7 +77,10 @@ static struct regulator_consumer_supply tps6591x_vddctrl_supply_0[] = {
 static struct regulator_consumer_supply tps6591x_vio_supply_0[] = {
        REGULATOR_SUPPLY("vdd_gen1v8", NULL),
        REGULATOR_SUPPLY("avdd_hdmi_pll", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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_sdmmc", "sdhci-tegra.3"),
index 4494145..8ff3b50 100644 (file)
@@ -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),
index 9457791..e049b52 100644 (file)
@@ -67,7 +67,10 @@ static struct regulator_consumer_supply tps80031_vio_supply_a02[] = {
        REGULATOR_SUPPLY("vddio_bb", NULL),
        REGULATOR_SUPPLY("pwrdet_bb", NULL),
        REGULATOR_SUPPLY("vddio_gmi", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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", NULL),
        REGULATOR_SUPPLY("pwrdet_cam", NULL),
        REGULATOR_SUPPLY("vddio_sdmmc1", NULL),
@@ -197,7 +200,10 @@ static struct regulator_consumer_supply tps80031_ldo6_supply_a02[] = {
 
 static struct regulator_consumer_supply tps80031_ldo6_supply_a03[] = {
        REGULATOR_SUPPLY("avdd_osc", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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"),
 };
 
 static struct regulator_consumer_supply tps80031_ldo7_supply_a02[] = {
index a0cfb46..89d66b9 100644 (file)
@@ -57,7 +57,10 @@ static struct regulator_consumer_supply tps658621_ldo2_supply[] = {
 
 static struct regulator_consumer_supply tps658621_ldo3_supply[] = {
        REGULATOR_SUPPLY("avdd_usb", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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_lvds", NULL),
 };
 
index 7d02545..faa4085 100644 (file)
@@ -57,7 +57,10 @@ static struct regulator_consumer_supply max77663_sd1_supply[] = {
 static struct regulator_consumer_supply max77663_sd2_supply[] = {
        REGULATOR_SUPPLY("vdd_gen1v8", NULL),
        REGULATOR_SUPPLY("avdd_hdmi_pll", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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_sdmmc", "sdhci-tegra.3"),
index dbd3fe7..00c9f01 100644 (file)
@@ -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),
index 875a4db..f96caac 100644 (file)
@@ -75,7 +75,10 @@ static struct regulator_consumer_supply tps658621_ldo2_supply[] = {
 static struct regulator_consumer_supply tps658621_ldo3_supply[] = {
        REGULATOR_SUPPLY("vdd_ldo3", NULL),
        REGULATOR_SUPPLY("avdd_usb", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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"),
 };
 static struct regulator_consumer_supply tps658621_ldo4_supply[] = {
        REGULATOR_SUPPLY("vdd_ldo4", NULL),
index 6766325..62b81f8 100644 (file)
@@ -63,7 +63,10 @@ static struct regulator_consumer_supply max8907c_LDO3_supply[] = {
 
 static struct regulator_consumer_supply max8907c_LDO4_supply[] = {
        REGULATOR_SUPPLY("avdd_usb", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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"),
 };
 
 static struct regulator_consumer_supply max8907c_LDO5_supply[] = {
index 949537e..4c95050 100644 (file)
@@ -53,7 +53,10 @@ static struct regulator_consumer_supply tps658621_ldo2_supply[] = {
 };
 static struct regulator_consumer_supply tps658621_ldo3_supply[] = {
        REGULATOR_SUPPLY("avdd_usb", NULL),
-       REGULATOR_SUPPLY("avdd_usb_pll", NULL),
+       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_lvds", NULL),
 };
 static struct regulator_consumer_supply tps658621_ldo4_supply[] = {
index aacba98..1b62804 100644 (file)
@@ -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;
index 1fd3d17..dbb03ca 100644 (file)
@@ -177,6 +177,16 @@ 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));
+               err = PTR_ERR(phy->vdd_reg);
+               phy->pllu_reg = NULL;
+               goto fail_pllu_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);
@@ -230,6 +240,10 @@ fail_ctrlr_clk:
        clk_put(phy->pllu_clk);
 
 fail_pll:
+       regulator_disable(phy->pllu_reg);
+       regulator_put(phy->pllu_reg);
+
+fail_pllu_reg:
        return err;
 }
 
@@ -430,6 +444,11 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy)
 
        tegra_usb_phy_release_clocks(phy);
 
+       if (phy->pllu_reg) {
+               regulator_disable(phy->pllu_reg);
+               regulator_put(phy->pllu_reg);
+       }
+
        devm_kfree(&phy->pdev->dev, phy->pdata);
        devm_kfree(&phy->pdev->dev, phy);
 }