aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-01-10 03:35:53 -0500
committerFelipe Balbi <balbi@ti.com>2013-01-18 08:03:25 -0500
commit04a6221c509e90b5f921d408bbf0afcf91147280 (patch)
tree11958c3d3585b5d6dea36338499dc4c39644d258
parentd1c3ed669a2d452cacfb48c2d171a1f364dae2ed (diff)
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>
-rw-r--r--drivers/usb/otg/mxs-phy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
index 76302720055a..5158332522b1 100644
--- a/drivers/usb/otg/mxs-phy.c
+++ b/drivers/usb/otg/mxs-phy.c
@@ -76,6 +76,25 @@ static void mxs_phy_shutdown(struct usb_phy *phy)
76 clk_disable_unprepare(mxs_phy->clk); 76 clk_disable_unprepare(mxs_phy->clk);
77} 77}
78 78
79static int mxs_phy_suspend(struct usb_phy *x, int suspend)
80{
81 struct mxs_phy *mxs_phy = to_mxs_phy(x);
82
83 if (suspend) {
84 writel_relaxed(0xffffffff, x->io_priv + HW_USBPHY_PWD);
85 writel_relaxed(BM_USBPHY_CTRL_CLKGATE,
86 x->io_priv + HW_USBPHY_CTRL_SET);
87 clk_disable_unprepare(mxs_phy->clk);
88 } else {
89 clk_prepare_enable(mxs_phy->clk);
90 writel_relaxed(BM_USBPHY_CTRL_CLKGATE,
91 x->io_priv + HW_USBPHY_CTRL_CLR);
92 writel_relaxed(0, x->io_priv + HW_USBPHY_PWD);
93 }
94
95 return 0;
96}
97
79static int mxs_phy_on_connect(struct usb_phy *phy, 98static int mxs_phy_on_connect(struct usb_phy *phy,
80 enum usb_device_speed speed) 99 enum usb_device_speed speed)
81{ 100{
@@ -137,6 +156,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
137 mxs_phy->phy.label = DRIVER_NAME; 156 mxs_phy->phy.label = DRIVER_NAME;
138 mxs_phy->phy.init = mxs_phy_init; 157 mxs_phy->phy.init = mxs_phy_init;
139 mxs_phy->phy.shutdown = mxs_phy_shutdown; 158 mxs_phy->phy.shutdown = mxs_phy_shutdown;
159 mxs_phy->phy.set_suspend = mxs_phy_suspend;
140 mxs_phy->phy.notify_connect = mxs_phy_on_connect; 160 mxs_phy->phy.notify_connect = mxs_phy_on_connect;
141 mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; 161 mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect;
142 162