summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxs/usb_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxs/usb_common.c')
-rw-r--r--arch/arm/plat-mxs/usb_common.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/arm/plat-mxs/usb_common.c b/arch/arm/plat-mxs/usb_common.c
index 5d8d0b6d9285..23134489472e 100644
--- a/arch/arm/plat-mxs/usb_common.c
+++ b/arch/arm/plat-mxs/usb_common.c
@@ -264,13 +264,16 @@ int usbotg_init(struct platform_device *pdev)
pdata->xcvr_type = xops->xcvr_type;
pdata->pdev = pdev;
- otg_used = 0;
if (!otg_used) {
pr_debug("%s: grab pins\n", __func__);
if (xops->init)
xops->init(xops);
usb_phy_enable(pdata);
}
+ /* Enable internal Phy clock */
+ tmp = __raw_readl(pdata->regs + UOG_PORTSC1);
+ tmp &= ~PORTSC_PHCD;
+ __raw_writel(tmp, pdata->regs + UOG_PORTSC1);
if (pdata->operating_mode == FSL_USB2_DR_HOST) {
/* enable FS/LS device */
@@ -288,11 +291,22 @@ EXPORT_SYMBOL(usbotg_init);
void usbotg_uninit(struct fsl_usb2_platform_data *pdata)
{
+ int tmp;
+ struct clk *usb_clk;
pr_debug("%s\n", __func__);
if (pdata->xcvr_ops && pdata->xcvr_ops->uninit)
pdata->xcvr_ops->uninit(pdata->xcvr_ops);
+ /* Disable internal Phy clock */
+ tmp = __raw_readl(pdata->regs + UOG_PORTSC1);
+ tmp |= PORTSC_PHCD;
+ __raw_writel(tmp, pdata->regs + UOG_PORTSC1);
+
+ usb_clk = clk_get(NULL, "usb_clk0");
+ clk_disable(usb_clk);
+ clk_put(usb_clk);
+
pdata->regs = NULL;
otg_used--;
}
@@ -331,11 +345,16 @@ EXPORT_SYMBOL(fsl_usb_host_init);
void fsl_usb_host_uninit(struct fsl_usb2_platform_data *pdata)
{
+ struct clk *usb_clk;
pr_debug("%s\n", __func__);
if (pdata->xcvr_ops && pdata->xcvr_ops->uninit)
pdata->xcvr_ops->uninit(pdata->xcvr_ops);
+ usb_clk = clk_get(NULL, "usb_clk1");
+ clk_disable(usb_clk);
+ clk_put(usb_clk);
+
pdata->regs = NULL;
}
EXPORT_SYMBOL(fsl_usb_host_uninit);