usb: phy: generic: Add wakeup capability
authorLi Jun <jun.li@nxp.com>
Wed, 26 Oct 2022 06:12:22 +0000 (14:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Nov 2022 11:36:07 +0000 (12:36 +0100)
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>
drivers/usb/phy/phy-generic.c

index 8ed9327..c1309ea 100644 (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;
 }