Commit 1e7c2cd28dc4ea3a86266fcfd07700e3911716a5
Committed by
Greg Kroah-Hartman
1 parent
a35bbad652
usbcore: set lpm_capable field for LPM capable root hubs
commit 9df89d85b407690afa46ddfbccc80bec6869971d upstream. This patch sets the lpm_capable field for root hubs with LPM capabilities. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Reported-by: Martin MOKREJS <mmokrejs@gmail.com> Suggested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 3 changed files with 8 additions and 1 deletions Side-by-side Diff
drivers/usb/core/hcd.c
drivers/usb/core/hub.c
... | ... | @@ -135,7 +135,7 @@ |
135 | 135 | return usb_get_intfdata(hdev->actconfig->interface[0]); |
136 | 136 | } |
137 | 137 | |
138 | -static int usb_device_supports_lpm(struct usb_device *udev) | |
138 | +int usb_device_supports_lpm(struct usb_device *udev) | |
139 | 139 | { |
140 | 140 | /* USB 2.1 (and greater) devices indicate LPM support through |
141 | 141 | * their USB 2.0 Extended Capabilities BOS descriptor. |
... | ... | @@ -156,6 +156,11 @@ |
156 | 156 | "Power management will be impacted.\n"); |
157 | 157 | return 0; |
158 | 158 | } |
159 | + | |
160 | + /* udev is root hub */ | |
161 | + if (!udev->parent) | |
162 | + return 1; | |
163 | + | |
159 | 164 | if (udev->parent->lpm_capable) |
160 | 165 | return 1; |
161 | 166 |
drivers/usb/core/usb.h
... | ... | @@ -35,6 +35,7 @@ |
35 | 35 | unsigned int size); |
36 | 36 | extern int usb_get_bos_descriptor(struct usb_device *dev); |
37 | 37 | extern void usb_release_bos_descriptor(struct usb_device *dev); |
38 | +extern int usb_device_supports_lpm(struct usb_device *udev); | |
38 | 39 | extern char *usb_cache_string(struct usb_device *udev, int index); |
39 | 40 | extern int usb_set_configuration(struct usb_device *dev, int configuration); |
40 | 41 | extern int usb_choose_configuration(struct usb_device *udev); |