On Thu, Dec 26, 2013 at 03:36:03PM +0800, Peter Chen wrote: > 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@xxxxxxxxxxxxx> > --- > drivers/usb/phy/phy-generic.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c > index aa6d37b..4b20a97 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); heh, this is why I don't like clk_enable_prepare(). usb_phy_set_suspend() can be called from atomic context. I can't take this patch as is, sorry. -- balbi
Attachment:
signature.asc
Description: Digital signature