]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00286426-7 usb: phy: add notify suspend and resume callback
authorPeter Chen <peter.chen@freescale.com>
Mon, 16 Sep 2013 08:31:24 +0000 (16:31 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:39 +0000 (10:06 +0200)
They are used to notify PHY that the controller enters suspend
or finishes resume.

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

index 353053a33f21e11af2e11a52fdebf535cfaeaab4..df1ef355c4859437ef36d5d77ac7d7aed18d9e01 100644 (file)
@@ -123,6 +123,11 @@ struct usb_phy {
                        enum usb_device_speed speed);
        int     (*notify_disconnect)(struct usb_phy *x,
                        enum usb_device_speed speed);
+       int     (*notify_suspend)(struct usb_phy *x,
+                       enum usb_device_speed speed);
+       int     (*notify_resume)(struct usb_phy *x,
+                       enum usb_device_speed speed);
+
 };
 
 /**
@@ -298,6 +303,24 @@ usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
                return 0;
 }
 
+static inline int usb_phy_notify_suspend
+       (struct usb_phy *x, enum usb_device_speed speed)
+{
+       if (x && x->notify_suspend)
+               return x->notify_suspend(x, speed);
+       else
+               return 0;
+}
+
+static inline int usb_phy_notify_resume
+       (struct usb_phy *x, enum usb_device_speed speed)
+{
+       if (x && x->notify_resume)
+               return x->notify_resume(x, speed);
+       else
+               return 0;
+}
+
 /* notifiers */
 static inline int
 usb_register_notifier(struct usb_phy *x, struct notifier_block *nb)