xhci/usb: Build error fixes for 3.5

Hi Greg,
 
 Here's four patches that fix the build errors introduced by the USB 3.0 Link PM
 patches.  Please pull for inclusion in 3.5.
 
 Sarah Sharp
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPumdCAAoJEBMGWMLi1Gc5veoQAKc+DKLsLrCvXXVPkVNIzrxh
 otE9eNyxqAHd5w7jeteSYwhbR5GfA912OJ6bItz2Bm0Sh/a+VI55QwMd8hV+OW4b
 nIo4Qu5urBsSI82qO9LQV1jS+DHHBAcRQec2FFR9h0Y8cTJkvMLjGcaCSOomvBGq
 HmQ3MRSyKfdUtbFc0pyfjzfbvAftI8Fq1r5XDuce0WXZSPDvlSTvqGCUK7nTo7Pb
 TIW2rLtOJG4xDi6S3gMwlEDilco40EJpem13GdJvoCwLi2bM+FVjTvYHkoSNqtut
 Pv02iyYE+a0mdpwQ5MOyNb0A+QbezyY1YbLF4ZmWRnPjKTOpu3PO1nLLHuWgVJDI
 kEtafG8tcVUcMCczN8Ft0JcHV34pFxLiT8pzJ86684zjRJ9QxlbDISsrZyS45oES
 4lfqgn8rfIV+Qks7MzgBgzDj6ALl+n4JTz4tFE7qK2p7KsLNy2d4gnukHmZvm0AP
 BWW9ACM5NfgDgADWLLGmMh+igCAAWCbrZE2fNcVGONEpDjGyoGZlQYdTyK4ZTHua
 0SzgFdHSvJmHVb7CXxyvcpFPUWznPje4XwkRm2XxkwJ79nl1WkWJwsLw4wMwFUB+
 Chp1wkwHd3U7RilkJJXNLkSeq59CkpxYDZa1FOqmfpYfLWupaFmdHm7Q+W7scM9z
 HXtI18OAErS1+DgSeypG
 =h+NT
 -----END PGP SIGNATURE-----

Merge tag 'for-usb-next-2012-05-21' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next

xhci/usb: Build error fixes for 3.5

Hi Greg,

Here's four patches that fix the build errors introduced by the USB 3.0 Link PM
patches.  Please pull for inclusion in 3.5.

Sarah Sharp
This commit is contained in:
Greg Kroah-Hartman 2012-05-21 09:59:23 -07:00
commit cda4db53e9
4 changed files with 64 additions and 44 deletions

View File

@ -1604,7 +1604,7 @@ static struct usb_driver brcmf_usbdrvr = {
.id_table = brcmf_usb_devid_table,
.suspend = brcmf_usb_suspend,
.resume = brcmf_usb_resume,
.supports_autosuspend = 1
.supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
};

View File

@ -3472,15 +3472,19 @@ int usb_disable_lpm(struct usb_device *udev)
{
return 0;
}
EXPORT_SYMBOL_GPL(usb_disable_lpm);
void usb_enable_lpm(struct usb_device *udev) { }
EXPORT_SYMBOL_GPL(usb_enable_lpm);
int usb_unlocked_disable_lpm(struct usb_device *udev)
{
return 0;
}
EXPORT_SYMBOL_GPL(usb_unlocked_disable_lpm);
void usb_unlocked_enable_lpm(struct usb_device *udev) { }
EXPORT_SYMBOL_GPL(usb_unlocked_enable_lpm);
#endif

View 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)
@ -3921,7 +3956,7 @@ static u16 xhci_calculate_intel_u1_timeout(struct usb_device *udev,
/* Otherwise the calculation is the same as isoc eps */
case USB_ENDPOINT_XFER_ISOC:
timeout_ns = xhci_service_interval_to_ns(desc);
timeout_ns = DIV_ROUND_UP(timeout_ns * 105, 100);
timeout_ns = DIV_ROUND_UP_ULL(timeout_ns * 105, 100);
if (timeout_ns < udev->u1_params.sel * 2)
timeout_ns = udev->u1_params.sel * 2;
break;
@ -3930,7 +3965,7 @@ static u16 xhci_calculate_intel_u1_timeout(struct usb_device *udev,
}
/* The U1 timeout is encoded in 1us intervals. */
timeout_ns = DIV_ROUND_UP(timeout_ns, 1000);
timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 1000);
/* Don't return a timeout of zero, because that's USB3_LPM_DISABLED. */
if (timeout_ns == USB3_LPM_DISABLED)
timeout_ns++;
@ -3969,7 +4004,7 @@ static u16 xhci_calculate_intel_u2_timeout(struct usb_device *udev,
timeout_ns = u2_del_ns;
/* The U2 timeout is encoded in 256us intervals */
timeout_ns = DIV_ROUND_UP(timeout_ns, 256 * 1000);
timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 256 * 1000);
/* If the necessary timeout value is bigger than what we can set in the
* USB 3.0 hub, we have to disable hub-initiated U2.
*/
@ -4287,42 +4322,23 @@ int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd,
return ret;
return 0;
}
#else /* CONFIG_PM */
int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd,
struct usb_device *udev, enum usb3_link_state state)
{
return USB3_LPM_DISABLED;
}
int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd,
struct usb_device *udev, enum usb3_link_state state)
{
return 0;
}
#endif /* CONFIG_PM */
/*-------------------------------------------------------------------------*/
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 */
/* Once a hub descriptor is fetched for a device, we need to update the xHC's
* internal data structures for the device.
*/

View File

@ -592,12 +592,6 @@ extern void usb_autopm_put_interface_async(struct usb_interface *intf);
extern void usb_autopm_get_interface_no_resume(struct usb_interface *intf);
extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
extern int usb_disable_lpm(struct usb_device *udev);
extern void usb_enable_lpm(struct usb_device *udev);
/* Same as above, but these functions lock/unlock the bandwidth_mutex. */
extern int usb_unlocked_disable_lpm(struct usb_device *udev);
extern void usb_unlocked_enable_lpm(struct usb_device *udev);
static inline void usb_mark_last_busy(struct usb_device *udev)
{
pm_runtime_mark_last_busy(&udev->dev);
@ -629,6 +623,12 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
{ }
#endif
extern int usb_disable_lpm(struct usb_device *udev);
extern void usb_enable_lpm(struct usb_device *udev);
/* Same as above, but these functions lock/unlock the bandwidth_mutex. */
extern int usb_unlocked_disable_lpm(struct usb_device *udev);
extern void usb_unlocked_enable_lpm(struct usb_device *udev);
/*-------------------------------------------------------------------------*/
/* for drivers using iso endpoints */