MLK-11340-26 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)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:46:56 +0000 (14:46 -0500)
They are used to notify PHY that the controller enters suspend
or finishes resume.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 737908259ccc3c3166a51ed8e3638ac1f1730e08)

include/linux/usb/phy.h

index 31a8068..9772343 100644 (file)
@@ -122,6 +122,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);
+
 };
 
 /**
@@ -310,6 +315,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)