mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
a22f884b26
commit
a0fe0415e0
1 changed files with 9 additions and 0 deletions
|
@ -59,6 +59,15 @@ EXPORT_SYMBOL_GPL(usb_phy_generic_unregister);
|
||||||
|
|
||||||
static int nop_set_suspend(struct usb_phy *x, int suspend)
|
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)) {
|
||||||
|
if (suspend)
|
||||||
|
clk_disable_unprepare(nop->clk);
|
||||||
|
else
|
||||||
|
clk_prepare_enable(nop->clk);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue