aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2013-09-27 02:23:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-27 20:36:58 -0400
commitf1ddc24c9e33813f74b871d73e4d795dcdb95a3c (patch)
treecc08d7b2d95bee47effe9b199d02eb6d78485b2f /drivers/phy
parent3e3101d57c50f9e4fa1da947e4bd0bc5cbab4141 (diff)
usb: phy: twl4030-usb: remove *set_suspend* and *phy_init* ops
Now that twl4030-usb is adapted to the new generic PHY framework, *set_suspend* and *phy_init* ops can be removed from twl4030-usb driver. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-twl4030-usb.c57
1 files changed, 13 insertions, 44 deletions
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index d02913f9a6b1..e0212d80c75c 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -422,25 +422,20 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
422 } 422 }
423} 423}
424 424
425static void twl4030_phy_suspend(struct twl4030_usb *twl, int controller_off) 425static int twl4030_phy_power_off(struct phy *phy)
426{ 426{
427 struct twl4030_usb *twl = phy_get_drvdata(phy);
428
427 if (twl->asleep) 429 if (twl->asleep)
428 return; 430 return 0;
429 431
430 twl4030_phy_power(twl, 0); 432 twl4030_phy_power(twl, 0);
431 twl->asleep = 1; 433 twl->asleep = 1;
432 dev_dbg(twl->dev, "%s\n", __func__); 434 dev_dbg(twl->dev, "%s\n", __func__);
433}
434
435static int twl4030_phy_power_off(struct phy *phy)
436{
437 struct twl4030_usb *twl = phy_get_drvdata(phy);
438
439 twl4030_phy_suspend(twl, 0);
440 return 0; 435 return 0;
441} 436}
442 437
443static void __twl4030_phy_resume(struct twl4030_usb *twl) 438static void __twl4030_phy_power_on(struct twl4030_usb *twl)
444{ 439{
445 twl4030_phy_power(twl, 1); 440 twl4030_phy_power(twl, 1);
446 twl4030_i2c_access(twl, 1); 441 twl4030_i2c_access(twl, 1);
@@ -449,11 +444,13 @@ static void __twl4030_phy_resume(struct twl4030_usb *twl)
449 twl4030_i2c_access(twl, 0); 444 twl4030_i2c_access(twl, 0);
450} 445}
451 446
452static void twl4030_phy_resume(struct twl4030_usb *twl) 447static int twl4030_phy_power_on(struct phy *phy)
453{ 448{
449 struct twl4030_usb *twl = phy_get_drvdata(phy);
450
454 if (!twl->asleep) 451 if (!twl->asleep)
455 return; 452 return 0;
456 __twl4030_phy_resume(twl); 453 __twl4030_phy_power_on(twl);
457 twl->asleep = 0; 454 twl->asleep = 0;
458 dev_dbg(twl->dev, "%s\n", __func__); 455 dev_dbg(twl->dev, "%s\n", __func__);
459 456
@@ -466,13 +463,6 @@ static void twl4030_phy_resume(struct twl4030_usb *twl)
466 cancel_delayed_work(&twl->id_workaround_work); 463 cancel_delayed_work(&twl->id_workaround_work);
467 schedule_delayed_work(&twl->id_workaround_work, HZ); 464 schedule_delayed_work(&twl->id_workaround_work, HZ);
468 } 465 }
469}
470
471static int twl4030_phy_power_on(struct phy *phy)
472{
473 struct twl4030_usb *twl = phy_get_drvdata(phy);
474
475 twl4030_phy_resume(twl);
476 return 0; 466 return 0;
477} 467}
478 468
@@ -604,9 +594,9 @@ static void twl4030_id_workaround_work(struct work_struct *work)
604 } 594 }
605} 595}
606 596
607static int twl4030_usb_phy_init(struct usb_phy *phy) 597static int twl4030_phy_init(struct phy *phy)
608{ 598{
609 struct twl4030_usb *twl = phy_to_twl(phy); 599 struct twl4030_usb *twl = phy_get_drvdata(phy);
610 enum omap_musb_vbus_id_status status; 600 enum omap_musb_vbus_id_status status;
611 601
612 /* 602 /*
@@ -621,32 +611,13 @@ static int twl4030_usb_phy_init(struct usb_phy *phy)
621 611
622 if (status == OMAP_MUSB_ID_GROUND || status == OMAP_MUSB_VBUS_VALID) { 612 if (status == OMAP_MUSB_ID_GROUND || status == OMAP_MUSB_VBUS_VALID) {
623 omap_musb_mailbox(twl->linkstat); 613 omap_musb_mailbox(twl->linkstat);
624 twl4030_phy_resume(twl); 614 twl4030_phy_power_on(phy);
625 } 615 }
626 616
627 sysfs_notify(&twl->dev->kobj, NULL, "vbus"); 617 sysfs_notify(&twl->dev->kobj, NULL, "vbus");
628 return 0; 618 return 0;
629} 619}
630 620
631static int twl4030_phy_init(struct phy *phy)
632{
633 struct twl4030_usb *twl = phy_get_drvdata(phy);
634
635 return twl4030_usb_phy_init(&twl->phy);
636}
637
638static int twl4030_set_suspend(struct usb_phy *x, int suspend)
639{
640 struct twl4030_usb *twl = phy_to_twl(x);
641
642 if (suspend)
643 twl4030_phy_suspend(twl, 1);
644 else
645 twl4030_phy_resume(twl);
646
647 return 0;
648}
649
650static int twl4030_set_peripheral(struct usb_otg *otg, 621static int twl4030_set_peripheral(struct usb_otg *otg,
651 struct usb_gadget *gadget) 622 struct usb_gadget *gadget)
652{ 623{
@@ -719,8 +690,6 @@ static int twl4030_usb_probe(struct platform_device *pdev)
719 twl->phy.label = "twl4030"; 690 twl->phy.label = "twl4030";
720 twl->phy.otg = otg; 691 twl->phy.otg = otg;
721 twl->phy.type = USB_PHY_TYPE_USB2; 692 twl->phy.type = USB_PHY_TYPE_USB2;
722 twl->phy.set_suspend = twl4030_set_suspend;
723 twl->phy.init = twl4030_usb_phy_init;
724 693
725 otg->phy = &twl->phy; 694 otg->phy = &twl->phy;
726 otg->set_host = twl4030_set_host; 695 otg->set_host = twl4030_set_host;