aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/dummy_hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-05-03 16:27:26 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:52 -0400
commit685eb93f086eb15d9fb1e82c7400fd750f564640 (patch)
treeded0db2402889ec30878c3dbbd08f7b5d01a694b /drivers/usb/gadget/dummy_hcd.c
parentf1c39fad7d1bbea31744138cd3a532ff346cd4ab (diff)
[PATCH] USB dummy_hcd: Use root-hub interrupts instead of polling
This patch makes the dummy_hcd driver use emulated root-hub interrupts instead of polling. It's in the spirit of similar changes being made to the other HCDs. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/dummy_hcd.c')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 2d6d22951326..73d2f24050ab 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -684,6 +684,7 @@ static int dummy_wakeup (struct usb_gadget *_gadget)
684 /* hub notices our request, issues downstream resume, etc */ 684 /* hub notices our request, issues downstream resume, etc */
685 dum->resuming = 1; 685 dum->resuming = 1;
686 dum->re_timeout = jiffies + msecs_to_jiffies(20); 686 dum->re_timeout = jiffies + msecs_to_jiffies(20);
687 mod_timer (&dummy_to_hcd (dum)->rh_timer, dum->re_timeout);
687 return 0; 688 return 0;
688} 689}
689 690
@@ -709,6 +710,8 @@ static int dummy_pullup (struct usb_gadget *_gadget, int value)
709 dum->pullup = (value != 0); 710 dum->pullup = (value != 0);
710 set_link_state (dum); 711 set_link_state (dum);
711 spin_unlock_irqrestore (&dum->lock, flags); 712 spin_unlock_irqrestore (&dum->lock, flags);
713
714 usb_hcd_poll_rh_status (dummy_to_hcd (dum));
712 return 0; 715 return 0;
713} 716}
714 717
@@ -811,6 +814,8 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
811 dum->pullup = 1; 814 dum->pullup = 1;
812 set_link_state (dum); 815 set_link_state (dum);
813 spin_unlock_irq (&dum->lock); 816 spin_unlock_irq (&dum->lock);
817
818 usb_hcd_poll_rh_status (dummy_to_hcd (dum));
814 return 0; 819 return 0;
815} 820}
816EXPORT_SYMBOL (usb_gadget_register_driver); 821EXPORT_SYMBOL (usb_gadget_register_driver);
@@ -845,6 +850,7 @@ usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
845 set_link_state (dum); 850 set_link_state (dum);
846 spin_unlock_irqrestore (&dum->lock, flags); 851 spin_unlock_irqrestore (&dum->lock, flags);
847 852
853 usb_hcd_poll_rh_status (dummy_to_hcd (dum));
848 return 0; 854 return 0;
849} 855}
850EXPORT_SYMBOL (usb_gadget_unregister_driver); 856EXPORT_SYMBOL (usb_gadget_unregister_driver);
@@ -1669,6 +1675,9 @@ static int dummy_hub_control (
1669 retval = -EPIPE; 1675 retval = -EPIPE;
1670 } 1676 }
1671 spin_unlock_irqrestore (&dum->lock, flags); 1677 spin_unlock_irqrestore (&dum->lock, flags);
1678
1679 if ((dum->port_status & PORT_C_MASK) != 0)
1680 usb_hcd_poll_rh_status (hcd);
1672 return retval; 1681 return retval;
1673} 1682}
1674 1683
@@ -1745,6 +1754,7 @@ static int dummy_start (struct usb_hcd *hcd)
1745 /* only show a low-power port: just 8mA */ 1754 /* only show a low-power port: just 8mA */
1746 hcd->power_budget = 8; 1755 hcd->power_budget = 8;
1747 hcd->state = HC_STATE_RUNNING; 1756 hcd->state = HC_STATE_RUNNING;
1757 hcd->uses_new_polling = 1;
1748 1758
1749#ifdef CONFIG_USB_OTG 1759#ifdef CONFIG_USB_OTG
1750 hcd->self.otg_port = 1; 1760 hcd->self.otg_port = 1;