USB: OHCI: host-controller resumes leave root hub suspended

Drivers in the ohci-hcd family should perform certain tasks whenever
their controller device is resumed.  These include checking for loss
of power during suspend, turning on port power, and enabling interrupt
requests.

Until now these jobs have been carried out when the root hub is
resumed, not when the controller is.  Many drivers work around the
resulting awkwardness by automatically resuming their root hub
whenever the controller is resumed.  But this is wasteful and
unnecessary.

To simplify the situation, this patch (as1066) adds a new core
routine, ohci_finish_controller_resume(), which can be used by all the
OHCI-variant drivers.  They can call the new routine instead of
resuming their root hubs.  And ohci-pci.c can call it instead of using
its own special-purpose handler.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Stern
2008-04-03 18:03:17 -04:00
committed by Greg Kroah-Hartman
父節點 7be7d74187
當前提交 43bbb7e015
共有 8 個文件被更改,包括 54 次插入49 次删除

查看文件

@@ -510,14 +510,15 @@ static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
static int ohci_omap_resume(struct platform_device *dev)
{
struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev));
struct usb_hcd *hcd = platform_get_drvdata(dev);
struct ohci_hcd *ohci = hcd_to_ohci(hcd);
if (time_before(jiffies, ohci->next_statechange))
msleep(5);
ohci->next_statechange = jiffies;
omap_ohci_clock_power(1);
usb_hcd_resume_root_hub(platform_get_drvdata(dev));
ohci_finish_controller_resume(hcd);
return 0;
}