Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10766
b: refs/heads/master
c: 9293677
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent 94a6833 commit 44bcdcb
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ff71d6adf81a43505b7cbaa034e4063d3439182
refs/heads/master: 9293677af3dace2645dec0d0808efa02d36bf47b
42 changes: 27 additions & 15 deletions trunk/drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,28 +1431,44 @@ hcd_endpoint_disable (struct usb_device *udev, struct usb_host_endpoint *ep)

/*-------------------------------------------------------------------------*/

/* FIXME make this #ifdef CONFIG_PM ... update root hubs, retest */

#ifdef CONFIG_USB_SUSPEND
#ifdef CONFIG_PM

static int hcd_hub_suspend (struct usb_bus *bus)
{
struct usb_hcd *hcd;
int status;

hcd = container_of (bus, struct usb_hcd, self);
if (hcd->driver->hub_suspend)
return hcd->driver->hub_suspend (hcd);
return 0;
if (!hcd->driver->hub_suspend)
return -ENOENT;
hcd->state = HC_STATE_QUIESCING;
status = hcd->driver->hub_suspend (hcd);
if (status == 0)
hcd->state = HC_STATE_SUSPENDED;
else
dev_dbg(&bus->root_hub->dev, "%s fail, err %d\n",
"suspend", status);
return status;
}

static int hcd_hub_resume (struct usb_bus *bus)
{
struct usb_hcd *hcd;
int status;

hcd = container_of (bus, struct usb_hcd, self);
if (hcd->driver->hub_resume)
return hcd->driver->hub_resume (hcd);
return 0;
if (!hcd->driver->hub_resume)
return -ENOENT;
hcd->state = HC_STATE_RESUMING;
status = hcd->driver->hub_resume (hcd);
if (status == 0)
hcd->state = HC_STATE_RUNNING;
else {
dev_dbg(&bus->root_hub->dev, "%s fail, err %d\n",
"resume", status);
usb_hc_died(hcd);
}
return status;
}

/**
Expand All @@ -1473,13 +1489,9 @@ void usb_hcd_resume_root_hub (struct usb_hcd *hcd)
usb_resume_root_hub (hcd->self.root_hub);
spin_unlock_irqrestore (&hcd_root_hub_lock, flags);
}
EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub);

#else
void usb_hcd_resume_root_hub (struct usb_hcd *hcd)
{
}
#endif
EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub);

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -1532,7 +1544,7 @@ static struct usb_operations usb_hcd_operations = {
.buffer_alloc = hcd_buffer_alloc,
.buffer_free = hcd_buffer_free,
.disable = hcd_endpoint_disable,
#ifdef CONFIG_USB_SUSPEND
#ifdef CONFIG_PM
.hub_suspend = hcd_hub_suspend,
.hub_resume = hcd_hub_resume,
#endif
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/usb/host/ohci-au1xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ static const struct hc_driver ohci_au1xxx_hc_driver = {
*/
.hub_status_data = ohci_hub_status_data,
.hub_control = ohci_hub_control,
#ifdef CONFIG_PM
.hub_suspend = ohci_hub_suspend,
.hub_resume = ohci_hub_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};

/*-------------------------------------------------------------------------*/
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/usb/host/ohci-lh7a404.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ static const struct hc_driver ohci_lh7a404_hc_driver = {
*/
.hub_status_data = ohci_hub_status_data,
.hub_control = ohci_hub_control,
#ifdef CONFIG_PM
.hub_suspend = ohci_hub_suspend,
.hub_resume = ohci_hub_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};

/*-------------------------------------------------------------------------*/
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/host/ohci-pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ static const struct hc_driver ohci_pxa27x_hc_driver = {
.hub_suspend = ohci_hub_suspend,
.hub_resume = ohci_hub_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};

/*-------------------------------------------------------------------------*/
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/host/ohci-s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ static const struct hc_driver ohci_s3c2410_hc_driver = {
.hub_suspend = ohci_hub_suspend,
.hub_resume = ohci_hub_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};

/* device driver */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/host/ohci-sa1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ static const struct hc_driver ohci_sa1111_hc_driver = {
.hub_suspend = ohci_hub_suspend,
.hub_resume = ohci_hub_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};

/*-------------------------------------------------------------------------*/
Expand Down

0 comments on commit 44bcdcb

Please sign in to comment.