summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-01-21 00:33:14 -0800
committerColin Cross <ccross@android.com>2011-01-21 00:33:14 -0800
commit52cb8859b6d962c602d2beb0a935d4c3def8a447 (patch)
treed509a631221a047f0ca878a0e645dc82337c9c1d /drivers/usb/gadget
parente6e83971d48c98393a15b48b5a66a4c2f55753fe (diff)
parent66eaaf9564a90ee753f3f9866e3b517bfc7f1dbf (diff)
Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/fsl_tegra_udc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/gadget/fsl_tegra_udc.c b/drivers/usb/gadget/fsl_tegra_udc.c
index 6091d1f7ea0c..74c1d0b52541 100644
--- a/drivers/usb/gadget/fsl_tegra_udc.c
+++ b/drivers/usb/gadget/fsl_tegra_udc.c
@@ -15,6 +15,7 @@
static struct tegra_usb_phy *phy;
static struct clk *udc_clk;
+static struct clk *emc_clk;
static void *udc_base;
int fsl_udc_clk_init(struct platform_device *pdev)
@@ -33,6 +34,16 @@ int fsl_udc_clk_init(struct platform_device *pdev)
clk_enable(udc_clk);
+ emc_clk = clk_get(&pdev->dev, "emc");
+ if (IS_ERR(emc_clk)) {
+ dev_err(&pdev->dev, "Can't get emc clock\n");
+ err = PTR_ERR(emc_clk);
+ goto err_emc;
+ }
+
+ clk_enable(emc_clk);
+ clk_set_rate(emc_clk, 240000000);
+
/* we have to remap the registers ourselves as fsl_udc does not
* export them for us.
*/
@@ -65,6 +76,9 @@ int fsl_udc_clk_init(struct platform_device *pdev)
err1:
iounmap(udc_base);
err0:
+ clk_disable(emc_clk);
+ clk_put(emc_clk);
+err_emc:
clk_disable(udc_clk);
clk_put(udc_clk);
return err;
@@ -82,16 +96,21 @@ void fsl_udc_clk_release(void)
clk_disable(udc_clk);
clk_put(udc_clk);
+
+ clk_disable(emc_clk);
+ clk_put(emc_clk);
}
void fsl_udc_clk_suspend(void)
{
tegra_usb_phy_power_off(phy);
clk_disable(udc_clk);
+ clk_disable(emc_clk);
}
void fsl_udc_clk_resume(void)
{
+ clk_enable(emc_clk);
clk_enable(udc_clk);
tegra_usb_phy_power_on(phy);
}