From f3b75e149616d8253528b99f0302dbc9abe8bfc9 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Tue, 20 Jan 2015 16:03:38 +0800 Subject: [PATCH] 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 (cherry picked from commit 6c2f853799899c37ee2f733cafd58f1b2dc1f37f) --- drivers/usb/phy/phy-generic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 8311ba2968cd..cdc6f862dcdb 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; } -- 2.17.1