summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-11-21 15:37:38 +0800
committerPeter Chen <peter.chen@freescale.com>2013-11-22 14:31:32 +0800
commit9282def94701f9c763806f8a9fccbcac0dfddcc5 (patch)
tree445251d392ff7c305d518bcb8fd709f0ed0c608e /drivers
parentf42e85d550fc63e28b89276e62a7e2004a440b31 (diff)
ENGR00288578-2 usb: phy-mxs: Add sync time after controller clear phcd
After clear portsc.phcd, PHY needs 200us time from switch 32K clock to AHB clock. Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit bc41c2efbbf5f6452e9848e6d85b16fd7c98b246)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index ad21a5c7418a..d4466a78572c 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -139,6 +139,15 @@ static inline bool is_imx6sl_phy(struct mxs_phy *mxs_phy)
return mxs_phy->data == &imx6sl_phy_data;
}
+/*
+ * PHY needs some 32K cycles to switch from 32K clock to
+ * bus (such as AHB/AXI, etc) clock.
+ */
+static void mxs_phy_clock_switch(void)
+{
+ usleep_range(300, 400);
+}
+
static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
{
int ret;
@@ -234,6 +243,7 @@ static int mxs_phy_init(struct usb_phy *phy)
{
struct mxs_phy *mxs_phy = to_mxs_phy(phy);
+ mxs_phy_clock_switch();
clk_prepare_enable(mxs_phy->clk);
return mxs_phy_hw_init(mxs_phy);
}
@@ -258,6 +268,7 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend)
x->io_priv + HW_USBPHY_CTRL_SET);
clk_disable_unprepare(mxs_phy->clk);
} else {
+ mxs_phy_clock_switch();
clk_prepare_enable(mxs_phy->clk);
writel(BM_USBPHY_CTRL_CLKGATE,
x->io_priv + HW_USBPHY_CTRL_CLR);