From 0fa4bd20d8acf070b07de3e06e62422fad3a9a4c Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Mon, 16 Sep 2013 16:31:24 +0800 Subject: [PATCH] ENGR00286426-7 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 --- include/linux/usb/phy.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 353053a33f21..df1ef355c485 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -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) -- 2.39.5