diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-09-16 16:31:24 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 10:57:00 -0600 |
commit | 3a62d7b0cf455f769cfc7125ca8f97047997fce6 (patch) | |
tree | ba1cfdeb3aed498162c7425854067e8a45917992 /include/linux/usb | |
parent | 208413c08279a76512fdbf363d24fc29448b3c00 (diff) |
MLK-11340-26 usb: phy: add notify suspend and resume callback
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)
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/phy.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index bc91b5d380fd..1e0345d6fadb 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -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); + }; /** @@ -302,6 +307,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) |