diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/musb/musb_core.h | 2 | ||||
-rw-r--r-- | drivers/usb/musb/omap2430.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index bd2e6b8b814e..3d28fb8a2dc9 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -327,6 +327,7 @@ struct musb { | |||
327 | 327 | ||
328 | irqreturn_t (*isr)(int, void *); | 328 | irqreturn_t (*isr)(int, void *); |
329 | struct work_struct irq_work; | 329 | struct work_struct irq_work; |
330 | struct work_struct otg_notifier_work; | ||
330 | u16 hwvers; | 331 | u16 hwvers; |
331 | 332 | ||
332 | /* this hub status bit is reserved by USB 2.0 and not seen by usbcore */ | 333 | /* this hub status bit is reserved by USB 2.0 and not seen by usbcore */ |
@@ -372,6 +373,7 @@ struct musb { | |||
372 | u16 int_tx; | 373 | u16 int_tx; |
373 | 374 | ||
374 | struct otg_transceiver *xceiv; | 375 | struct otg_transceiver *xceiv; |
376 | u8 xceiv_event; | ||
375 | 377 | ||
376 | int nIrq; | 378 | int nIrq; |
377 | unsigned irq_wake:1; | 379 | unsigned irq_wake:1; |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 2f6cd431fb1c..fd5dd46039ad 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -227,11 +227,21 @@ static int musb_otg_notifications(struct notifier_block *nb, | |||
227 | unsigned long event, void *unused) | 227 | unsigned long event, void *unused) |
228 | { | 228 | { |
229 | struct musb *musb = container_of(nb, struct musb, nb); | 229 | struct musb *musb = container_of(nb, struct musb, nb); |
230 | |||
231 | musb->xceiv_event = event; | ||
232 | schedule_work(&musb->otg_notifier_work); | ||
233 | |||
234 | return 0; | ||
235 | } | ||
236 | |||
237 | static void musb_otg_notifier_work(struct work_struct *data_notifier_work) | ||
238 | { | ||
239 | struct musb *musb = container_of(data_notifier_work, struct musb, otg_notifier_work); | ||
230 | struct device *dev = musb->controller; | 240 | struct device *dev = musb->controller; |
231 | struct musb_hdrc_platform_data *pdata = dev->platform_data; | 241 | struct musb_hdrc_platform_data *pdata = dev->platform_data; |
232 | struct omap_musb_board_data *data = pdata->board_data; | 242 | struct omap_musb_board_data *data = pdata->board_data; |
233 | 243 | ||
234 | switch (event) { | 244 | switch (musb->xceiv_event) { |
235 | case USB_EVENT_ID: | 245 | case USB_EVENT_ID: |
236 | dev_dbg(musb->controller, "ID GND\n"); | 246 | dev_dbg(musb->controller, "ID GND\n"); |
237 | 247 | ||
@@ -296,6 +306,8 @@ static int omap2430_musb_init(struct musb *musb) | |||
296 | return -ENODEV; | 306 | return -ENODEV; |
297 | } | 307 | } |
298 | 308 | ||
309 | INIT_WORK(&musb->otg_notifier_work, musb_otg_notifier_work); | ||
310 | |||
299 | status = pm_runtime_get_sync(dev); | 311 | status = pm_runtime_get_sync(dev); |
300 | if (status < 0) { | 312 | if (status < 0) { |
301 | dev_err(dev, "pm_runtime_get_sync FAILED"); | 313 | dev_err(dev, "pm_runtime_get_sync FAILED"); |