aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 13:03:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 13:03:27 -0500
commit224acb1839f5fbb4ba85a440f6dd30dfb0e561b6 (patch)
tree531676e2a139cf26154c49626c0a2be69098c319 /drivers/usb/musb
parentb0c3844d8af6b9f3f18f31e1b0502fbefa2166be (diff)
Revert "USB: musb: blackfin: pm: make it work"
This reverts commit 1e393c6eece048052d4131ec4dad3b98e35a98e2. Needed to properly merge the musb changes that are in the usb-next branch into Linus's tree. Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/blackfin.c72
-rw-r--r--drivers/usb/musb/musb_core.h2
2 files changed, 24 insertions, 50 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index fcb5206a65bd..930a2611fe3e 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -324,8 +324,30 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
324 return -EIO; 324 return -EIO;
325} 325}
326 326
327static void musb_platform_reg_init(struct musb *musb) 327int __init musb_platform_init(struct musb *musb, void *board_data)
328{ 328{
329
330 /*
331 * Rev 1.0 BF549 EZ-KITs require PE7 to be high for both DEVICE
332 * and OTG HOST modes, while rev 1.1 and greater require PE7 to
333 * be low for DEVICE mode and high for HOST mode. We set it high
334 * here because we are in host mode
335 */
336
337 if (gpio_request(musb->config->gpio_vrsel, "USB_VRSEL")) {
338 printk(KERN_ERR "Failed ro request USB_VRSEL GPIO_%d \n",
339 musb->config->gpio_vrsel);
340 return -ENODEV;
341 }
342 gpio_direction_output(musb->config->gpio_vrsel, 0);
343
344 usb_nop_xceiv_register();
345 musb->xceiv = otg_get_transceiver();
346 if (!musb->xceiv) {
347 gpio_free(musb->config->gpio_vrsel);
348 return -ENODEV;
349 }
350
329 if (ANOMALY_05000346) { 351 if (ANOMALY_05000346) {
330 bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value); 352 bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);
331 SSYNC(); 353 SSYNC();
@@ -360,33 +382,6 @@ static void musb_platform_reg_init(struct musb *musb)
360 EP2_RX_ENA | EP3_RX_ENA | EP4_RX_ENA | 382 EP2_RX_ENA | EP3_RX_ENA | EP4_RX_ENA |
361 EP5_RX_ENA | EP6_RX_ENA | EP7_RX_ENA); 383 EP5_RX_ENA | EP6_RX_ENA | EP7_RX_ENA);
362 SSYNC(); 384 SSYNC();
363}
364
365int __init musb_platform_init(struct musb *musb, void *board_data)
366{
367
368 /*
369 * Rev 1.0 BF549 EZ-KITs require PE7 to be high for both DEVICE
370 * and OTG HOST modes, while rev 1.1 and greater require PE7 to
371 * be low for DEVICE mode and high for HOST mode. We set it high
372 * here because we are in host mode
373 */
374
375 if (gpio_request(musb->config->gpio_vrsel, "USB_VRSEL")) {
376 printk(KERN_ERR "Failed ro request USB_VRSEL GPIO_%d\n",
377 musb->config->gpio_vrsel);
378 return -ENODEV;
379 }
380 gpio_direction_output(musb->config->gpio_vrsel, 0);
381
382 usb_nop_xceiv_register();
383 musb->xceiv = otg_get_transceiver();
384 if (!musb->xceiv) {
385 gpio_free(musb->config->gpio_vrsel);
386 return -ENODEV;
387 }
388
389 musb_platform_reg_init(musb);
390 385
391 if (is_host_enabled(musb)) { 386 if (is_host_enabled(musb)) {
392 musb->board_set_vbus = bfin_set_vbus; 387 musb->board_set_vbus = bfin_set_vbus;
@@ -401,27 +396,6 @@ int __init musb_platform_init(struct musb *musb, void *board_data)
401 return 0; 396 return 0;
402} 397}
403 398
404#ifdef CONFIG_PM
405void musb_platform_save_context(struct musb *musb,
406 struct musb_context_registers *musb_context)
407{
408 if (is_host_active(musb))
409 /*
410 * During hibernate gpio_vrsel will change from high to low
411 * low which will generate wakeup event resume the system
412 * immediately. Set it to 0 before hibernate to avoid this
413 * wakeup event.
414 */
415 gpio_set_value(musb->config->gpio_vrsel, 0);
416}
417
418void musb_platform_restore_context(struct musb *musb,
419 struct musb_context_registers *musb_context)
420{
421 musb_platform_reg_init(musb);
422}
423#endif
424
425int musb_platform_exit(struct musb *musb) 399int musb_platform_exit(struct musb *musb)
426{ 400{
427 gpio_free(musb->config->gpio_vrsel); 401 gpio_free(musb->config->gpio_vrsel);
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index febaabcc2b35..69797e5b46a7 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -487,7 +487,7 @@ struct musb_context_registers {
487}; 487};
488 488
489#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ 489#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
490 defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_BLACKFIN) 490 defined(CONFIG_ARCH_OMAP4)
491extern void musb_platform_save_context(struct musb *musb, 491extern void musb_platform_save_context(struct musb *musb,
492 struct musb_context_registers *musb_context); 492 struct musb_context_registers *musb_context);
493extern void musb_platform_restore_context(struct musb *musb, 493extern void musb_platform_restore_context(struct musb *musb,