diff options
author | Benoit Goby <benoit@android.com> | 2011-01-18 16:57:48 -0800 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-01-27 23:39:31 -0800 |
commit | 5f43374fd57369c60cbb5a018ace67673894f590 (patch) | |
tree | 84661dd05e63a27f8a2324da826896ddd4fc6698 | |
parent | d376f33ad7faf7a2a468adfb3f49caffd5b96d36 (diff) |
ARM: tegra: usb_phy: Program DPDM_OBSERVE depending on the device speed
Low speed devices require a K-state resume signaling instead of J.
Change-Id: Ic06011f45c2b0f4cd969d018f2783acea57cb510
Signed-off-by: Benoit Goby <benoit@android.com>
Reviewed-on: http://git-master/r/16708
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/include/mach/usb_phy.h | 11 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 15 |
2 files changed, 12 insertions, 14 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h index 4caa610b619a..8cb7eb457ff3 100644 --- a/arch/arm/mach-tegra/include/mach/usb_phy.h +++ b/arch/arm/mach-tegra/include/mach/usb_phy.h @@ -59,13 +59,6 @@ enum tegra_usb_phy_port_speed { TEGRA_USB_PHY_PORT_HIGH, }; -struct tegra_utmip_context { - bool valid; - u32 regs[USB_PHY_MAX_CONTEXT_REGS]; - int regs_count; - enum tegra_usb_phy_port_speed port_speed; -}; - enum tegra_usb_phy_mode { TEGRA_USB_PHY_MODE_DEVICE, TEGRA_USB_PHY_MODE_HOST, @@ -81,7 +74,6 @@ struct tegra_usb_phy { struct clk *pad_clk; enum tegra_usb_phy_mode mode; void *config; - struct tegra_utmip_context context; }; struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs, @@ -99,7 +91,8 @@ int tegra_usb_phy_preresume(struct tegra_usb_phy *phy); int tegra_usb_phy_postresume(struct tegra_usb_phy *phy); -int tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy); +int tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, + enum tegra_usb_phy_port_speed port_speed); int tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy); diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index cb87ad6934e2..9030545d4bdc 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -547,13 +547,18 @@ static void utmi_phy_postresume(struct tegra_usb_phy *phy) writel(val, base + UTMIP_TX_CFG0); } -static void utmi_phy_restore_start(struct tegra_usb_phy *phy) +static void utmi_phy_restore_start(struct tegra_usb_phy *phy, + enum tegra_usb_phy_port_speed port_speed) { unsigned long val; void __iomem *base = phy->regs; val = readl(base + UTMIP_MISC_CFG0); - val |= UTMIP_DPDM_OBSERVE_SEL_FS_J; + val &= ~UTMIP_DPDM_OBSERVE_SEL(~0); + if (port_speed == TEGRA_USB_PHY_PORT_SPEED_LOW) + val |= UTMIP_DPDM_OBSERVE_SEL_FS_K; + else + val |= UTMIP_DPDM_OBSERVE_SEL_FS_J; writel(val, base + UTMIP_MISC_CFG0); udelay(1); @@ -787,7 +792,6 @@ struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs, phy->instance = instance; phy->regs = regs; phy->config = config; - phy->context.valid = false; phy->mode = phy_mode; if (!phy->config) { @@ -894,10 +898,11 @@ int tegra_usb_phy_postresume(struct tegra_usb_phy *phy) return 0; } -int tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy) +int tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, + enum tegra_usb_phy_port_speed port_speed) { if (phy->instance != 1) - utmi_phy_restore_start(phy); + utmi_phy_restore_start(phy, port_speed); return 0; } |