]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xhci: Fix compile with CONFIG_USB_SUSPEND=n
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 21 May 2012 14:54:42 +0000 (07:54 -0700)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 21 May 2012 16:00:05 +0000 (09:00 -0700)
The USB 2.0 Link PM code is conditionally compiled when
CONFIG_USB_SUSPEND=y.  I believe that's a mistake, since Link PM is not
directly related to USB device suspend and Link PM is implemented
without relying on any of the suspend code in the USB core.  For now,
keep the USB 2.0 Link PM code conditionally compiled if
CONFIG_USB_SUSPEND=y.

This patch does move the code to implement USB 3.0 Link PM out of the
xHCI driver #ifdefs for CONFIG_USB_SUSPEND and moves it into a section
dependent on CONFIG_PM.  The USB core functions for USB 3.0 Link PM are
already conditionally compiled when CONFIG_PM=y.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci.c

index 4ceba145fa88e100a75715a460161db4a69d5c24..ad9ef056d36860586da59067bf145a53bf8f0bb4 100644 (file)
@@ -3837,8 +3837,43 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
        return 0;
 }
 
+int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
+{
+       struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+       int             ret;
+
+       ret = xhci_usb2_software_lpm_test(hcd, udev);
+       if (!ret) {
+               xhci_dbg(xhci, "software LPM test succeed\n");
+               if (xhci->hw_lpm_support == 1) {
+                       udev->usb2_hw_lpm_capable = 1;
+                       ret = xhci_set_usb2_hardware_lpm(hcd, udev, 1);
+                       if (!ret)
+                               udev->usb2_hw_lpm_enabled = 1;
+               }
+       }
+
+       return 0;
+}
+
+#else
+
+int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
+                               struct usb_device *udev, int enable)
+{
+       return 0;
+}
+
+int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
+{
+       return 0;
+}
+
+#endif /* CONFIG_USB_SUSPEND */
+
 /*---------------------- USB 3.0 Link PM functions ------------------------*/
 
+#ifdef CONFIG_PM
 /* Service interval in nanoseconds = 2^(bInterval - 1) * 125us * 1000ns / 1us */
 static unsigned long long xhci_service_interval_to_ns(
                struct usb_endpoint_descriptor *desc)
@@ -4287,41 +4322,22 @@ int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd,
                return ret;
        return 0;
 }
-/*-------------------------------------------------------------------------*/
-
-int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
-{
-       struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-       int             ret;
-
-       ret = xhci_usb2_software_lpm_test(hcd, udev);
-       if (!ret) {
-               xhci_dbg(xhci, "software LPM test succeed\n");
-               if (xhci->hw_lpm_support == 1) {
-                       udev->usb2_hw_lpm_capable = 1;
-                       ret = xhci_set_usb2_hardware_lpm(hcd, udev, 1);
-                       if (!ret)
-                               udev->usb2_hw_lpm_enabled = 1;
-               }
-       }
+#else /* CONFIG_PM */
 
-       return 0;
-}
-
-#else
-
-int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
-                               struct usb_device *udev, int enable)
+int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd,
+                       struct usb_device *udev, enum usb3_link_state state)
 {
-       return 0;
+       return USB3_LPM_DISABLED;
 }
 
-int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
+int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd,
+                       struct usb_device *udev, enum usb3_link_state state)
 {
        return 0;
 }
+#endif /* CONFIG_PM */
 
-#endif /* CONFIG_USB_SUSPEND */
+/*-------------------------------------------------------------------------*/
 
 /* Once a hub descriptor is fetched for a device, we need to update the xHC's
  * internal data structures for the device.