mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
usb: phy: mxs-phy: add set_suspend API
It needs to call set_suspend during USB suspend/resume Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
d1c3ed669a
commit
04a6221c50
1 changed files with 20 additions and 0 deletions
|
@ -76,6 +76,25 @@ static void mxs_phy_shutdown(struct usb_phy *phy)
|
||||||
clk_disable_unprepare(mxs_phy->clk);
|
clk_disable_unprepare(mxs_phy->clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mxs_phy_suspend(struct usb_phy *x, int suspend)
|
||||||
|
{
|
||||||
|
struct mxs_phy *mxs_phy = to_mxs_phy(x);
|
||||||
|
|
||||||
|
if (suspend) {
|
||||||
|
writel_relaxed(0xffffffff, x->io_priv + HW_USBPHY_PWD);
|
||||||
|
writel_relaxed(BM_USBPHY_CTRL_CLKGATE,
|
||||||
|
x->io_priv + HW_USBPHY_CTRL_SET);
|
||||||
|
clk_disable_unprepare(mxs_phy->clk);
|
||||||
|
} else {
|
||||||
|
clk_prepare_enable(mxs_phy->clk);
|
||||||
|
writel_relaxed(BM_USBPHY_CTRL_CLKGATE,
|
||||||
|
x->io_priv + HW_USBPHY_CTRL_CLR);
|
||||||
|
writel_relaxed(0, x->io_priv + HW_USBPHY_PWD);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int mxs_phy_on_connect(struct usb_phy *phy,
|
static int mxs_phy_on_connect(struct usb_phy *phy,
|
||||||
enum usb_device_speed speed)
|
enum usb_device_speed speed)
|
||||||
{
|
{
|
||||||
|
@ -137,6 +156,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
|
||||||
mxs_phy->phy.label = DRIVER_NAME;
|
mxs_phy->phy.label = DRIVER_NAME;
|
||||||
mxs_phy->phy.init = mxs_phy_init;
|
mxs_phy->phy.init = mxs_phy_init;
|
||||||
mxs_phy->phy.shutdown = mxs_phy_shutdown;
|
mxs_phy->phy.shutdown = mxs_phy_shutdown;
|
||||||
|
mxs_phy->phy.set_suspend = mxs_phy_suspend;
|
||||||
mxs_phy->phy.notify_connect = mxs_phy_on_connect;
|
mxs_phy->phy.notify_connect = mxs_phy_on_connect;
|
||||||
mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect;
|
mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue