diff options
author | Felipe Balbi <balbi@ti.com> | 2011-11-24 08:46:26 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-08-09 05:34:46 -0400 |
commit | 032ec49f5351e9cb242b1a1c367d14415043ab95 (patch) | |
tree | c23887e0302e4fa10a5ee6501a85e69bbd802475 /drivers/usb/musb/da8xx.c | |
parent | 4f3e8d263d34e52e75b5adfa14811467d3033d8e (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/da8xx.c')
-rw-r--r-- | drivers/usb/musb/da8xx.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 0f9fcec4e1d3..4e4df9d2eee2 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c | |||
@@ -155,9 +155,8 @@ static void da8xx_musb_enable(struct musb *musb) | |||
155 | musb_writel(reg_base, DA8XX_USB_INTR_MASK_SET_REG, mask); | 155 | musb_writel(reg_base, DA8XX_USB_INTR_MASK_SET_REG, mask); |
156 | 156 | ||
157 | /* Force the DRVVBUS IRQ so we can start polling for ID change. */ | 157 | /* Force the DRVVBUS IRQ so we can start polling for ID change. */ |
158 | if (is_otg_enabled(musb)) | 158 | musb_writel(reg_base, DA8XX_USB_INTR_SRC_SET_REG, |
159 | musb_writel(reg_base, DA8XX_USB_INTR_SRC_SET_REG, | 159 | DA8XX_INTR_DRVVBUS << DA8XX_INTR_USB_SHIFT); |
160 | DA8XX_INTR_DRVVBUS << DA8XX_INTR_USB_SHIFT); | ||
161 | } | 160 | } |
162 | 161 | ||
163 | /** | 162 | /** |
@@ -231,9 +230,6 @@ static void otg_timer(unsigned long _musb) | |||
231 | MUSB_INTR_VBUSERROR << DA8XX_INTR_USB_SHIFT); | 230 | MUSB_INTR_VBUSERROR << DA8XX_INTR_USB_SHIFT); |
232 | break; | 231 | break; |
233 | case OTG_STATE_B_IDLE: | 232 | case OTG_STATE_B_IDLE: |
234 | if (!is_peripheral_enabled(musb)) | ||
235 | break; | ||
236 | |||
237 | /* | 233 | /* |
238 | * There's no ID-changed IRQ, so we have no good way to tell | 234 | * There's no ID-changed IRQ, so we have no good way to tell |
239 | * when to switch to the A-Default state machine (by setting | 235 | * when to switch to the A-Default state machine (by setting |
@@ -263,9 +259,6 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout) | |||
263 | { | 259 | { |
264 | static unsigned long last_timer; | 260 | static unsigned long last_timer; |
265 | 261 | ||
266 | if (!is_otg_enabled(musb)) | ||
267 | return; | ||
268 | |||
269 | if (timeout == 0) | 262 | if (timeout == 0) |
270 | timeout = jiffies + msecs_to_jiffies(3); | 263 | timeout = jiffies + msecs_to_jiffies(3); |
271 | 264 | ||
@@ -333,8 +326,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) | |||
333 | u8 devctl = musb_readb(mregs, MUSB_DEVCTL); | 326 | u8 devctl = musb_readb(mregs, MUSB_DEVCTL); |
334 | int err; | 327 | int err; |
335 | 328 | ||
336 | err = is_host_enabled(musb) && (musb->int_usb & | 329 | err = musb->int_usb & USB_INTR_VBUSERROR; |
337 | MUSB_INTR_VBUSERROR); | ||
338 | if (err) { | 330 | if (err) { |
339 | /* | 331 | /* |
340 | * The Mentor core doesn't debounce VBUS as needed | 332 | * The Mentor core doesn't debounce VBUS as needed |
@@ -351,7 +343,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) | |||
351 | musb->xceiv->state = OTG_STATE_A_WAIT_VFALL; | 343 | musb->xceiv->state = OTG_STATE_A_WAIT_VFALL; |
352 | mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); | 344 | mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); |
353 | WARNING("VBUS error workaround (delay coming)\n"); | 345 | WARNING("VBUS error workaround (delay coming)\n"); |
354 | } else if (is_host_enabled(musb) && drvvbus) { | 346 | } else if (drvvbus) { |
355 | MUSB_HST_MODE(musb); | 347 | MUSB_HST_MODE(musb); |
356 | otg->default_a = 1; | 348 | otg->default_a = 1; |
357 | musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; | 349 | musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; |
@@ -382,7 +374,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) | |||
382 | musb_writel(reg_base, DA8XX_USB_END_OF_INTR_REG, 0); | 374 | musb_writel(reg_base, DA8XX_USB_END_OF_INTR_REG, 0); |
383 | 375 | ||
384 | /* Poll for ID change */ | 376 | /* Poll for ID change */ |
385 | if (is_otg_enabled(musb) && musb->xceiv->state == OTG_STATE_B_IDLE) | 377 | if (musb->xceiv->state == OTG_STATE_B_IDLE) |
386 | mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); | 378 | mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); |
387 | 379 | ||
388 | spin_unlock_irqrestore(&musb->lock, flags); | 380 | spin_unlock_irqrestore(&musb->lock, flags); |
@@ -430,8 +422,7 @@ static int da8xx_musb_init(struct musb *musb) | |||
430 | if (IS_ERR_OR_NULL(musb->xceiv)) | 422 | if (IS_ERR_OR_NULL(musb->xceiv)) |
431 | goto fail; | 423 | goto fail; |
432 | 424 | ||
433 | if (is_host_enabled(musb)) | 425 | setup_timer(&otg_workaround, otg_timer, (unsigned long)musb); |
434 | setup_timer(&otg_workaround, otg_timer, (unsigned long)musb); | ||
435 | 426 | ||
436 | /* Reset the controller */ | 427 | /* Reset the controller */ |
437 | musb_writel(reg_base, DA8XX_USB_CTRL_REG, DA8XX_SOFT_RESET_MASK); | 428 | musb_writel(reg_base, DA8XX_USB_CTRL_REG, DA8XX_SOFT_RESET_MASK); |
@@ -454,8 +445,7 @@ fail: | |||
454 | 445 | ||
455 | static int da8xx_musb_exit(struct musb *musb) | 446 | static int da8xx_musb_exit(struct musb *musb) |
456 | { | 447 | { |
457 | if (is_host_enabled(musb)) | 448 | del_timer_sync(&otg_workaround); |
458 | del_timer_sync(&otg_workaround); | ||
459 | 449 | ||
460 | phy_off(); | 450 | phy_off(); |
461 | 451 | ||