From b3328e4c67b44588b4cecfde3a05b593153f91ef Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Tue, 18 Jan 2011 12:56:16 -0800 Subject: usb: host: tegra: Fix resuming low speed devices from lp0 Change-Id: I9576853bbe0fae52c5c2cfab26ce8f2017077d4e Signed-off-by: Benoit Goby --- drivers/usb/host/ehci-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/usb/host/ehci-tegra.c') diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 2341904808bc..db61c60ffbab 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -265,7 +265,7 @@ static int tegra_usb_resume(struct usb_hcd *hcd) goto restart; } - tegra_ehci_phy_restore_start(tegra->phy); + tegra_ehci_phy_restore_start(tegra->phy, context->port_speed); /* Check if the phy resume from LP0. When the phy resume from LP0 * USB register will be reset. */ @@ -341,10 +341,13 @@ static int tegra_usb_resume(struct usb_hcd *hcd) } tegra_ehci_phy_restore_end(tegra->phy); + return 0; restart: - tegra_ehci_phy_restore_end(tegra->phy); + if (context->valid) + tegra_ehci_phy_restore_end(tegra->phy); + tegra_ehci_restart(hcd); return 0; } -- cgit v1.2.3 From ba487c7c5e987d6ee9487041bd09a8686f32f730 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Tue, 18 Jan 2011 19:38:23 -0800 Subject: usb: host: tegra: Fix SetPortFeature PORT_SUSPEND This fixes a regression where hubs cannot detect new devices once they have been auto-suspended. Change-Id: I4b3efcaa9634b9a912060e438527000bbc83dc32 Signed-off-by: Benoit Goby --- drivers/usb/host/ehci-tegra.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/host/ehci-tegra.c') diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index db61c60ffbab..f781b02e53f0 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -129,6 +129,7 @@ static int tegra_ehci_hub_control( if (handshake(ehci, status_reg, PORT_SUSPEND, PORT_SUSPEND, 5000)) pr_err("%s: timeout waiting for PORT_SUSPEND\n", __func__); + set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports); goto done; } -- cgit v1.2.3 From 1b02fb1f5c0ad32326d9a8e513f297c2674dfe92 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Thu, 20 Jan 2011 14:19:04 -0800 Subject: usb: host: tegra: Enable emc clock while usb is resumed Change-Id: I03a102f40134686fabbd5cfa1830816a691cf876 Signed-off-by: Benoit Goby --- drivers/usb/host/ehci-tegra.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'drivers/usb/host/ehci-tegra.c') diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index f781b02e53f0..bd6fb0144c26 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -46,6 +46,7 @@ struct tegra_ehci_hcd { struct ehci_hcd *ehci; struct tegra_usb_phy *phy; struct clk *clk; + struct clk *emc_clk; struct otg_transceiver *transceiver; int host_resumed; int bus_suspended; @@ -58,6 +59,7 @@ static void tegra_ehci_power_up(struct usb_hcd *hcd) { struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); + clk_enable(tegra->emc_clk); clk_enable(tegra->clk); tegra_usb_phy_power_on(tegra->phy); tegra->host_resumed = 1; @@ -70,6 +72,7 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd) tegra->host_resumed = 0; tegra_usb_phy_power_off(tegra->phy); clk_disable(tegra->clk); + clk_disable(tegra->emc_clk); } static int tegra_ehci_hub_control( @@ -537,6 +540,16 @@ static int tegra_ehci_probe(struct platform_device *pdev) if (err) goto fail_clken; + tegra->emc_clk = clk_get(&pdev->dev, "emc"); + if (IS_ERR(tegra->emc_clk)) { + dev_err(&pdev->dev, "Can't get emc clock\n"); + err = PTR_ERR(tegra->emc_clk); + goto fail_emc_clk; + } + + clk_enable(tegra->emc_clk); + clk_set_rate(tegra->emc_clk, 240000000); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "Failed to get I/O memory\n"); @@ -611,6 +624,9 @@ fail: fail_phy: iounmap(hcd->regs); fail_io: + clk_disable(tegra->emc_clk); + clk_put(tegra->emc_clk); +fail_emc_clk: clk_disable(tegra->clk); fail_clken: clk_put(tegra->clk); @@ -672,6 +688,9 @@ static int tegra_ehci_remove(struct platform_device *pdev) clk_disable(tegra->clk); clk_put(tegra->clk); + clk_disable(tegra->emc_clk); + clk_put(tegra->emc_clk); + kfree(tegra); return 0; } -- cgit v1.2.3