]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/host/isp116x-hcd.c
Merge Paulus' tree
[karo-tx-linux.git] / drivers / usb / host / isp116x-hcd.c
index 554d60282a9de997e770bfcdb8b73c3522fc6860..f9c3f5b8dd1c3adcdcc79dc2f129bf2278b14796 100644 (file)
@@ -70,6 +70,7 @@
 #include <linux/interrupt.h>
 #include <linux/usb.h>
 #include <linux/usb_isp116x.h>
+#include <linux/platform_device.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -638,7 +639,7 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs)
                                  + msecs_to_jiffies(20) + 1);
                if (intstat & HCINT_RD) {
                        DBG("---- remote wakeup\n");
-                       schedule_work(&isp116x->rh_resume);
+                       usb_hcd_resume_root_hub(hcd);
                        ret = IRQ_HANDLED;
                }
                irqstat &= ~HCuPINT_OPR;
@@ -1160,7 +1161,7 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
 
 #ifdef CONFIG_PM
 
-static int isp116x_hub_suspend(struct usb_hcd *hcd)
+static int isp116x_bus_suspend(struct usb_hcd *hcd)
 {
        struct isp116x *isp116x = hcd_to_isp116x(hcd);
        unsigned long flags;
@@ -1200,7 +1201,7 @@ static int isp116x_hub_suspend(struct usb_hcd *hcd)
        return ret;
 }
 
-static int isp116x_hub_resume(struct usb_hcd *hcd)
+static int isp116x_bus_resume(struct usb_hcd *hcd)
 {
        struct isp116x *isp116x = hcd_to_isp116x(hcd);
        u32 val;
@@ -1263,21 +1264,11 @@ static int isp116x_hub_resume(struct usb_hcd *hcd)
        return 0;
 }
 
-static void isp116x_rh_resume(void *_hcd)
-{
-       struct usb_hcd *hcd = _hcd;
-
-       usb_resume_device(hcd->self.root_hub);
-}
 
 #else
 
-#define        isp116x_hub_suspend     NULL
-#define        isp116x_hub_resume      NULL
-
-static void isp116x_rh_resume(void *_hcd)
-{
-}
+#define        isp116x_bus_suspend     NULL
+#define        isp116x_bus_resume      NULL
 
 #endif
 
@@ -1636,8 +1627,8 @@ static struct hc_driver isp116x_hc_driver = {
 
        .hub_status_data = isp116x_hub_status_data,
        .hub_control = isp116x_hub_control,
-       .hub_suspend = isp116x_hub_suspend,
-       .hub_resume = isp116x_hub_resume,
+       .bus_suspend = isp116x_bus_suspend,
+       .bus_resume = isp116x_bus_resume,
 };
 
 /*----------------------------------------------------------------*/
@@ -1732,7 +1723,6 @@ static int __init isp116x_probe(struct device *dev)
        isp116x->addr_reg = addr_reg;
        spin_lock_init(&isp116x->lock);
        INIT_LIST_HEAD(&isp116x->async);
-       INIT_WORK(&isp116x->rh_resume, isp116x_rh_resume, hcd);
        isp116x->board = dev->platform_data;
 
        if (!isp116x->board) {
@@ -1777,16 +1767,10 @@ static int __init isp116x_probe(struct device *dev)
 static int isp116x_suspend(struct device *dev, pm_message_t state)
 {
        int ret = 0;
-       struct usb_hcd *hcd = dev_get_drvdata(dev);
 
        VDBG("%s: state %x\n", __func__, state);
 
-       ret = usb_suspend_device(hcd->self.root_hub);
-       if (!ret) {
-               dev->power.power_state = state;
-               INFO("%s suspended\n", hcd_name);
-       } else
-               ERR("%s suspend failed\n", hcd_name);
+       dev->power.power_state = state;
 
        return ret;
 }
@@ -1797,15 +1781,11 @@ static int isp116x_suspend(struct device *dev, pm_message_t state)
 static int isp116x_resume(struct device *dev)
 {
        int ret = 0;
-       struct usb_hcd *hcd = dev_get_drvdata(dev);
 
        VDBG("%s:  state %x\n", __func__, dev->power.power_state);
 
-       ret = usb_resume_device(hcd->self.root_hub);
-       if (!ret) {
-               dev->power.power_state = PMSG_ON;
-               VDBG("%s resumed\n", (char *)hcd_name);
-       }
+       dev->power.power_state = PMSG_ON;
+
        return ret;
 }