aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/isp116x-hcd.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 584b8dc65119..972ce04889f8 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1420,20 +1420,22 @@ static int isp116x_bus_suspend(struct usb_hcd *hcd)
1420 int ret = 0; 1420 int ret = 0;
1421 1421
1422 spin_lock_irqsave(&isp116x->lock, flags); 1422 spin_lock_irqsave(&isp116x->lock, flags);
1423
1424 val = isp116x_read_reg32(isp116x, HCCONTROL); 1423 val = isp116x_read_reg32(isp116x, HCCONTROL);
1424
1425 switch (val & HCCONTROL_HCFS) { 1425 switch (val & HCCONTROL_HCFS) {
1426 case HCCONTROL_USB_OPER: 1426 case HCCONTROL_USB_OPER:
1427 spin_unlock_irqrestore(&isp116x->lock, flags);
1427 val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE); 1428 val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE);
1428 val |= HCCONTROL_USB_SUSPEND; 1429 val |= HCCONTROL_USB_SUSPEND;
1429 if (device_may_wakeup(&hcd->self.root_hub->dev)) 1430 if (device_may_wakeup(&hcd->self.root_hub->dev))
1430 val |= HCCONTROL_RWE; 1431 val |= HCCONTROL_RWE;
1431 /* Wait for usb transfers to finish */ 1432 /* Wait for usb transfers to finish */
1432 mdelay(2); 1433 msleep(2);
1434 spin_lock_irqsave(&isp116x->lock, flags);
1433 isp116x_write_reg32(isp116x, HCCONTROL, val); 1435 isp116x_write_reg32(isp116x, HCCONTROL, val);
1436 spin_unlock_irqrestore(&isp116x->lock, flags);
1434 /* Wait for devices to suspend */ 1437 /* Wait for devices to suspend */
1435 mdelay(5); 1438 msleep(5);
1436 case HCCONTROL_USB_SUSPEND:
1437 break; 1439 break;
1438 case HCCONTROL_USB_RESUME: 1440 case HCCONTROL_USB_RESUME:
1439 isp116x_write_reg32(isp116x, HCCONTROL, 1441 isp116x_write_reg32(isp116x, HCCONTROL,
@@ -1441,12 +1443,11 @@ static int isp116x_bus_suspend(struct usb_hcd *hcd)
1441 HCCONTROL_USB_RESET); 1443 HCCONTROL_USB_RESET);
1442 case HCCONTROL_USB_RESET: 1444 case HCCONTROL_USB_RESET:
1443 ret = -EBUSY; 1445 ret = -EBUSY;
1446 default: /* HCCONTROL_USB_SUSPEND */
1447 spin_unlock_irqrestore(&isp116x->lock, flags);
1444 break; 1448 break;
1445 default:
1446 ret = -EINVAL;
1447 } 1449 }
1448 1450
1449 spin_unlock_irqrestore(&isp116x->lock, flags);
1450 return ret; 1451 return ret;
1451} 1452}
1452 1453
@@ -1715,9 +1716,9 @@ static struct platform_driver isp116x_driver = {
1715 .remove = isp116x_remove, 1716 .remove = isp116x_remove,
1716 .suspend = isp116x_suspend, 1717 .suspend = isp116x_suspend,
1717 .resume = isp116x_resume, 1718 .resume = isp116x_resume,
1718 .driver = { 1719 .driver = {
1719 .name = (char *)hcd_name, 1720 .name = (char *)hcd_name,
1720 }, 1721 },
1721}; 1722};
1722 1723
1723/*-----------------------------------------------------------------*/ 1724/*-----------------------------------------------------------------*/