]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: phy: Add set_wakeup API
authorPeter Chen <peter.chen@freescale.com>
Mon, 24 Feb 2014 02:21:01 +0000 (10:21 +0800)
committerFelipe Balbi <balbi@ti.com>
Wed, 5 Mar 2014 20:40:08 +0000 (14:40 -0600)
This API is used to set wakeup enable at PHY registers, in that
case, the PHY can be waken up from suspend due to external events,
like vbus change, dp/dm change and id change.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
include/linux/usb/phy.h

index 6c0b1c513db72ce9632396223ed99aca20ff3efb..353053a33f21e11af2e11a52fdebf535cfaeaab4 100644 (file)
@@ -111,6 +111,13 @@ struct usb_phy {
        int     (*set_suspend)(struct usb_phy *x,
                                int suspend);
 
+       /*
+        * Set wakeup enable for PHY, in that case, the PHY can be
+        * woken up from suspend status due to external events,
+        * like vbus change, dp/dm change and id.
+        */
+       int     (*set_wakeup)(struct usb_phy *x, bool enabled);
+
        /* notify phy connect status change */
        int     (*notify_connect)(struct usb_phy *x,
                        enum usb_device_speed speed);
@@ -264,6 +271,15 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
                return 0;
 }
 
+static inline int
+usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
+{
+       if (x && x->set_wakeup)
+               return x->set_wakeup(x, enabled);
+       else
+               return 0;
+}
+
 static inline int
 usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
 {