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/blackfin.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/blackfin.c')
-rw-r--r-- | drivers/usb/musb/blackfin.c | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 428e6aa3e78a..54f1b98b74de 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -184,8 +184,8 @@ static irqreturn_t blackfin_interrupt(int irq, void *__hci) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | /* Start sampling ID pin, when plug is removed from MUSB */ | 186 | /* Start sampling ID pin, when plug is removed from MUSB */ |
187 | if ((is_otg_enabled(musb) && (musb->xceiv->state == OTG_STATE_B_IDLE | 187 | if ((musb->xceiv->state == OTG_STATE_B_IDLE |
188 | || musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) || | 188 | || musb->xceiv->state == OTG_STATE_A_WAIT_BCON) || |
189 | (musb->int_usb & MUSB_INTR_DISCONNECT && is_host_active(musb))) { | 189 | (musb->int_usb & MUSB_INTR_DISCONNECT && is_host_active(musb))) { |
190 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); | 190 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); |
191 | musb->a_wait_bcon = TIMER_DELAY; | 191 | musb->a_wait_bcon = TIMER_DELAY; |
@@ -228,18 +228,13 @@ static void musb_conn_timer_handler(unsigned long _musb) | |||
228 | 228 | ||
229 | val = MUSB_INTR_SUSPEND | MUSB_INTR_VBUSERROR; | 229 | val = MUSB_INTR_SUSPEND | MUSB_INTR_VBUSERROR; |
230 | musb_writeb(musb->mregs, MUSB_INTRUSB, val); | 230 | musb_writeb(musb->mregs, MUSB_INTRUSB, val); |
231 | if (is_otg_enabled(musb)) | 231 | musb->xceiv->state = OTG_STATE_B_IDLE; |
232 | musb->xceiv->state = OTG_STATE_B_IDLE; | ||
233 | else | ||
234 | musb_writeb(musb->mregs, MUSB_POWER, MUSB_POWER_HSENAB); | ||
235 | } | 232 | } |
236 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); | 233 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); |
237 | break; | 234 | break; |
238 | case OTG_STATE_B_IDLE: | 235 | case OTG_STATE_B_IDLE: |
239 | 236 | /* | |
240 | if (!is_peripheral_enabled(musb)) | 237 | * Start a new session. It seems that MUSB needs taking |
241 | break; | ||
242 | /* Start a new session. It seems that MUSB needs taking | ||
243 | * some time to recognize the type of the plug inserted? | 238 | * some time to recognize the type of the plug inserted? |
244 | */ | 239 | */ |
245 | val = musb_readw(musb->mregs, MUSB_DEVCTL); | 240 | val = musb_readw(musb->mregs, MUSB_DEVCTL); |
@@ -295,10 +290,7 @@ static void musb_conn_timer_handler(unsigned long _musb) | |||
295 | 290 | ||
296 | static void bfin_musb_enable(struct musb *musb) | 291 | static void bfin_musb_enable(struct musb *musb) |
297 | { | 292 | { |
298 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) { | 293 | /* REVISIT is this really correct ? */ |
299 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); | ||
300 | musb->a_wait_bcon = TIMER_DELAY; | ||
301 | } | ||
302 | } | 294 | } |
303 | 295 | ||
304 | static void bfin_musb_disable(struct musb *musb) | 296 | static void bfin_musb_disable(struct musb *musb) |
@@ -323,12 +315,6 @@ static int bfin_musb_set_power(struct usb_phy *x, unsigned mA) | |||
323 | return 0; | 315 | return 0; |
324 | } | 316 | } |
325 | 317 | ||
326 | static void bfin_musb_try_idle(struct musb *musb, unsigned long timeout) | ||
327 | { | ||
328 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) | ||
329 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); | ||
330 | } | ||
331 | |||
332 | static int bfin_musb_vbus_status(struct musb *musb) | 318 | static int bfin_musb_vbus_status(struct musb *musb) |
333 | { | 319 | { |
334 | return 0; | 320 | return 0; |
@@ -424,12 +410,10 @@ static int bfin_musb_init(struct musb *musb) | |||
424 | 410 | ||
425 | bfin_musb_reg_init(musb); | 411 | bfin_musb_reg_init(musb); |
426 | 412 | ||
427 | if (is_host_enabled(musb)) { | 413 | setup_timer(&musb_conn_timer, musb_conn_timer_handler, |
428 | setup_timer(&musb_conn_timer, | 414 | (unsigned long) musb); |
429 | musb_conn_timer_handler, (unsigned long) musb); | 415 | |
430 | } | 416 | musb->xceiv->set_power = bfin_musb_set_power; |
431 | if (is_peripheral_enabled(musb)) | ||
432 | musb->xceiv->set_power = bfin_musb_set_power; | ||
433 | 417 | ||
434 | musb->isr = blackfin_interrupt; | 418 | musb->isr = blackfin_interrupt; |
435 | musb->double_buffer_not_ok = true; | 419 | musb->double_buffer_not_ok = true; |
@@ -454,7 +438,6 @@ static const struct musb_platform_ops bfin_ops = { | |||
454 | .disable = bfin_musb_disable, | 438 | .disable = bfin_musb_disable, |
455 | 439 | ||
456 | .set_mode = bfin_musb_set_mode, | 440 | .set_mode = bfin_musb_set_mode, |
457 | .try_idle = bfin_musb_try_idle, | ||
458 | 441 | ||
459 | .vbus_status = bfin_musb_vbus_status, | 442 | .vbus_status = bfin_musb_vbus_status, |
460 | .set_vbus = bfin_musb_set_vbus, | 443 | .set_vbus = bfin_musb_set_vbus, |