arm: tegra: board: remove board specific vbus initializers
Suresh Mangipudi [Tue, 4 Sep 2012 11:33:24 +0000 (16:33 +0530)]
Removed the board dependency for the vbus regulators and the vbus gpio in
tegra platforms. Vbus need not be specified from the board files any more.

Change-Id: I0dbab40f8737138bd469600810a7a17407329149
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/130648
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

19 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-cardhu.c
arch/arm/mach-tegra/board-curacao.c
arch/arm/mach-tegra/board-dalmore.c
arch/arm/mach-tegra/board-e1853.c
arch/arm/mach-tegra/board-enterprise-baseband.c
arch/arm/mach-tegra/board-enterprise.c
arch/arm/mach-tegra/board-harmony.c
arch/arm/mach-tegra/board-kai.c
arch/arm/mach-tegra/board-p1852.c
arch/arm/mach-tegra/board-pluto.c
arch/arm/mach-tegra/board-ventana.c
arch/arm/mach-tegra/board-whistler-baseband.c
arch/arm/mach-tegra/board-whistler.c
arch/arm/mach-tegra/p852/board-p852.c
arch/arm/mach-tegra/usb_phy.c
include/linux/platform_data/tegra_usb.h

index 3049a38..4797e47 100644 (file)
@@ -503,12 +503,12 @@ static struct regulator_consumer_supply fixed_reg_en_vbrtr_supply[] = {
 
 /* EN_USB1_VBUS_OC*/
 static struct regulator_consumer_supply fixed_reg_en_usb1_vbus_oc_supply[] = {
-       REGULATOR_SUPPLY("vdd_vbus_micro_usb", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
 };
 
 /*EN_USB3_VBUS_OC*/
 static struct regulator_consumer_supply fixed_reg_en_usb3_vbus_oc_supply[] = {
-       REGULATOR_SUPPLY("vdd_vbus_typea_usb", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.2"),
 };
 
 /* EN_VDDIO_VID_OC from AP GPIO VI_PCLK T00*/
index d2805c4..71574f8 100644 (file)
@@ -505,12 +505,12 @@ static struct regulator_consumer_supply fixed_reg_en_vbrtr_supply[] = {
 
 /* EN_USB1_VBUS_OC*/
 static struct regulator_consumer_supply fixed_reg_en_usb1_vbus_oc_supply[] = {
-       REGULATOR_SUPPLY("vdd_vbus_micro_usb", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
 };
 
 /*EN_USB3_VBUS_OC*/
 static struct regulator_consumer_supply fixed_reg_en_usb3_vbus_oc_supply[] = {
-       REGULATOR_SUPPLY("vdd_vbus_typea_usb", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.2"),
 };
 
 /* EN_VDDIO_VID_OC from AP GPIO VI_PCLK T00*/
index 4f4a2d2..4394e2c 100644 (file)
@@ -666,12 +666,12 @@ static struct regulator_consumer_supply fixed_reg_en_vbrtr_supply[] = {
 
 /* EN_USB1_VBUS_OC*/
 static struct regulator_consumer_supply fixed_reg_en_usb1_vbus_oc_supply[] = {
-       REGULATOR_SUPPLY("vdd_vbus_micro_usb", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
 };
 
 /*EN_USB3_VBUS_OC*/
 static struct regulator_consumer_supply fixed_reg_en_usb3_vbus_oc_supply[] = {
-       REGULATOR_SUPPLY("vdd_vbus_typea_usb", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.2"),
 };
 
 /* EN_VDDIO_VID_OC from AP GPIO VI_PCLK T00*/
index 011bee3..a0f7596 100644 (file)
@@ -1230,7 +1230,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "vdd_vbus_typea_usb",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -1255,7 +1254,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "vdd_vbus_micro_usb",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index e8bcedc..ff16598 100644 (file)
@@ -439,7 +439,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "vdd_vbus_micro_usb",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -480,7 +479,6 @@ static struct tegra_usb_platform_data tegra_ehci2_ulpi_link_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
index 18d32b8..a996dbe 100644 (file)
@@ -422,7 +422,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "usb_vbus_otg",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -447,7 +446,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "vdd_vbus_typea_usb",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index 3b6d2bf..0cd0314 100644 (file)
@@ -272,7 +272,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -298,7 +297,6 @@ static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -324,7 +322,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index ebb073a..c4bd87b 100644 (file)
@@ -65,7 +65,6 @@ static struct tegra_usb_platform_data tegra_ehci2_ulpi_null_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
index 5102c3a..b939586 100644 (file)
@@ -844,7 +844,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "usb_vbus",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index 02448a0..33484be 100644 (file)
@@ -120,7 +120,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = TEGRA_GPIO_PD3,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
index 90cc27c..73cf60e 100644 (file)
@@ -330,7 +330,7 @@ static struct regulator_consumer_supply smb349_vbus_supply[] = {
 };
 
 static struct regulator_consumer_supply smb349_otg_vbus_supply[] = {
-       REGULATOR_SUPPLY("usb_vbus_otg", NULL),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
 };
 
 static struct smb349_charger_platform_data smb349_charger_pdata = {
@@ -778,7 +778,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "usb_vbus_otg",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -804,7 +803,6 @@ static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index c155235..a84ff30 100644 (file)
@@ -508,7 +508,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -535,7 +534,6 @@ static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
@@ -561,7 +559,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index 758dd12..12f2eb0 100644 (file)
@@ -406,7 +406,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = "usb_vbus_otg",
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = true,
index 0d51570..9e3e518 100644 (file)
@@ -505,7 +505,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = TEGRA_GPIO_PD0,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
@@ -542,7 +541,6 @@ static struct tegra_usb_platform_data tegra_ehci2_ulpi_link_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
@@ -565,7 +563,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = TEGRA_GPIO_PD3,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
index bc7b630..75a1993 100644 (file)
@@ -58,7 +58,6 @@ static struct tegra_usb_platform_data tegra_ehci2_ulpi_null_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
index 80ffeef..ae2375f 100644 (file)
@@ -479,7 +479,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = TEGRA_GPIO_PN6,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = true,
index b44da14..98885ee 100644 (file)
@@ -511,7 +511,6 @@ static struct tegra_usb_platform_data tegra_ehci_ulpi_link_pdata = {
        .op_mode        = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = false,
                .remote_wakeup_supported = false,
                .power_off_on_suspend = false,
@@ -534,7 +533,6 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = false,
@@ -557,7 +555,6 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
        .op_mode = TEGRA_USB_OPMODE_HOST,
        .u_data.host = {
                .vbus_gpio = -1,
-               .vbus_reg = NULL,
                .hot_plug = true,
                .remote_wakeup_supported = true,
                .power_off_on_suspend = false,
index e1e2c69..1fd3d17 100644 (file)
@@ -84,8 +84,6 @@ static void print_usb_plat_data_info(struct tegra_usb_phy *phy)
                                ? "enabled" : "disabled");
        } else {
                pr_info("vbus_gpio: %d\n", pdata->u_data.host.vbus_gpio);
-               pr_info("vbus_reg: %s\n", pdata->u_data.host.vbus_reg ?
-                               pdata->u_data.host.vbus_reg : "NULL");
                pr_info("hot_plug: %s\n", pdata->u_data.host.hot_plug ?
                                "enabled" : "disabled");
                pr_info("remote_wakeup: %s\n", pdata->u_data.host.remote_wakeup_supported
@@ -316,15 +314,14 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct platform_device *pdev)
                        clk_enable(phy->ctrlr_clk);
                }
        } else {
-               if (phy->pdata->u_data.host.vbus_reg) {
-                       phy->vbus_reg = regulator_get(NULL,
-                                       phy->pdata->u_data.host.vbus_reg);
+               if ((phy->pdata->has_hostpc) &&
+                       (phy->pdata->phy_intf == TEGRA_USB_PHY_INTF_UTMI)) {
+                       phy->vbus_reg = regulator_get(&pdev->dev, "usb_vbus");
                        if (WARN_ON(IS_ERR_OR_NULL(phy->vbus_reg))) {
-                               ERR("failed to get regulator vdd_vbus_usb: %ld,\
-                                instance : %d\n", PTR_ERR(phy->vbus_reg),
-                                                               phy->inst);
-                               err = PTR_ERR(phy->vbus_reg);
-                               goto fail_init;
+                               ERR("failed to get regulator vdd_vbus_usb:" \
+                               "%ld,instance : %d\n", PTR_ERR(phy->vbus_reg),
+                               phy->inst);
+                               phy->vbus_reg = NULL;
                        }
                } else {
                        int gpio = phy->pdata->u_data.host.vbus_gpio;
index 597c2f3..a37ceae 100644 (file)
@@ -98,7 +98,6 @@ struct tegra_usb_dev_mode_data {
  */
 struct tegra_usb_host_mode_data {
        int vbus_gpio;
-       const char *vbus_reg;
        bool hot_plug;
        bool remote_wakeup_supported;
        bool power_off_on_suspend;