Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Chen and committed by
Felipe Balbi
47d1845f bf783438

+11
+11
drivers/usb/phy/phy-mxs-usb.c
··· 151 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 163 static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) 155 164 { 156 165 int ret; ··· 270 261 int ret; 271 262 struct mxs_phy *mxs_phy = to_mxs_phy(phy); 272 263 264 + mxs_phy_clock_switch_delay(); 273 265 ret = clk_prepare_enable(mxs_phy->clk); 274 266 if (ret) 275 267 return ret; ··· 299 289 x->io_priv + HW_USBPHY_CTRL_SET); 300 290 clk_disable_unprepare(mxs_phy->clk); 301 291 } else { 292 + mxs_phy_clock_switch_delay(); 302 293 ret = clk_prepare_enable(mxs_phy->clk); 303 294 if (ret) 304 295 return ret;