summaryrefslogtreecommitdiff
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorLi Jun <b47624@freescale.com>2015-01-20 16:03:38 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 10:57:03 -0600
commitc3fbcbc498022570bcf24dda9ec4bef7c4296d24 (patch)
treeaf0e383b2e167309e1ad4d7cfb21c65d88ca6f94 /drivers/usb/phy
parent9513eb8891d76f83ed064f6d5233337a3f02db2a (diff)
MLK-10086-3 usb: phy-nop: add the implementation of .set_suspend
Add clock enable/disable at .set_suspend if the PHY has suspend requirement, it can be benefit of power saving for phy and the whole system (parent clock may also be disabled). Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit 6c2f853799899c37ee2f733cafd58f1b2dc1f37f)
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-generic.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index 0cd85f2ccddd..1fec0a9fc999 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -59,6 +59,16 @@ EXPORT_SYMBOL_GPL(usb_phy_generic_unregister);
static int nop_set_suspend(struct usb_phy *x, int suspend)
{
+ struct usb_phy_generic *nop = dev_get_drvdata(x->dev);
+
+ if (IS_ERR(nop->clk))
+ return 0;
+
+ if (suspend)
+ clk_disable_unprepare(nop->clk);
+ else
+ clk_prepare_enable(nop->clk);
+
return 0;
}