diff options
Diffstat (limited to 'include/linux/usb/otg.h')
-rw-r--r-- | include/linux/usb/otg.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 545cba73ccaf..d87f44f5b04e 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -66,6 +66,7 @@ struct otg_transceiver { | |||
66 | 66 | ||
67 | u8 default_a; | 67 | u8 default_a; |
68 | enum usb_otg_state state; | 68 | enum usb_otg_state state; |
69 | enum usb_xceiv_events last_event; | ||
69 | 70 | ||
70 | struct usb_bus *host; | 71 | struct usb_bus *host; |
71 | struct usb_gadget *gadget; | 72 | struct usb_gadget *gadget; |
@@ -74,7 +75,7 @@ struct otg_transceiver { | |||
74 | void __iomem *io_priv; | 75 | void __iomem *io_priv; |
75 | 76 | ||
76 | /* for notification of usb_xceiv_events */ | 77 | /* for notification of usb_xceiv_events */ |
77 | struct blocking_notifier_head notifier; | 78 | struct atomic_notifier_head notifier; |
78 | 79 | ||
79 | /* to pass extra port status to the root hub */ | 80 | /* to pass extra port status to the root hub */ |
80 | u16 port_status; | 81 | u16 port_status; |
@@ -116,7 +117,7 @@ struct otg_transceiver { | |||
116 | /* for board-specific init logic */ | 117 | /* for board-specific init logic */ |
117 | extern int otg_set_transceiver(struct otg_transceiver *); | 118 | extern int otg_set_transceiver(struct otg_transceiver *); |
118 | 119 | ||
119 | #if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE) | 120 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
120 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 121 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
121 | extern void usb_nop_xceiv_register(void); | 122 | extern void usb_nop_xceiv_register(void); |
122 | extern void usb_nop_xceiv_unregister(void); | 123 | extern void usb_nop_xceiv_unregister(void); |
@@ -164,8 +165,25 @@ otg_shutdown(struct otg_transceiver *otg) | |||
164 | } | 165 | } |
165 | 166 | ||
166 | /* for usb host and peripheral controller drivers */ | 167 | /* for usb host and peripheral controller drivers */ |
168 | #ifdef CONFIG_USB_OTG_UTILS | ||
167 | extern struct otg_transceiver *otg_get_transceiver(void); | 169 | extern struct otg_transceiver *otg_get_transceiver(void); |
168 | extern void otg_put_transceiver(struct otg_transceiver *); | 170 | extern void otg_put_transceiver(struct otg_transceiver *); |
171 | extern const char *otg_state_string(enum usb_otg_state state); | ||
172 | #else | ||
173 | static inline struct otg_transceiver *otg_get_transceiver(void) | ||
174 | { | ||
175 | return NULL; | ||
176 | } | ||
177 | |||
178 | static inline void otg_put_transceiver(struct otg_transceiver *x) | ||
179 | { | ||
180 | } | ||
181 | |||
182 | static inline const char *otg_state_string(enum usb_otg_state state) | ||
183 | { | ||
184 | return NULL; | ||
185 | } | ||
186 | #endif | ||
169 | 187 | ||
170 | /* Context: can sleep */ | 188 | /* Context: can sleep */ |
171 | static inline int | 189 | static inline int |
@@ -223,13 +241,13 @@ otg_start_srp(struct otg_transceiver *otg) | |||
223 | static inline int | 241 | static inline int |
224 | otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb) | 242 | otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb) |
225 | { | 243 | { |
226 | return blocking_notifier_chain_register(&otg->notifier, nb); | 244 | return atomic_notifier_chain_register(&otg->notifier, nb); |
227 | } | 245 | } |
228 | 246 | ||
229 | static inline void | 247 | static inline void |
230 | otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb) | 248 | otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb) |
231 | { | 249 | { |
232 | blocking_notifier_chain_unregister(&otg->notifier, nb); | 250 | atomic_notifier_chain_unregister(&otg->notifier, nb); |
233 | } | 251 | } |
234 | 252 | ||
235 | /* for OTG controller drivers (and maybe other stuff) */ | 253 | /* for OTG controller drivers (and maybe other stuff) */ |