diff options
author | David Brownell <david-b@pacbell.net> | 2005-09-23 01:45:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 19:47:41 -0400 |
commit | ccdcf77ae32e3d3347fdf3810b27f899e98c34fb (patch) | |
tree | 88e49a51a4778966aa64a138896f3a3321cc97fe /drivers | |
parent | a7f72abe8fac9b919135005e06216be8eef945a2 (diff) |
[PATCH] ISP116x PM updates
This makes the isp116x driver stop using usb_suspend_device() and
usb_resume_device() ... usbcore now calls to the root hub methods,
removing the need for this. It also switches from keventd to khubd
for remote wakeup. (Compile tested.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/isp116x-hcd.c | 29 ++++-------------------------
drivers/usb/host/isp116x.h | 1 -
2 files changed, 4 insertions(+), 26 deletions(-)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 29 | ||||
-rw-r--r-- | drivers/usb/host/isp116x.h | 1 |
2 files changed, 4 insertions, 26 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 554d60282a9d..f68220fc53fd 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -638,7 +638,7 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs) | |||
638 | + msecs_to_jiffies(20) + 1); | 638 | + msecs_to_jiffies(20) + 1); |
639 | if (intstat & HCINT_RD) { | 639 | if (intstat & HCINT_RD) { |
640 | DBG("---- remote wakeup\n"); | 640 | DBG("---- remote wakeup\n"); |
641 | schedule_work(&isp116x->rh_resume); | 641 | usb_hcd_resume_root_hub(hcd); |
642 | ret = IRQ_HANDLED; | 642 | ret = IRQ_HANDLED; |
643 | } | 643 | } |
644 | irqstat &= ~HCuPINT_OPR; | 644 | irqstat &= ~HCuPINT_OPR; |
@@ -1263,22 +1263,12 @@ static int isp116x_hub_resume(struct usb_hcd *hcd) | |||
1263 | return 0; | 1263 | return 0; |
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | static void isp116x_rh_resume(void *_hcd) | ||
1267 | { | ||
1268 | struct usb_hcd *hcd = _hcd; | ||
1269 | |||
1270 | usb_resume_device(hcd->self.root_hub); | ||
1271 | } | ||
1272 | 1266 | ||
1273 | #else | 1267 | #else |
1274 | 1268 | ||
1275 | #define isp116x_hub_suspend NULL | 1269 | #define isp116x_hub_suspend NULL |
1276 | #define isp116x_hub_resume NULL | 1270 | #define isp116x_hub_resume NULL |
1277 | 1271 | ||
1278 | static void isp116x_rh_resume(void *_hcd) | ||
1279 | { | ||
1280 | } | ||
1281 | |||
1282 | #endif | 1272 | #endif |
1283 | 1273 | ||
1284 | /*-----------------------------------------------------------------*/ | 1274 | /*-----------------------------------------------------------------*/ |
@@ -1732,7 +1722,6 @@ static int __init isp116x_probe(struct device *dev) | |||
1732 | isp116x->addr_reg = addr_reg; | 1722 | isp116x->addr_reg = addr_reg; |
1733 | spin_lock_init(&isp116x->lock); | 1723 | spin_lock_init(&isp116x->lock); |
1734 | INIT_LIST_HEAD(&isp116x->async); | 1724 | INIT_LIST_HEAD(&isp116x->async); |
1735 | INIT_WORK(&isp116x->rh_resume, isp116x_rh_resume, hcd); | ||
1736 | isp116x->board = dev->platform_data; | 1725 | isp116x->board = dev->platform_data; |
1737 | 1726 | ||
1738 | if (!isp116x->board) { | 1727 | if (!isp116x->board) { |
@@ -1777,16 +1766,10 @@ static int __init isp116x_probe(struct device *dev) | |||
1777 | static int isp116x_suspend(struct device *dev, pm_message_t state) | 1766 | static int isp116x_suspend(struct device *dev, pm_message_t state) |
1778 | { | 1767 | { |
1779 | int ret = 0; | 1768 | int ret = 0; |
1780 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
1781 | 1769 | ||
1782 | VDBG("%s: state %x\n", __func__, state); | 1770 | VDBG("%s: state %x\n", __func__, state); |
1783 | 1771 | ||
1784 | ret = usb_suspend_device(hcd->self.root_hub); | 1772 | dev->power.power_state = state; |
1785 | if (!ret) { | ||
1786 | dev->power.power_state = state; | ||
1787 | INFO("%s suspended\n", hcd_name); | ||
1788 | } else | ||
1789 | ERR("%s suspend failed\n", hcd_name); | ||
1790 | 1773 | ||
1791 | return ret; | 1774 | return ret; |
1792 | } | 1775 | } |
@@ -1797,15 +1780,11 @@ static int isp116x_suspend(struct device *dev, pm_message_t state) | |||
1797 | static int isp116x_resume(struct device *dev) | 1780 | static int isp116x_resume(struct device *dev) |
1798 | { | 1781 | { |
1799 | int ret = 0; | 1782 | int ret = 0; |
1800 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
1801 | 1783 | ||
1802 | VDBG("%s: state %x\n", __func__, dev->power.power_state); | 1784 | VDBG("%s: state %x\n", __func__, dev->power.power_state); |
1803 | 1785 | ||
1804 | ret = usb_resume_device(hcd->self.root_hub); | 1786 | dev->power.power_state = PMSG_ON; |
1805 | if (!ret) { | 1787 | |
1806 | dev->power.power_state = PMSG_ON; | ||
1807 | VDBG("%s resumed\n", (char *)hcd_name); | ||
1808 | } | ||
1809 | return ret; | 1788 | return ret; |
1810 | } | 1789 | } |
1811 | 1790 | ||
diff --git a/drivers/usb/host/isp116x.h b/drivers/usb/host/isp116x.h index 58873470dcf5..c6fec96785fe 100644 --- a/drivers/usb/host/isp116x.h +++ b/drivers/usb/host/isp116x.h | |||
@@ -253,7 +253,6 @@ static const int cc_to_error[16] = { | |||
253 | 253 | ||
254 | struct isp116x { | 254 | struct isp116x { |
255 | spinlock_t lock; | 255 | spinlock_t lock; |
256 | struct work_struct rh_resume; | ||
257 | 256 | ||
258 | void __iomem *addr_reg; | 257 | void __iomem *addr_reg; |
259 | void __iomem *data_reg; | 258 | void __iomem *data_reg; |