diff options
author | Peter Chen <peter.chen@nxp.com> | 2016-10-30 22:18:20 -0400 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-11-18 06:54:42 -0500 |
commit | a0fe0415e0b2a1d87b54db1a0451e05f59675f0c (patch) | |
tree | 666f5c7c2cec2595456ce256ef2069387e8deee4 /drivers/usb/phy/phy-generic.c | |
parent | a22f884b266514e3657e65f2a63141f70d3644c0 (diff) |
usb: phy: phy-generic: add the implementation of .set_suspend
Add clock operation 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@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/phy/phy-generic.c')
-rw-r--r-- | drivers/usb/phy/phy-generic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 8311ba2968cd..89d6e7a5fdb7 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c | |||
@@ -59,6 +59,15 @@ EXPORT_SYMBOL_GPL(usb_phy_generic_unregister); | |||
59 | 59 | ||
60 | static int nop_set_suspend(struct usb_phy *x, int suspend) | 60 | static int nop_set_suspend(struct usb_phy *x, int suspend) |
61 | { | 61 | { |
62 | struct usb_phy_generic *nop = dev_get_drvdata(x->dev); | ||
63 | |||
64 | if (!IS_ERR(nop->clk)) { | ||
65 | if (suspend) | ||
66 | clk_disable_unprepare(nop->clk); | ||
67 | else | ||
68 | clk_prepare_enable(nop->clk); | ||
69 | } | ||
70 | |||
62 | return 0; | 71 | return 0; |
63 | } | 72 | } |
64 | 73 | ||