diff options
author | Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> | 2013-04-03 04:45:12 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-04-03 05:02:58 -0400 |
commit | 8db12231bccc5ebf414b267af68c5a8c1e4432dd (patch) | |
tree | 1d84ecae5e7c4e13e6123b6acedbdcec32b58ecf | |
parent | 899f0f561b51506f40eb78c9c4aaeeabf97cf35c (diff) |
usb: phy: ab8500-usb: drop link status delayed work
ab8500_usb_delayed_work was implemented as a workaroud for the internal
only and now unsupported v1.0 version of AB850. This patch removes the
delayed work and just leave a link status update call at probe time.
Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/phy/phy-ab8500-usb.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 90a3278d2820..a1c103fc26ec 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c | |||
@@ -124,9 +124,7 @@ struct ab8500_usb { | |||
124 | struct device *dev; | 124 | struct device *dev; |
125 | struct ab8500 *ab8500; | 125 | struct ab8500 *ab8500; |
126 | unsigned vbus_draw; | 126 | unsigned vbus_draw; |
127 | struct delayed_work dwork; | ||
128 | struct work_struct phy_dis_work; | 127 | struct work_struct phy_dis_work; |
129 | unsigned long link_status_wait; | ||
130 | enum ab8500_usb_mode mode; | 128 | enum ab8500_usb_mode mode; |
131 | struct regulator *v_ape; | 129 | struct regulator *v_ape; |
132 | struct regulator *v_musb; | 130 | struct regulator *v_musb; |
@@ -556,14 +554,6 @@ static irqreturn_t ab8500_usb_link_status_irq(int irq, void *data) | |||
556 | return IRQ_HANDLED; | 554 | return IRQ_HANDLED; |
557 | } | 555 | } |
558 | 556 | ||
559 | static void ab8500_usb_delayed_work(struct work_struct *work) | ||
560 | { | ||
561 | struct ab8500_usb *ab = container_of(work, struct ab8500_usb, | ||
562 | dwork.work); | ||
563 | |||
564 | abx500_usb_link_status_update(ab); | ||
565 | } | ||
566 | |||
567 | static void ab8500_usb_phy_disable_work(struct work_struct *work) | 557 | static void ab8500_usb_phy_disable_work(struct work_struct *work) |
568 | { | 558 | { |
569 | struct ab8500_usb *ab = container_of(work, struct ab8500_usb, | 559 | struct ab8500_usb *ab = container_of(work, struct ab8500_usb, |
@@ -635,12 +625,6 @@ static int ab8500_usb_set_peripheral(struct usb_otg *otg, | |||
635 | } else { | 625 | } else { |
636 | otg->gadget = gadget; | 626 | otg->gadget = gadget; |
637 | otg->phy->state = OTG_STATE_B_IDLE; | 627 | otg->phy->state = OTG_STATE_B_IDLE; |
638 | |||
639 | /* Phy will not be enabled if cable is already | ||
640 | * plugged-in. Schedule to enable phy. | ||
641 | * Use same delay to avoid any race condition. | ||
642 | */ | ||
643 | schedule_delayed_work(&ab->dwork, ab->link_status_wait); | ||
644 | } | 628 | } |
645 | 629 | ||
646 | return 0; | 630 | return 0; |
@@ -665,11 +649,6 @@ static int ab8500_usb_set_host(struct usb_otg *otg, struct usb_bus *host) | |||
665 | schedule_work(&ab->phy_dis_work); | 649 | schedule_work(&ab->phy_dis_work); |
666 | } else { | 650 | } else { |
667 | otg->host = host; | 651 | otg->host = host; |
668 | /* Phy will not be enabled if cable is already | ||
669 | * plugged-in. Schedule to enable phy. | ||
670 | * Use same delay to avoid any race condition. | ||
671 | */ | ||
672 | schedule_delayed_work(&ab->dwork, ab->link_status_wait); | ||
673 | } | 652 | } |
674 | 653 | ||
675 | return 0; | 654 | return 0; |
@@ -792,11 +771,6 @@ static int ab8500_usb_probe(struct platform_device *pdev) | |||
792 | 771 | ||
793 | ATOMIC_INIT_NOTIFIER_HEAD(&ab->phy.notifier); | 772 | ATOMIC_INIT_NOTIFIER_HEAD(&ab->phy.notifier); |
794 | 773 | ||
795 | /* v1: Wait for link status to become stable. | ||
796 | * all: Updates form set_host and set_peripheral as they are atomic. | ||
797 | */ | ||
798 | INIT_DELAYED_WORK(&ab->dwork, ab8500_usb_delayed_work); | ||
799 | |||
800 | /* all: Disable phy when called from set_host and set_peripheral */ | 774 | /* all: Disable phy when called from set_host and set_peripheral */ |
801 | INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work); | 775 | INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work); |
802 | 776 | ||
@@ -893,6 +867,8 @@ static int ab8500_usb_probe(struct platform_device *pdev) | |||
893 | /* Needed to enable ID detection. */ | 867 | /* Needed to enable ID detection. */ |
894 | ab8500_usb_wd_workaround(ab); | 868 | ab8500_usb_wd_workaround(ab); |
895 | 869 | ||
870 | abx500_usb_link_status_update(ab); | ||
871 | |||
896 | dev_info(&pdev->dev, "revision 0x%2x driver initialized\n", rev); | 872 | dev_info(&pdev->dev, "revision 0x%2x driver initialized\n", rev); |
897 | 873 | ||
898 | return 0; | 874 | return 0; |
@@ -902,8 +878,6 @@ static int ab8500_usb_remove(struct platform_device *pdev) | |||
902 | { | 878 | { |
903 | struct ab8500_usb *ab = platform_get_drvdata(pdev); | 879 | struct ab8500_usb *ab = platform_get_drvdata(pdev); |
904 | 880 | ||
905 | cancel_delayed_work_sync(&ab->dwork); | ||
906 | |||
907 | cancel_work_sync(&ab->phy_dis_work); | 881 | cancel_work_sync(&ab->phy_dis_work); |
908 | 882 | ||
909 | usb_remove_phy(&ab->phy); | 883 | usb_remove_phy(&ab->phy); |