5057a2a01c83ac547459da151f7b812c5e507095
[openwrt/staging/mkresin.git] /
1 From 7306c576fd8463f915192e68b7d0b93a24d43c9e Mon Sep 17 00:00:00 2001
2 From: Peter Chen <peter.chen@freescale.com>
3 Date: Mon, 16 Sep 2013 16:31:24 +0800
4 Subject: [PATCH] MLK-11340-26 usb: phy: add notify suspend and resume callback
5
6 They are used to notify PHY that the controller enters suspend
7 or finishes resume.
8
9 Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 ---
11 include/linux/usb/phy.h | 24 ++++++++++++++++++++++++
12 1 file changed, 24 insertions(+)
13
14 --- a/include/linux/usb/phy.h
15 +++ b/include/linux/usb/phy.h
16 @@ -155,6 +155,12 @@ struct usb_phy {
17 * manually detect the charger type.
18 */
19 enum usb_charger_type (*charger_detect)(struct usb_phy *x);
20 +
21 + int (*notify_suspend)(struct usb_phy *x,
22 + enum usb_device_speed speed);
23 + int (*notify_resume)(struct usb_phy *x,
24 + enum usb_device_speed speed);
25 +
26 };
27
28 /* for board-specific init logic */
29 @@ -333,6 +339,24 @@ usb_phy_notify_disconnect(struct usb_phy
30 else
31 return 0;
32 }
33 +
34 +static inline int usb_phy_notify_suspend
35 + (struct usb_phy *x, enum usb_device_speed speed)
36 +{
37 + if (x && x->notify_suspend)
38 + return x->notify_suspend(x, speed);
39 + else
40 + return 0;
41 +}
42 +
43 +static inline int usb_phy_notify_resume
44 + (struct usb_phy *x, enum usb_device_speed speed)
45 +{
46 + if (x && x->notify_resume)
47 + return x->notify_resume(x, speed);
48 + else
49 + return 0;
50 +}
51
52 /* notifiers */
53 static inline int