]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/sl811-hcd.c
Pull acpi_device_handle_cleanup into release branch
[linux-2.6-omap-h63xx.git] / drivers / usb / host / sl811-hcd.c
index a7722a6a5a5b40cf7bf18dbd4fbfb75e4b15fe33..c327168255cd43467229b43e1c9c7589ac3ebb20 100644 (file)
 #undef VERBOSE
 #undef PACKET_TRACE
 
-#include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-#      define DEBUG
-#else
-#      undef DEBUG
-#endif
-
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -53,7 +45,7 @@
 #include <linux/list.h>
 #include <linux/interrupt.h>
 #include <linux/usb.h>
-#include <linux/usb_sl811.h>
+#include <linux/usb/sl811.h>
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
@@ -860,7 +852,7 @@ static int sl811h_urb_enqueue(
 
        } else {
                INIT_LIST_HEAD(&ep->schedule);
-               ep->udev = usb_get_dev(udev);
+               ep->udev = udev;
                ep->epnum = epnum;
                ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out);
                ep->defctrl = SL11H_HCTLMASK_ARM | SL11H_HCTLMASK_ENABLE;
@@ -1059,7 +1051,6 @@ sl811h_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
        if (!list_empty(&hep->urb_list))
                WARN("ep %p not empty?\n", ep);
 
-       usb_put_dev(ep->udev);
        kfree(ep);
        hep->hcpriv = NULL;
 }
@@ -1581,7 +1572,9 @@ sl811h_start(struct usb_hcd *hcd)
        hcd->state = HC_STATE_RUNNING;
 
        if (sl811->board) {
-               hcd->can_wakeup = sl811->board->can_wakeup;
+               if (!device_can_wakeup(hcd->self.controller))
+                       device_init_wakeup(hcd->self.controller,
+                               sl811->board->can_wakeup);
                hcd->power_budget = sl811->board->power * 2;
        }
 
@@ -1690,9 +1683,13 @@ sl811h_probe(struct platform_device *dev)
                if (!addr || !data)
                        return -ENODEV;
                ioaddr = 1;
-
-               addr_reg = (void __iomem *) addr->start;
-               data_reg = (void __iomem *) data->start;
+               /*
+                * NOTE: 64-bit resource->start is getting truncated
+                * to avoid compiler warning, assuming that ->start
+                * is always 32-bit for this case
+                */
+               addr_reg = (void __iomem *) (unsigned long) addr->start;
+               data_reg = (void __iomem *) (unsigned long) data->start;
        } else {
                addr_reg = ioremap(addr->start, 1);
                if (addr_reg == NULL) {
@@ -1805,9 +1802,10 @@ sl811h_resume(struct platform_device *dev)
         * let's assume it'd only be powered to enable remote wakeup.
         */
        if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND
-                       || !hcd->can_wakeup) {
+                       || !device_can_wakeup(&hcd->self.root_hub->dev)) {
                sl811->port1 = 0;
                port_power(sl811, 1);
+               usb_root_hub_lost_power(hcd->self.root_hub);
                return 0;
        }