]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00291282-6 usb: phy-nop: add the implementation of .set_suspend
authorPeter Chen <peter.chen@freescale.com>
Thu, 26 Dec 2013 08:16:44 +0000 (16:16 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:52 +0000 (10:06 +0200)
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>
drivers/usb/phy/phy-generic.c

index 7594e5069ae59d2f621054ff7f6cd7331022f5a2..47233d47d18c16f8171b0ce489ee46d0bfbee05f 100644 (file)
@@ -56,6 +56,16 @@ EXPORT_SYMBOL_GPL(usb_phy_generic_unregister);
 
 static int nop_set_suspend(struct usb_phy *x, int suspend)
 {
+       struct nop_usb_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;
 }