Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0fe0415 authored by Peter Chen's avatar Peter Chen Committed by Felipe Balbi
Browse files

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: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent a22f884b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -59,6 +59,15 @@ 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)) {
		if (suspend)
			clk_disable_unprepare(nop->clk);
		else
			clk_prepare_enable(nop->clk);
	}

	return 0;
}