aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/omap2430.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/omap2430.c')
-rw-r--r--drivers/usb/musb/omap2430.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index df719eae3b03..2ae0bb309994 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -132,6 +132,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
132 132
133static void omap2430_musb_set_vbus(struct musb *musb, int is_on) 133static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
134{ 134{
135 struct usb_otg *otg = musb->xceiv->otg;
135 u8 devctl; 136 u8 devctl;
136 unsigned long timeout = jiffies + msecs_to_jiffies(1000); 137 unsigned long timeout = jiffies + msecs_to_jiffies(1000);
137 int ret = 1; 138 int ret = 1;
@@ -163,11 +164,11 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
163 } 164 }
164 } 165 }
165 166
166 if (ret && musb->xceiv->set_vbus) 167 if (ret && otg->set_vbus)
167 otg_set_vbus(musb->xceiv, 1); 168 otg_set_vbus(otg, 1);
168 } else { 169 } else {
169 musb->is_active = 1; 170 musb->is_active = 1;
170 musb->xceiv->default_a = 1; 171 otg->default_a = 1;
171 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 172 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
172 devctl |= MUSB_DEVCTL_SESSION; 173 devctl |= MUSB_DEVCTL_SESSION;
173 MUSB_HST_MODE(musb); 174 MUSB_HST_MODE(musb);
@@ -179,7 +180,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
179 * jumping right to B_IDLE... 180 * jumping right to B_IDLE...
180 */ 181 */
181 182
182 musb->xceiv->default_a = 0; 183 otg->default_a = 0;
183 musb->xceiv->state = OTG_STATE_B_IDLE; 184 musb->xceiv->state = OTG_STATE_B_IDLE;
184 devctl &= ~MUSB_DEVCTL_SESSION; 185 devctl &= ~MUSB_DEVCTL_SESSION;
185 186
@@ -246,7 +247,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
246 247
247 if (!is_otg_enabled(musb) || musb->gadget_driver) { 248 if (!is_otg_enabled(musb) || musb->gadget_driver) {
248 pm_runtime_get_sync(musb->controller); 249 pm_runtime_get_sync(musb->controller);
249 otg_init(musb->xceiv); 250 usb_phy_init(musb->xceiv);
250 omap2430_musb_set_vbus(musb, 1); 251 omap2430_musb_set_vbus(musb, 1);
251 } 252 }
252 break; 253 break;
@@ -256,7 +257,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
256 257
257 if (musb->gadget_driver) 258 if (musb->gadget_driver)
258 pm_runtime_get_sync(musb->controller); 259 pm_runtime_get_sync(musb->controller);
259 otg_init(musb->xceiv); 260 usb_phy_init(musb->xceiv);
260 break; 261 break;
261 262
262 case USB_EVENT_NONE: 263 case USB_EVENT_NONE:
@@ -269,10 +270,10 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
269 } 270 }
270 271
271 if (data->interface_type == MUSB_INTERFACE_UTMI) { 272 if (data->interface_type == MUSB_INTERFACE_UTMI) {
272 if (musb->xceiv->set_vbus) 273 if (musb->xceiv->otg->set_vbus)
273 otg_set_vbus(musb->xceiv, 0); 274 otg_set_vbus(musb->xceiv->otg, 0);
274 } 275 }
275 otg_shutdown(musb->xceiv); 276 usb_phy_shutdown(musb->xceiv);
276 break; 277 break;
277 default: 278 default:
278 dev_dbg(musb->controller, "ID float\n"); 279 dev_dbg(musb->controller, "ID float\n");
@@ -290,7 +291,7 @@ static int omap2430_musb_init(struct musb *musb)
290 * up through ULPI. TWL4030-family PMICs include one, 291 * up through ULPI. TWL4030-family PMICs include one,
291 * which needs a driver, drivers aren't always needed. 292 * which needs a driver, drivers aren't always needed.
292 */ 293 */
293 musb->xceiv = otg_get_transceiver(); 294 musb->xceiv = usb_get_transceiver();
294 if (!musb->xceiv) { 295 if (!musb->xceiv) {
295 pr_err("HS USB OTG: no transceiver configured\n"); 296 pr_err("HS USB OTG: no transceiver configured\n");
296 return -ENODEV; 297 return -ENODEV;
@@ -325,7 +326,7 @@ static int omap2430_musb_init(struct musb *musb)
325 musb_readl(musb->mregs, OTG_SIMENABLE)); 326 musb_readl(musb->mregs, OTG_SIMENABLE));
326 327
327 musb->nb.notifier_call = musb_otg_notifications; 328 musb->nb.notifier_call = musb_otg_notifications;
328 status = otg_register_notifier(musb->xceiv, &musb->nb); 329 status = usb_register_notifier(musb->xceiv, &musb->nb);
329 330
330 if (status) 331 if (status)
331 dev_dbg(musb->controller, "notification register failed\n"); 332 dev_dbg(musb->controller, "notification register failed\n");
@@ -349,7 +350,7 @@ static void omap2430_musb_enable(struct musb *musb)
349 switch (musb->xceiv->last_event) { 350 switch (musb->xceiv->last_event) {
350 351
351 case USB_EVENT_ID: 352 case USB_EVENT_ID:
352 otg_init(musb->xceiv); 353 usb_phy_init(musb->xceiv);
353 if (data->interface_type != MUSB_INTERFACE_UTMI) 354 if (data->interface_type != MUSB_INTERFACE_UTMI)
354 break; 355 break;
355 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); 356 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
@@ -368,7 +369,7 @@ static void omap2430_musb_enable(struct musb *musb)
368 break; 369 break;
369 370
370 case USB_EVENT_VBUS: 371 case USB_EVENT_VBUS:
371 otg_init(musb->xceiv); 372 usb_phy_init(musb->xceiv);
372 break; 373 break;
373 374
374 default: 375 default:
@@ -379,7 +380,7 @@ static void omap2430_musb_enable(struct musb *musb)
379static void omap2430_musb_disable(struct musb *musb) 380static void omap2430_musb_disable(struct musb *musb)
380{ 381{
381 if (musb->xceiv->last_event) 382 if (musb->xceiv->last_event)
382 otg_shutdown(musb->xceiv); 383 usb_phy_shutdown(musb->xceiv);
383} 384}
384 385
385static int omap2430_musb_exit(struct musb *musb) 386static int omap2430_musb_exit(struct musb *musb)
@@ -388,7 +389,7 @@ static int omap2430_musb_exit(struct musb *musb)
388 cancel_work_sync(&musb->otg_notifier_work); 389 cancel_work_sync(&musb->otg_notifier_work);
389 390
390 omap2430_low_level_exit(musb); 391 omap2430_low_level_exit(musb);
391 otg_put_transceiver(musb->xceiv); 392 usb_put_transceiver(musb->xceiv);
392 393
393 return 0; 394 return 0;
394} 395}
@@ -408,7 +409,7 @@ static const struct musb_platform_ops omap2430_ops = {
408 409
409static u64 omap2430_dmamask = DMA_BIT_MASK(32); 410static u64 omap2430_dmamask = DMA_BIT_MASK(32);
410 411
411static int __init omap2430_probe(struct platform_device *pdev) 412static int __devinit omap2430_probe(struct platform_device *pdev)
412{ 413{
413 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 414 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
414 struct platform_device *musb; 415 struct platform_device *musb;
@@ -471,7 +472,7 @@ err0:
471 return ret; 472 return ret;
472} 473}
473 474
474static int __exit omap2430_remove(struct platform_device *pdev) 475static int __devexit omap2430_remove(struct platform_device *pdev)
475{ 476{
476 struct omap2430_glue *glue = platform_get_drvdata(pdev); 477 struct omap2430_glue *glue = platform_get_drvdata(pdev);
477 478
@@ -494,7 +495,7 @@ static int omap2430_runtime_suspend(struct device *dev)
494 OTG_INTERFSEL); 495 OTG_INTERFSEL);
495 496
496 omap2430_low_level_exit(musb); 497 omap2430_low_level_exit(musb);
497 otg_set_suspend(musb->xceiv, 1); 498 usb_phy_set_suspend(musb->xceiv, 1);
498 499
499 return 0; 500 return 0;
500} 501}
@@ -508,7 +509,7 @@ static int omap2430_runtime_resume(struct device *dev)
508 musb_writel(musb->mregs, OTG_INTERFSEL, 509 musb_writel(musb->mregs, OTG_INTERFSEL,
509 musb->context.otg_interfsel); 510 musb->context.otg_interfsel);
510 511
511 otg_set_suspend(musb->xceiv, 0); 512 usb_phy_set_suspend(musb->xceiv, 0);
512 513
513 return 0; 514 return 0;
514} 515}
@@ -524,7 +525,8 @@ static struct dev_pm_ops omap2430_pm_ops = {
524#endif 525#endif
525 526
526static struct platform_driver omap2430_driver = { 527static struct platform_driver omap2430_driver = {
527 .remove = __exit_p(omap2430_remove), 528 .probe = omap2430_probe,
529 .remove = __devexit_p(omap2430_remove),
528 .driver = { 530 .driver = {
529 .name = "musb-omap2430", 531 .name = "musb-omap2430",
530 .pm = DEV_PM_OPS, 532 .pm = DEV_PM_OPS,
@@ -537,9 +539,9 @@ MODULE_LICENSE("GPL v2");
537 539
538static int __init omap2430_init(void) 540static int __init omap2430_init(void)
539{ 541{
540 return platform_driver_probe(&omap2430_driver, omap2430_probe); 542 return platform_driver_register(&omap2430_driver);
541} 543}
542subsys_initcall(omap2430_init); 544module_init(omap2430_init);
543 545
544static void __exit omap2430_exit(void) 546static void __exit omap2430_exit(void)
545{ 547{