OSDN Git Service

usb: phy: qusb2: Switch to SE clk from diff clk upon suspend
authorHemant Kumar <hemantk@codeaurora.org>
Sat, 17 Dec 2016 00:55:44 +0000 (16:55 -0800)
committerHemant Kumar <hemantk@codeaurora.org>
Thu, 22 Dec 2016 01:21:26 +0000 (17:21 -0800)
commit7c2b101e73eef0d22b365adbd7b0e2219611605a
treece5ee0dd667c664f247d2d2719549cae141d2298
parenta80e267a8c0d61790c3d1d5f7181ebd1be39c438
usb: phy: qusb2: Switch to SE clk from diff clk upon suspend

Upon out of XO shutdown due to remote wakeup, as soon as XO gets
restored refclk is supplied to phy before even refgen current
is stabilized. USB3 controller asserts suspend_n signal asynchronously
for remote wake-up scenario solely based on utmi_linestate switching
from J state(suspend) to K state(resume). As a result phy attempts to
lock PLL since all prerequisites are met but, PLL lock attempt fails
and phy gets stuck. Since GCC_RX1_USB2_CLKREF_EN which was supposed to
control differential(CML) clock output to QUSB2 is a no-op, hence switch
to SE clock by PHY CSR controlled mux upon suspend. This prevents refclk
output to go directly to phy upon XO restore and prevents premature phy
pll locking. Phy PLL actually gets locked when phy driver switches back
from SE clk to diff clk.

Change-Id: Ie5474c42ccdd88df4c101b2113ca8d924eddf037
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
drivers/usb/phy/phy-msm-qusb-v2.c