summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Yi <kyi@nvidia.com>2012-01-11 21:11:07 +0900
committerVarun Colbert <vcolbert@nvidia.com>2012-01-19 16:25:39 -0800
commitbdd9e97c84f69bab23f5542dc6ac2efa93e53224 (patch)
treef59beafbd80de5e72a5d273a0113eed2d0aafa0b
parent4b9dfedec9ab23b03949407856c03635f31cfa49 (diff)
usb: host: tegra: replace CONFIG_USB_HOTPLUG to tegra_ehci_platform_data
remove CONFIG_USB_HOTPLUG and add default_enable into tegra_ehci_platform_data We can't use different def_config because whistler & ventana source code is merged in same tree. BUG 923705 Change-Id: I3dfdf237d80865831264f02104c89c8088101905 Reviewed-on: http://git-master/r/74574 Signed-off-by: Kurt Yi <kyi@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75888 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c4
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c4
-rw-r--r--arch/arm/mach-tegra/board-ventana.c4
-rw-r--r--arch/arm/mach-tegra/board-whistler.c3
-rw-r--r--drivers/usb/host/ehci-tegra.c32
-rw-r--r--drivers/usb/otg/tegra-otg.c9
-rw-r--r--include/linux/platform_data/tegra_usb.h1
7 files changed, 36 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index 18ed959ef96a..da63ca698f71 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -708,6 +708,7 @@ static struct tegra_ehci_platform_data tegra_ehci_uhsic_pdata = {
.phy_config = &uhsic_phy_config,
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = true,
};
static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
@@ -715,17 +716,20 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
.phy_config = &utmi_phy_config[0],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = true,
},
[1] = {
.phy_config = &utmi_phy_config[1],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = true,
},
[2] = {
.phy_config = &utmi_phy_config[2],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
.hotplug = 1,
+ .default_enable = true,
},
};
diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c
index 8d95af3112f8..f631c9b93cb2 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -653,6 +653,7 @@ static struct tegra_ehci_platform_data tegra_ehci_uhsic_pdata = {
.phy_config = &uhsic_phy_config,
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = true,
};
static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
@@ -660,16 +661,19 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
.phy_config = &utmi_phy_config[0],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = false,
},
[1] = {
.phy_config = &utmi_phy_config[1],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = false,
},
[2] = {
.phy_config = &utmi_phy_config[2],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = false,
},
};
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 23f946f643c6..097644021ebc 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -174,6 +174,7 @@ static struct tegra_ehci_platform_data ventana_ehci2_ulpi_platform_data = {
.power_down_on_bus_suspend = 1,
.phy_config = &ventana_ehci2_ulpi_phy_config,
.phy_type = TEGRA_USB_PHY_TYPE_LINK_ULPI,
+ .default_enable = true,
};
static struct tegra_i2c_platform_data ventana_i2c1_platform_data = {
@@ -518,18 +519,21 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
.phy_config = &utmi_phy_config[0],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = true,
},
[1] = {
.phy_config = &ulpi_phy_config,
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
.phy_type = TEGRA_USB_PHY_TYPE_LINK_ULPI,
+ .default_enable = true,
},
[2] = {
.phy_config = &utmi_phy_config[1],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
.hotplug = 1,
+ .default_enable = true,
},
};
diff --git a/arch/arm/mach-tegra/board-whistler.c b/arch/arm/mach-tegra/board-whistler.c
index 1f9c3b6f7c92..031ab936d870 100644
--- a/arch/arm/mach-tegra/board-whistler.c
+++ b/arch/arm/mach-tegra/board-whistler.c
@@ -511,16 +511,19 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
.phy_config = &utmi_phy_config[0],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = false,
},
[1] = {
.phy_config = &ulpi_phy_config,
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = false,
},
[2] = {
.phy_config = &utmi_phy_config[1],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .default_enable = false,
},
};
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 308fb315e4b0..917796c20d8a 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -64,6 +64,7 @@ struct tegra_ehci_hcd {
int bus_suspended;
int port_resuming;
int power_down_on_bus_suspend;
+ int default_enable;
struct delayed_work work;
enum tegra_usb_phy_port_speed port_speed;
struct work_struct clk_timer_work;
@@ -79,9 +80,8 @@ static void tegra_ehci_power_up(struct usb_hcd *hcd, bool is_dpd)
{
struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
-#ifndef CONFIG_USB_HOTPLUG
- clk_enable(tegra->clk);
-#endif
+ if (!tegra->default_enable)
+ clk_enable(tegra->clk);
tegra_usb_phy_power_on(tegra->phy, is_dpd);
tegra->host_resumed = 1;
}
@@ -92,9 +92,8 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd, bool is_dpd)
tegra->host_resumed = 0;
tegra_usb_phy_power_off(tegra->phy, is_dpd);
-#ifndef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (!tegra->default_enable)
+ clk_disable(tegra->clk);
}
static int tegra_ehci_internal_port_reset(
@@ -1023,6 +1022,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, tegra);
+ tegra->default_enable = pdata->default_enable;
tegra->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(tegra->clk)) {
@@ -1169,15 +1169,13 @@ static int tegra_ehci_resume(struct platform_device *pdev)
struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
if ((tegra->bus_suspended) && (tegra->power_down_on_bus_suspend)) {
-#ifdef CONFIG_USB_HOTPLUG
- clk_enable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_enable(tegra->clk);
return 0;
}
-#ifdef CONFIG_USB_HOTPLUG
- clk_enable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_enable(tegra->clk);
return tegra_usb_resume(hcd, true);
}
@@ -1196,9 +1194,8 @@ static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
}
if ((tegra->bus_suspended) && (tegra->power_down_on_bus_suspend)) {
-#ifdef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_disable(tegra->clk);
return 0;
}
@@ -1206,9 +1203,8 @@ static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
msleep(10);
ret = tegra_usb_suspend(hcd, true);
-#ifdef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_disable(tegra->clk);
return ret;
}
#endif
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c
index a063630e529d..d23356e9c1a7 100644
--- a/drivers/usb/otg/tegra-otg.c
+++ b/drivers/usb/otg/tegra-otg.c
@@ -324,6 +324,8 @@ static int tegra_otg_set_suspend(struct otg_transceiver *otg, int suspend)
static int tegra_otg_probe(struct platform_device *pdev)
{
struct tegra_otg_data *tegra;
+ struct tegra_otg_platform_data *otg_pdata;
+ struct tegra_ehci_platform_data *ehci_pdata;
struct resource *res;
int err;
@@ -332,6 +334,8 @@ static int tegra_otg_probe(struct platform_device *pdev)
return -ENOMEM;
tegra->otg.dev = &pdev->dev;
+ otg_pdata = tegra->otg.dev->platform_data;
+ ehci_pdata = otg_pdata->ehci_pdata;
tegra->otg.label = "tegra-otg";
tegra->otg.state = OTG_STATE_UNDEFINED;
tegra->otg.set_host = tegra_otg_set_host;
@@ -391,9 +395,8 @@ static int tegra_otg_probe(struct platform_device *pdev)
}
INIT_WORK (&tegra->work, irq_work);
-#ifndef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (!ehci_pdata->default_enable)
+ clk_disable(tegra->clk);
dev_info(&pdev->dev, "otg transceiver registered\n");
return 0;
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
index 09f32de5c671..e6377c379b48 100644
--- a/include/linux/platform_data/tegra_usb.h
+++ b/include/linux/platform_data/tegra_usb.h
@@ -35,6 +35,7 @@ struct tegra_ehci_platform_data {
/* power down the phy on bus suspend */
int power_down_on_bus_suspend;
int hotplug;
+ int default_enable;
void *phy_config;
enum tegra_usb_phy_type phy_type;
};