aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2005-10-28 12:52:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:56 -0400
commit9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch)
tree967e26d3a23c24dd52b114d672312c207714308c /drivers/usb/host
parenta3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff)
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/isp116x-hcd.c14
-rw-r--r--drivers/usb/host/ohci-omap.c10
-rw-r--r--drivers/usb/host/ohci-pxa27x.c4
-rw-r--r--drivers/usb/host/sl811-hcd.c10
4 files changed, 10 insertions, 28 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index e142056b0d2c..0f6183a829c4 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1774,15 +1774,12 @@ static int __init isp116x_probe(struct device *dev)
1774/* 1774/*
1775 Suspend of platform device 1775 Suspend of platform device
1776*/ 1776*/
1777static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase) 1777static int isp116x_suspend(struct device *dev, pm_message_t state)
1778{ 1778{
1779 int ret = 0; 1779 int ret = 0;
1780 struct usb_hcd *hcd = dev_get_drvdata(dev); 1780 struct usb_hcd *hcd = dev_get_drvdata(dev);
1781 1781
1782 VDBG("%s: state %x, phase %x\n", __func__, state, phase); 1782 VDBG("%s: state %x\n", __func__, state);
1783
1784 if (phase != SUSPEND_DISABLE && phase != SUSPEND_POWER_DOWN)
1785 return 0;
1786 1783
1787 ret = usb_suspend_device(hcd->self.root_hub, state); 1784 ret = usb_suspend_device(hcd->self.root_hub, state);
1788 if (!ret) { 1785 if (!ret) {
@@ -1797,15 +1794,12 @@ static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase)
1797/* 1794/*
1798 Resume platform device 1795 Resume platform device
1799*/ 1796*/
1800static int isp116x_resume(struct device *dev, u32 phase) 1797static int isp116x_resume(struct device *dev)
1801{ 1798{
1802 int ret = 0; 1799 int ret = 0;
1803 struct usb_hcd *hcd = dev_get_drvdata(dev); 1800 struct usb_hcd *hcd = dev_get_drvdata(dev);
1804 1801
1805 VDBG("%s: state %x, phase %x\n", __func__, dev->power.power_state, 1802 VDBG("%s: state %x\n", __func__, dev->power.power_state);
1806 phase);
1807 if (phase != RESUME_POWER_ON)
1808 return 0;
1809 1803
1810 ret = usb_resume_device(hcd->self.root_hub); 1804 ret = usb_resume_device(hcd->self.root_hub);
1811 if (!ret) { 1805 if (!ret) {
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index d8f3ba7ad52e..a574216625a0 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -455,14 +455,11 @@ static int ohci_hcd_omap_drv_remove(struct device *dev)
455 455
456#ifdef CONFIG_PM 456#ifdef CONFIG_PM
457 457
458static int ohci_omap_suspend(struct device *dev, pm_message_t message, u32 level) 458static int ohci_omap_suspend(struct device *dev, pm_message_t message)
459{ 459{
460 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); 460 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev));
461 int status = -EINVAL; 461 int status = -EINVAL;
462 462
463 if (level != SUSPEND_POWER_DOWN)
464 return 0;
465
466 down(&ohci_to_hcd(ohci)->self.root_hub->serialize); 463 down(&ohci_to_hcd(ohci)->self.root_hub->serialize);
467 status = ohci_hub_suspend(ohci_to_hcd(ohci)); 464 status = ohci_hub_suspend(ohci_to_hcd(ohci));
468 if (status == 0) { 465 if (status == 0) {
@@ -476,14 +473,11 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message, u32 level
476 return status; 473 return status;
477} 474}
478 475
479static int ohci_omap_resume(struct device *dev, u32 level) 476static int ohci_omap_resume(struct device *dev)
480{ 477{
481 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); 478 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev));
482 int status = 0; 479 int status = 0;
483 480
484 if (level != RESUME_POWER_ON)
485 return 0;
486
487 if (time_before(jiffies, ohci->next_statechange)) 481 if (time_before(jiffies, ohci->next_statechange))
488 msleep(5); 482 msleep(5);
489 ohci->next_statechange = jiffies; 483 ohci->next_statechange = jiffies;
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 2fdb262d4726..f042261ecb8e 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -309,7 +309,7 @@ static int ohci_hcd_pxa27x_drv_remove(struct device *dev)
309 return 0; 309 return 0;
310} 310}
311 311
312static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u32 level) 312static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state)
313{ 313{
314// struct platform_device *pdev = to_platform_device(dev); 314// struct platform_device *pdev = to_platform_device(dev);
315// struct usb_hcd *hcd = dev_get_drvdata(dev); 315// struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -318,7 +318,7 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u
318 return 0; 318 return 0;
319} 319}
320 320
321static int ohci_hcd_pxa27x_drv_resume(struct device *dev, u32 level) 321static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
322{ 322{
323// struct platform_device *pdev = to_platform_device(dev); 323// struct platform_device *pdev = to_platform_device(dev);
324// struct usb_hcd *hcd = dev_get_drvdata(dev); 324// struct usb_hcd *hcd = dev_get_drvdata(dev);
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index d42a15d10a46..03cf6accfe64 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1784,15 +1784,12 @@ sl811h_probe(struct device *dev)
1784 */ 1784 */
1785 1785
1786static int 1786static int
1787sl811h_suspend(struct device *dev, pm_message_t state, u32 phase) 1787sl811h_suspend(struct device *dev, pm_message_t state)
1788{ 1788{
1789 struct usb_hcd *hcd = dev_get_drvdata(dev); 1789 struct usb_hcd *hcd = dev_get_drvdata(dev);
1790 struct sl811 *sl811 = hcd_to_sl811(hcd); 1790 struct sl811 *sl811 = hcd_to_sl811(hcd);
1791 int retval = 0; 1791 int retval = 0;
1792 1792
1793 if (phase != SUSPEND_POWER_DOWN)
1794 return retval;
1795
1796 if (state.event == PM_EVENT_FREEZE) 1793 if (state.event == PM_EVENT_FREEZE)
1797 retval = sl811h_hub_suspend(hcd); 1794 retval = sl811h_hub_suspend(hcd);
1798 else if (state.event == PM_EVENT_SUSPEND) 1795 else if (state.event == PM_EVENT_SUSPEND)
@@ -1803,14 +1800,11 @@ sl811h_suspend(struct device *dev, pm_message_t state, u32 phase)
1803} 1800}
1804 1801
1805static int 1802static int
1806sl811h_resume(struct device *dev, u32 phase) 1803sl811h_resume(struct device *dev)
1807{ 1804{
1808 struct usb_hcd *hcd = dev_get_drvdata(dev); 1805 struct usb_hcd *hcd = dev_get_drvdata(dev);
1809 struct sl811 *sl811 = hcd_to_sl811(hcd); 1806 struct sl811 *sl811 = hcd_to_sl811(hcd);
1810 1807
1811 if (phase != RESUME_POWER_ON)
1812 return 0;
1813
1814 /* with no "check to see if VBUS is still powered" board hook, 1808 /* with no "check to see if VBUS is still powered" board hook,
1815 * let's assume it'd only be powered to enable remote wakeup. 1809 * let's assume it'd only be powered to enable remote wakeup.
1816 */ 1810 */