aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2014-02-23 21:21:01 -0500
committerFelipe Balbi <balbi@ti.com>2014-03-05 15:40:08 -0500
commit57bf9b09a6ad517b0c790b786845660ec5604774 (patch)
treea466a0a21bf71524dd48c72377a86421c32c23a1 /include/linux/usb
parent83be181b64222630957b9f59fd2d8c8864cb8972 (diff)
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> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-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 6c0b1c513db7..353053a33f21 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -111,6 +111,13 @@ struct usb_phy {
111 int (*set_suspend)(struct usb_phy *x, 111 int (*set_suspend)(struct usb_phy *x,
112 int suspend); 112 int suspend);
113 113
114 /*
115 * Set wakeup enable for PHY, in that case, the PHY can be
116 * woken up from suspend status due to external events,
117 * like vbus change, dp/dm change and id.
118 */
119 int (*set_wakeup)(struct usb_phy *x, bool enabled);
120
114 /* notify phy connect status change */ 121 /* notify phy connect status change */
115 int (*notify_connect)(struct usb_phy *x, 122 int (*notify_connect)(struct usb_phy *x,
116 enum usb_device_speed speed); 123 enum usb_device_speed speed);
@@ -265,6 +272,15 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
265} 272}
266 273
267static inline int 274static inline int
275usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
276{
277 if (x && x->set_wakeup)
278 return x->set_wakeup(x, enabled);
279 else
280 return 0;
281}
282
283static inline int
268usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) 284usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
269{ 285{
270 if (x && x->notify_connect) 286 if (x && x->notify_connect)