aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-08-30 15:47:11 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:57 -0400
commit02c399ee45a54987c152fe5f627ed949bb55f187 (patch)
treeb4af9b47729985739815f62a2388e4afa2b49e03 /drivers/usb
parent01d883d44a1ca8dc77486635d428cba63e7fdadf (diff)
usbcore: remove usb_suspend_root_hub
This patch (as740) removes the existing support for autosuspend of root hubs. That support fit in rather awkwardly with the rest of usbcore and it was used only by ohci-hcd. It won't be needed any more since the hub driver will take care of autosuspending all hubs, root or external. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hcd.c44
-rw-r--r--drivers/usb/core/hcd.h6
-rw-r--r--drivers/usb/core/hub.c18
-rw-r--r--drivers/usb/core/usb.h1
-rw-r--r--drivers/usb/host/ohci-hub.c3
5 files changed, 1 insertions, 71 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 9dfc812de034..e86f62957085 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1431,50 +1431,6 @@ int hcd_bus_resume (struct usb_bus *bus)
1431 return status; 1431 return status;
1432} 1432}
1433 1433
1434/*
1435 * usb_hcd_suspend_root_hub - HCD autosuspends downstream ports
1436 * @hcd: host controller for this root hub
1437 *
1438 * This call arranges that usb_hcd_resume_root_hub() is safe to call later;
1439 * that the HCD's root hub polling is deactivated; and that the root's hub
1440 * driver is suspended. HCDs may call this to autosuspend when their root
1441 * hub's downstream ports are all inactive: unpowered, disconnected,
1442 * disabled, or suspended.
1443 *
1444 * The HCD will autoresume on device connect change detection (using SRP
1445 * or a D+/D- pullup). The HCD also autoresumes on remote wakeup signaling
1446 * from any ports that are suspended (if that is enabled). In most cases,
1447 * overcurrent signaling (on powered ports) will also start autoresume.
1448 *
1449 * Always called with IRQs blocked.
1450 */
1451void usb_hcd_suspend_root_hub (struct usb_hcd *hcd)
1452{
1453 struct urb *urb;
1454
1455 spin_lock (&hcd_root_hub_lock);
1456 usb_suspend_root_hub (hcd->self.root_hub);
1457
1458 /* force status urb to complete/unlink while suspended */
1459 if (hcd->status_urb) {
1460 urb = hcd->status_urb;
1461 urb->status = -ECONNRESET;
1462 urb->hcpriv = NULL;
1463 urb->actual_length = 0;
1464
1465 del_timer (&hcd->rh_timer);
1466 hcd->poll_pending = 0;
1467 hcd->status_urb = NULL;
1468 } else
1469 urb = NULL;
1470 spin_unlock (&hcd_root_hub_lock);
1471 hcd->state = HC_STATE_SUSPENDED;
1472
1473 if (urb)
1474 usb_hcd_giveback_urb (hcd, urb, NULL);
1475}
1476EXPORT_SYMBOL_GPL(usb_hcd_suspend_root_hub);
1477
1478/** 1434/**
1479 * usb_hcd_resume_root_hub - called by HCD to resume its root hub 1435 * usb_hcd_resume_root_hub - called by HCD to resume its root hub
1480 * @hcd: host controller for this root hub 1436 * @hcd: host controller for this root hub
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 7a2bcba2ae61..676877c15f81 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -368,17 +368,11 @@ extern int usb_find_interface_driver (struct usb_device *dev,
368#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN)) 368#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
369 369
370#ifdef CONFIG_PM 370#ifdef CONFIG_PM
371extern void usb_hcd_suspend_root_hub (struct usb_hcd *hcd);
372extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd); 371extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd);
373extern void usb_root_hub_lost_power (struct usb_device *rhdev); 372extern void usb_root_hub_lost_power (struct usb_device *rhdev);
374extern int hcd_bus_suspend (struct usb_bus *bus); 373extern int hcd_bus_suspend (struct usb_bus *bus);
375extern int hcd_bus_resume (struct usb_bus *bus); 374extern int hcd_bus_resume (struct usb_bus *bus);
376#else 375#else
377static inline void usb_hcd_suspend_root_hub(struct usb_hcd *hcd)
378{
379 return;
380}
381
382static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) 376static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
383{ 377{
384 return; 378 return;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index dee812bc6c43..7479bd329abb 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -452,18 +452,14 @@ static void hub_power_on(struct usb_hub *hub)
452 msleep(max(pgood_delay, (unsigned) 100)); 452 msleep(max(pgood_delay, (unsigned) 100));
453} 453}
454 454
455static inline void __hub_quiesce(struct usb_hub *hub) 455static void hub_quiesce(struct usb_hub *hub)
456{ 456{
457 /* (nonblocking) khubd and related activity won't re-trigger */ 457 /* (nonblocking) khubd and related activity won't re-trigger */
458 hub->quiescing = 1; 458 hub->quiescing = 1;
459 hub->activating = 0; 459 hub->activating = 0;
460 hub->resume_root_hub = 0; 460 hub->resume_root_hub = 0;
461}
462 461
463static void hub_quiesce(struct usb_hub *hub)
464{
465 /* (blocking) stop khubd and related activity */ 462 /* (blocking) stop khubd and related activity */
466 __hub_quiesce(hub);
467 usb_kill_urb(hub->urb); 463 usb_kill_urb(hub->urb);
468 if (hub->has_indicators) 464 if (hub->has_indicators)
469 cancel_delayed_work(&hub->leds); 465 cancel_delayed_work(&hub->leds);
@@ -1914,18 +1910,6 @@ static inline int remote_wakeup(struct usb_device *udev)
1914#define hub_resume NULL 1910#define hub_resume NULL
1915#endif 1911#endif
1916 1912
1917void usb_suspend_root_hub(struct usb_device *hdev)
1918{
1919 struct usb_hub *hub = hdev_to_hub(hdev);
1920
1921 /* This also makes any led blinker stop retriggering. We're called
1922 * from irq, so the blinker might still be scheduled. Caller promises
1923 * that the root hub status URB will be canceled.
1924 */
1925 __hub_quiesce(hub);
1926 mark_quiesced(to_usb_interface(hub->intfdev));
1927}
1928
1929void usb_resume_root_hub(struct usb_device *hdev) 1913void usb_resume_root_hub(struct usb_device *hdev)
1930{ 1914{
1931 struct usb_hub *hub = hdev_to_hub(hdev); 1915 struct usb_hub *hub = hdev_to_hub(hdev);
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 10688ad73c6d..e8bc2e48913a 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -20,7 +20,6 @@ extern char *usb_cache_string(struct usb_device *udev, int index);
20extern int usb_set_configuration(struct usb_device *dev, int configuration); 20extern int usb_set_configuration(struct usb_device *dev, int configuration);
21 21
22extern void usb_kick_khubd(struct usb_device *dev); 22extern void usb_kick_khubd(struct usb_device *dev);
23extern void usb_suspend_root_hub(struct usb_device *hdev);
24extern void usb_resume_root_hub(struct usb_device *dev); 23extern void usb_resume_root_hub(struct usb_device *dev);
25 24
26extern int usb_hub_init(void); 25extern int usb_hub_init(void);
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index f1b1ed086bde..0b899339cac8 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -135,9 +135,6 @@ static int ohci_bus_suspend (struct usb_hcd *hcd)
135 hcd->poll_rh = 0; 135 hcd->poll_rh = 0;
136 136
137done: 137done:
138 /* external suspend vs self autosuspend ... same effect */
139 if (status == 0)
140 usb_hcd_suspend_root_hub(hcd);
141 spin_unlock_irqrestore (&ohci->lock, flags); 138 spin_unlock_irqrestore (&ohci->lock, flags);
142 return status; 139 return status;
143} 140}