summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-09-18 14:19:28 +0800
committerPeter Chen <peter.chen@freescale.com>2013-11-06 15:27:41 +0800
commita4597260de0637ba13d4259b5b10930a968df40a (patch)
tree55acd2e7ec600d47e876b7a03b6a43675bd16eca /include
parent6e7015f4f86f75d5e9677b775c5249a21c92e200 (diff)
ENGR00286426-10 usb: phy: Add set_wakeup API
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/phy.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index d8959aa93c5a..987e121d6200 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -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
+ * waken 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);
@@ -270,6 +277,15 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
}
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)
{
if (x->notify_connect)