aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/am35x.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/am35x.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/am35x.c')
-rw-r--r--drivers/usb/musb/am35x.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 7a95ab87ac00..9fbe73688037 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -107,9 +107,8 @@ static void am35x_musb_enable(struct musb *musb)
107 musb_writel(reg_base, CORE_INTR_MASK_SET_REG, AM35X_INTR_USB_MASK); 107 musb_writel(reg_base, CORE_INTR_MASK_SET_REG, AM35X_INTR_USB_MASK);
108 108
109 /* Force the DRVVBUS IRQ so we can start polling for ID change. */ 109 /* Force the DRVVBUS IRQ so we can start polling for ID change. */
110 if (is_otg_enabled(musb)) 110 musb_writel(reg_base, CORE_INTR_SRC_SET_REG,
111 musb_writel(reg_base, CORE_INTR_SRC_SET_REG, 111 AM35X_INTR_DRVVBUS << AM35X_INTR_USB_SHIFT);
112 AM35X_INTR_DRVVBUS << AM35X_INTR_USB_SHIFT);
113} 112}
114 113
115/* 114/*
@@ -173,9 +172,6 @@ static void otg_timer(unsigned long _musb)
173 MUSB_INTR_VBUSERROR << AM35X_INTR_USB_SHIFT); 172 MUSB_INTR_VBUSERROR << AM35X_INTR_USB_SHIFT);
174 break; 173 break;
175 case OTG_STATE_B_IDLE: 174 case OTG_STATE_B_IDLE:
176 if (!is_peripheral_enabled(musb))
177 break;
178
179 devctl = musb_readb(mregs, MUSB_DEVCTL); 175 devctl = musb_readb(mregs, MUSB_DEVCTL);
180 if (devctl & MUSB_DEVCTL_BDEVICE) 176 if (devctl & MUSB_DEVCTL_BDEVICE)
181 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 177 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
@@ -192,9 +188,6 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout)
192{ 188{
193 static unsigned long last_timer; 189 static unsigned long last_timer;
194 190
195 if (!is_otg_enabled(musb))
196 return;
197
198 if (timeout == 0) 191 if (timeout == 0)
199 timeout = jiffies + msecs_to_jiffies(3); 192 timeout = jiffies + msecs_to_jiffies(3);
200 193
@@ -271,8 +264,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
271 u8 devctl = musb_readb(mregs, MUSB_DEVCTL); 264 u8 devctl = musb_readb(mregs, MUSB_DEVCTL);
272 int err; 265 int err;
273 266
274 err = is_host_enabled(musb) && (musb->int_usb & 267 err = musb->int_usb & MUSB_INTR_VBUSERROR;
275 MUSB_INTR_VBUSERROR);
276 if (err) { 268 if (err) {
277 /* 269 /*
278 * The Mentor core doesn't debounce VBUS as needed 270 * The Mentor core doesn't debounce VBUS as needed
@@ -289,7 +281,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
289 musb->xceiv->state = OTG_STATE_A_WAIT_VFALL; 281 musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
290 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 282 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
291 WARNING("VBUS error workaround (delay coming)\n"); 283 WARNING("VBUS error workaround (delay coming)\n");
292 } else if (is_host_enabled(musb) && drvvbus) { 284 } else if (drvvbus) {
293 MUSB_HST_MODE(musb); 285 MUSB_HST_MODE(musb);
294 otg->default_a = 1; 286 otg->default_a = 1;
295 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 287 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
@@ -326,7 +318,7 @@ eoi:
326 } 318 }
327 319
328 /* Poll for ID change */ 320 /* Poll for ID change */
329 if (is_otg_enabled(musb) && musb->xceiv->state == OTG_STATE_B_IDLE) 321 if (musb->xceiv->state == OTG_STATE_B_IDLE)
330 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 322 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
331 323
332 spin_unlock_irqrestore(&musb->lock, flags); 324 spin_unlock_irqrestore(&musb->lock, flags);
@@ -369,8 +361,7 @@ static int am35x_musb_init(struct musb *musb)
369 if (IS_ERR_OR_NULL(musb->xceiv)) 361 if (IS_ERR_OR_NULL(musb->xceiv))
370 return -ENODEV; 362 return -ENODEV;
371 363
372 if (is_host_enabled(musb)) 364 setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
373 setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
374 365
375 /* Reset the musb */ 366 /* Reset the musb */
376 if (data->reset) 367 if (data->reset)
@@ -400,8 +391,7 @@ static int am35x_musb_exit(struct musb *musb)
400 struct musb_hdrc_platform_data *plat = dev->platform_data; 391 struct musb_hdrc_platform_data *plat = dev->platform_data;
401 struct omap_musb_board_data *data = plat->board_data; 392 struct omap_musb_board_data *data = plat->board_data;
402 393
403 if (is_host_enabled(musb)) 394 del_timer_sync(&otg_workaround);
404 del_timer_sync(&otg_workaround);
405 395
406 /* Shutdown the on-chip PHY and its PLL. */ 396 /* Shutdown the on-chip PHY and its PLL. */
407 if (data->set_phy_power) 397 if (data->set_phy_power)