usb: phy: generic: Add wakeup capability

In case USB phy is the wakeup source, enable its wakeup
capability.

Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1666764742-4201-2-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Li Jun 2022-10-26 14:12:22 +08:00 committed by Greg Kroah-Hartman
parent 434d806f07
commit 4567d1a97f
1 changed files with 4 additions and 0 deletions

View File

@ -286,6 +286,7 @@ EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy);
static int usb_phy_generic_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *dn = dev->of_node;
struct usb_phy_generic *nop;
int err;
@ -323,6 +324,9 @@ static int usb_phy_generic_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, nop);
device_set_wakeup_capable(&pdev->dev,
of_property_read_bool(dn, "wakeup-source"));
return 0;
}