diff options
Diffstat (limited to 'drivers/usb/host/isp116x-hcd.c')
-rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 57 |
1 files changed, 15 insertions, 42 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index e142056b0d2c..ddb8fc591466 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; |
@@ -694,7 +694,7 @@ static int balance(struct isp116x *isp116x, u16 period, u16 load) | |||
694 | 694 | ||
695 | static int isp116x_urb_enqueue(struct usb_hcd *hcd, | 695 | static int isp116x_urb_enqueue(struct usb_hcd *hcd, |
696 | struct usb_host_endpoint *hep, struct urb *urb, | 696 | struct usb_host_endpoint *hep, struct urb *urb, |
697 | unsigned mem_flags) | 697 | gfp_t mem_flags) |
698 | { | 698 | { |
699 | struct isp116x *isp116x = hcd_to_isp116x(hcd); | 699 | struct isp116x *isp116x = hcd_to_isp116x(hcd); |
700 | struct usb_device *udev = urb->dev; | 700 | struct usb_device *udev = urb->dev; |
@@ -1160,7 +1160,7 @@ static int isp116x_hub_control(struct usb_hcd *hcd, | |||
1160 | 1160 | ||
1161 | #ifdef CONFIG_PM | 1161 | #ifdef CONFIG_PM |
1162 | 1162 | ||
1163 | static int isp116x_hub_suspend(struct usb_hcd *hcd) | 1163 | static int isp116x_bus_suspend(struct usb_hcd *hcd) |
1164 | { | 1164 | { |
1165 | struct isp116x *isp116x = hcd_to_isp116x(hcd); | 1165 | struct isp116x *isp116x = hcd_to_isp116x(hcd); |
1166 | unsigned long flags; | 1166 | unsigned long flags; |
@@ -1200,7 +1200,7 @@ static int isp116x_hub_suspend(struct usb_hcd *hcd) | |||
1200 | return ret; | 1200 | return ret; |
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | static int isp116x_hub_resume(struct usb_hcd *hcd) | 1203 | static int isp116x_bus_resume(struct usb_hcd *hcd) |
1204 | { | 1204 | { |
1205 | struct isp116x *isp116x = hcd_to_isp116x(hcd); | 1205 | struct isp116x *isp116x = hcd_to_isp116x(hcd); |
1206 | u32 val; | 1206 | u32 val; |
@@ -1263,21 +1263,11 @@ 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_bus_suspend NULL |
1276 | #define isp116x_hub_resume NULL | 1270 | #define isp116x_bus_resume NULL |
1277 | |||
1278 | static void isp116x_rh_resume(void *_hcd) | ||
1279 | { | ||
1280 | } | ||
1281 | 1271 | ||
1282 | #endif | 1272 | #endif |
1283 | 1273 | ||
@@ -1636,8 +1626,8 @@ static struct hc_driver isp116x_hc_driver = { | |||
1636 | 1626 | ||
1637 | .hub_status_data = isp116x_hub_status_data, | 1627 | .hub_status_data = isp116x_hub_status_data, |
1638 | .hub_control = isp116x_hub_control, | 1628 | .hub_control = isp116x_hub_control, |
1639 | .hub_suspend = isp116x_hub_suspend, | 1629 | .bus_suspend = isp116x_bus_suspend, |
1640 | .hub_resume = isp116x_hub_resume, | 1630 | .bus_resume = isp116x_bus_resume, |
1641 | }; | 1631 | }; |
1642 | 1632 | ||
1643 | /*----------------------------------------------------------------*/ | 1633 | /*----------------------------------------------------------------*/ |
@@ -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) { |
@@ -1774,22 +1763,13 @@ static int __init isp116x_probe(struct device *dev) | |||
1774 | /* | 1763 | /* |
1775 | Suspend of platform device | 1764 | Suspend of platform device |
1776 | */ | 1765 | */ |
1777 | static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase) | 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, phase %x\n", __func__, state, phase); | 1770 | VDBG("%s: state %x\n", __func__, state); |
1783 | 1771 | ||
1784 | if (phase != SUSPEND_DISABLE && phase != SUSPEND_POWER_DOWN) | 1772 | dev->power.power_state = state; |
1785 | return 0; | ||
1786 | |||
1787 | ret = usb_suspend_device(hcd->self.root_hub, state); | ||
1788 | if (!ret) { | ||
1789 | dev->power.power_state = state; | ||
1790 | INFO("%s suspended\n", hcd_name); | ||
1791 | } else | ||
1792 | ERR("%s suspend failed\n", hcd_name); | ||
1793 | 1773 | ||
1794 | return ret; | 1774 | return ret; |
1795 | } | 1775 | } |
@@ -1797,21 +1777,14 @@ static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase) | |||
1797 | /* | 1777 | /* |
1798 | Resume platform device | 1778 | Resume platform device |
1799 | */ | 1779 | */ |
1800 | static int isp116x_resume(struct device *dev, u32 phase) | 1780 | static int isp116x_resume(struct device *dev) |
1801 | { | 1781 | { |
1802 | int ret = 0; | 1782 | int ret = 0; |
1803 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
1804 | 1783 | ||
1805 | VDBG("%s: state %x, phase %x\n", __func__, dev->power.power_state, | 1784 | VDBG("%s: state %x\n", __func__, dev->power.power_state); |
1806 | phase); | 1785 | |
1807 | if (phase != RESUME_POWER_ON) | 1786 | dev->power.power_state = PMSG_ON; |
1808 | return 0; | ||
1809 | 1787 | ||
1810 | ret = usb_resume_device(hcd->self.root_hub); | ||
1811 | if (!ret) { | ||
1812 | dev->power.power_state = PMSG_ON; | ||
1813 | VDBG("%s resumed\n", (char *)hcd_name); | ||
1814 | } | ||
1815 | return ret; | 1788 | return ret; |
1816 | } | 1789 | } |
1817 | 1790 | ||