Compiles, untested; these patches resemble those needed in OHCI and EHCI.



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 <[EMAIL PROTECTED]>

--- g26.orig/drivers/usb/host/isp116x-hcd.c	2005-09-22 22:14:41.000000000 -0700
+++ g26/drivers/usb/host/isp116x-hcd.c	2005-09-22 22:15:22.000000000 -0700
@@ -637,7 +637,7 @@ static irqreturn_t isp116x_irq(struct us
 				  + 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;
@@ -1262,22 +1262,12 @@ static int isp116x_hub_resume(struct usb
 	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)
-{
-}
-
 #endif
 
 /*-----------------------------------------------------------------*/
@@ -1731,7 +1721,6 @@ static int __init isp116x_probe(struct d
 	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) {
@@ -1776,19 +1765,13 @@ static int __init isp116x_probe(struct d
 static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase)
 {
 	int ret = 0;
-	struct usb_hcd *hcd = dev_get_drvdata(dev);
 
 	VDBG("%s: state %x, phase %x\n", __func__, state, phase);
 
 	if (phase != SUSPEND_DISABLE && phase != SUSPEND_POWER_DOWN)
 		return 0;
 
-	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;
 }
@@ -1799,18 +1782,13 @@ static int isp116x_suspend(struct device
 static int isp116x_resume(struct device *dev, u32 phase)
 {
 	int ret = 0;
-	struct usb_hcd *hcd = dev_get_drvdata(dev);
 
 	VDBG("%s:  state %x, phase %x\n", __func__, dev->power.power_state,
 	     phase);
 	if (phase != RESUME_POWER_ON)
 		return 0;
 
-	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;
 }
 
--- g26.orig/drivers/usb/host/isp116x.h	2005-09-22 16:44:58.000000000 -0700
+++ g26/drivers/usb/host/isp116x.h	2005-09-22 22:15:22.000000000 -0700
@@ -253,7 +253,6 @@ static const int cc_to_error[16] = {
 
 struct isp116x {
 	spinlock_t lock;
-	struct work_struct rh_resume;
 
 	void __iomem *addr_reg;
 	void __iomem *data_reg;

Reply via email to