diff options
author | Peter Chen <peter.chen@freescale.com> | 2014-02-23 21:21:04 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-03-05 15:40:09 -0500 |
commit | 47d1845ffac0af9e4b439277fee50b62aed650a7 (patch) | |
tree | ca52c877fb4cbe99ec406ab06313335ef2768b56 /drivers/usb/phy | |
parent | bf78343800861c65d4004e7f60a03cc9bc2410b3 (diff) |
usb: phy: mxs: Add sync time after controller clear phcd
After clear portsc.phcd, PHY needs 200us stable time for switch
32K clock to AHB clock.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r-- | drivers/usb/phy/phy-mxs-usb.c | 11 |
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 31ef59f88901..c42bdf0c4a1f 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c | |||
@@ -151,6 +151,15 @@ static inline bool is_imx6sl_phy(struct mxs_phy *mxs_phy) | |||
151 | return mxs_phy->data == &imx6sl_phy_data; | 151 | return mxs_phy->data == &imx6sl_phy_data; |
152 | } | 152 | } |
153 | 153 | ||
154 | /* | ||
155 | * PHY needs some 32K cycles to switch from 32K clock to | ||
156 | * bus (such as AHB/AXI, etc) clock. | ||
157 | */ | ||
158 | static void mxs_phy_clock_switch_delay(void) | ||
159 | { | ||
160 | usleep_range(300, 400); | ||
161 | } | ||
162 | |||
154 | static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) | 163 | static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) |
155 | { | 164 | { |
156 | int ret; | 165 | int ret; |
@@ -261,6 +270,7 @@ static int mxs_phy_init(struct usb_phy *phy) | |||
261 | int ret; | 270 | int ret; |
262 | struct mxs_phy *mxs_phy = to_mxs_phy(phy); | 271 | struct mxs_phy *mxs_phy = to_mxs_phy(phy); |
263 | 272 | ||
273 | mxs_phy_clock_switch_delay(); | ||
264 | ret = clk_prepare_enable(mxs_phy->clk); | 274 | ret = clk_prepare_enable(mxs_phy->clk); |
265 | if (ret) | 275 | if (ret) |
266 | return ret; | 276 | return ret; |
@@ -289,6 +299,7 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend) | |||
289 | x->io_priv + HW_USBPHY_CTRL_SET); | 299 | x->io_priv + HW_USBPHY_CTRL_SET); |
290 | clk_disable_unprepare(mxs_phy->clk); | 300 | clk_disable_unprepare(mxs_phy->clk); |
291 | } else { | 301 | } else { |
302 | mxs_phy_clock_switch_delay(); | ||
292 | ret = clk_prepare_enable(mxs_phy->clk); | 303 | ret = clk_prepare_enable(mxs_phy->clk); |
293 | if (ret) | 304 | if (ret) |
294 | return ret; | 305 | return ret; |