summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jun <b47624@freescale.com>2015-01-20 16:03:38 +0800
committerPeter Chen <peter.chen@freescale.com>2015-01-26 13:18:06 +0800
commit4b54bd6b46f586832e908a6152e395b7809b083a (patch)
tree5c22778c2a8dfdc2fac10c40ea545f3684f79fc2
parent40ab0b2bd830d5b96b8a4a205fb8210eecf35354 (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>
-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 67572cc0dd3e..f0e458b1d9bc 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -65,6 +65,16 @@ EXPORT_SYMBOL(usb_nop_xceiv_unregister);
static int nop_set_suspend(struct usb_phy *x, int suspend)
{
+ struct usb_phy_gen_xceiv *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;
}