aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/davinci.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-11-24 08:46:26 -0500
committerFelipe Balbi <balbi@ti.com>2012-08-09 05:34:46 -0400
commit032ec49f5351e9cb242b1a1c367d14415043ab95 (patch)
treec23887e0302e4fa10a5ee6501a85e69bbd802475 /drivers/usb/musb/davinci.c
parent4f3e8d263d34e52e75b5adfa14811467d3033d8e (diff)
usb: musb: drop useless board_mode usage
we are compiling the driver always with full OTG capabilities, so that board_mode trick becomes useless. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/davinci.c')
-rw-r--r--drivers/usb/musb/davinci.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 472c8b42d38b..8805f809175c 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -115,8 +115,7 @@ static void davinci_musb_enable(struct musb *musb)
115 dma_off = 0; 115 dma_off = 0;
116 116
117 /* force a DRVVBUS irq so we can start polling for ID change */ 117 /* force a DRVVBUS irq so we can start polling for ID change */
118 if (is_otg_enabled(musb)) 118 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG,
119 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG,
120 DAVINCI_INTR_DRVVBUS << DAVINCI_USB_USBINT_SHIFT); 119 DAVINCI_INTR_DRVVBUS << DAVINCI_USB_USBINT_SHIFT);
121} 120}
122 121
@@ -234,10 +233,8 @@ static void otg_timer(unsigned long _musb)
234 MUSB_INTR_VBUSERROR << DAVINCI_USB_USBINT_SHIFT); 233 MUSB_INTR_VBUSERROR << DAVINCI_USB_USBINT_SHIFT);
235 break; 234 break;
236 case OTG_STATE_B_IDLE: 235 case OTG_STATE_B_IDLE:
237 if (!is_peripheral_enabled(musb)) 236 /*
238 break; 237 * There's no ID-changed IRQ, so we have no good way to tell
239
240 /* There's no ID-changed IRQ, so we have no good way to tell
241 * when to switch to the A-Default state machine (by setting 238 * when to switch to the A-Default state machine (by setting
242 * the DEVCTL.SESSION flag). 239 * the DEVCTL.SESSION flag).
243 * 240 *
@@ -315,8 +312,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
315 u8 devctl = musb_readb(mregs, MUSB_DEVCTL); 312 u8 devctl = musb_readb(mregs, MUSB_DEVCTL);
316 int err = musb->int_usb & MUSB_INTR_VBUSERROR; 313 int err = musb->int_usb & MUSB_INTR_VBUSERROR;
317 314
318 err = is_host_enabled(musb) 315 err = musb->int_usb & MUSB_INTR_VBUSERROR;
319 && (musb->int_usb & MUSB_INTR_VBUSERROR);
320 if (err) { 316 if (err) {
321 /* The Mentor core doesn't debounce VBUS as needed 317 /* The Mentor core doesn't debounce VBUS as needed
322 * to cope with device connect current spikes. This 318 * to cope with device connect current spikes. This
@@ -332,7 +328,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
332 musb->xceiv->state = OTG_STATE_A_WAIT_VFALL; 328 musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
333 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 329 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
334 WARNING("VBUS error workaround (delay coming)\n"); 330 WARNING("VBUS error workaround (delay coming)\n");
335 } else if (is_host_enabled(musb) && drvvbus) { 331 } else if (drvvbus) {
336 MUSB_HST_MODE(musb); 332 MUSB_HST_MODE(musb);
337 otg->default_a = 1; 333 otg->default_a = 1;
338 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 334 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
@@ -365,8 +361,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
365 musb_writel(tibase, DAVINCI_USB_EOI_REG, 0); 361 musb_writel(tibase, DAVINCI_USB_EOI_REG, 0);
366 362
367 /* poll for ID change */ 363 /* poll for ID change */
368 if (is_otg_enabled(musb) 364 if (musb->xceiv->state == OTG_STATE_B_IDLE)
369 && musb->xceiv->state == OTG_STATE_B_IDLE)
370 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 365 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
371 366
372 spin_unlock_irqrestore(&musb->lock, flags); 367 spin_unlock_irqrestore(&musb->lock, flags);
@@ -397,8 +392,7 @@ static int davinci_musb_init(struct musb *musb)
397 if (revision == 0) 392 if (revision == 0)
398 goto fail; 393 goto fail;
399 394
400 if (is_host_enabled(musb)) 395 setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
401 setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
402 396
403 davinci_musb_source_power(musb, 0, 1); 397 davinci_musb_source_power(musb, 0, 1);
404 398
@@ -419,12 +413,7 @@ static int davinci_musb_init(struct musb *musb)
419 if (cpu_is_davinci_dm355()) { 413 if (cpu_is_davinci_dm355()) {
420 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); 414 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
421 415
422 if (is_host_enabled(musb)) { 416 deepsleep &= ~DRVVBUS_FORCE;
423 deepsleep &= ~DRVVBUS_OVERRIDE;
424 } else {
425 deepsleep &= ~DRVVBUS_FORCE;
426 deepsleep |= DRVVBUS_OVERRIDE;
427 }
428 __raw_writel(deepsleep, DM355_DEEPSLEEP); 417 __raw_writel(deepsleep, DM355_DEEPSLEEP);
429 } 418 }
430 419
@@ -453,8 +442,7 @@ unregister:
453 442
454static int davinci_musb_exit(struct musb *musb) 443static int davinci_musb_exit(struct musb *musb)
455{ 444{
456 if (is_host_enabled(musb)) 445 del_timer_sync(&otg_workaround);
457 del_timer_sync(&otg_workaround);
458 446
459 /* force VBUS off */ 447 /* force VBUS off */
460 if (cpu_is_davinci_dm355()) { 448 if (cpu_is_davinci_dm355()) {
@@ -468,7 +456,7 @@ static int davinci_musb_exit(struct musb *musb)
468 davinci_musb_source_power(musb, 0 /*off*/, 1); 456 davinci_musb_source_power(musb, 0 /*off*/, 1);
469 457
470 /* delay, to avoid problems with module reload */ 458 /* delay, to avoid problems with module reload */
471 if (is_host_enabled(musb) && musb->xceiv->otg->default_a) { 459 if (musb->xceiv->otg->default_a) {
472 int maxdelay = 30; 460 int maxdelay = 30;
473 u8 devctl, warn = 0; 461 u8 devctl, warn = 0;
474 462