diff options
Diffstat (limited to 'drivers/usb/core/usb.h')
-rw-r--r-- | drivers/usb/core/usb.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 1c528c1bf0be..a7f20bde0e5e 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/pm.h> | 1 | #include <linux/pm.h> |
2 | #include <linux/acpi.h> | 2 | #include <linux/acpi.h> |
3 | 3 | ||
4 | struct usb_hub_descriptor; | ||
4 | struct dev_state; | 5 | struct dev_state; |
5 | 6 | ||
6 | /* Functions local to drivers/usb/core/ */ | 7 | /* Functions local to drivers/usb/core/ */ |
@@ -38,6 +39,15 @@ extern char *usb_cache_string(struct usb_device *udev, int index); | |||
38 | extern int usb_set_configuration(struct usb_device *dev, int configuration); | 39 | extern int usb_set_configuration(struct usb_device *dev, int configuration); |
39 | extern int usb_choose_configuration(struct usb_device *udev); | 40 | extern int usb_choose_configuration(struct usb_device *udev); |
40 | 41 | ||
42 | static inline unsigned usb_get_max_power(struct usb_device *udev, | ||
43 | struct usb_host_config *c) | ||
44 | { | ||
45 | /* SuperSpeed power is in 8 mA units; others are in 2 mA units */ | ||
46 | unsigned mul = (udev->speed == USB_SPEED_SUPER ? 8 : 2); | ||
47 | |||
48 | return c->desc.bMaxPower * mul; | ||
49 | } | ||
50 | |||
41 | extern void usb_kick_khubd(struct usb_device *dev); | 51 | extern void usb_kick_khubd(struct usb_device *dev); |
42 | extern int usb_match_one_id_intf(struct usb_device *dev, | 52 | extern int usb_match_one_id_intf(struct usb_device *dev, |
43 | struct usb_host_interface *intf, | 53 | struct usb_host_interface *intf, |
@@ -173,6 +183,8 @@ extern enum usb_port_connect_type | |||
173 | usb_get_hub_port_connect_type(struct usb_device *hdev, int port1); | 183 | usb_get_hub_port_connect_type(struct usb_device *hdev, int port1); |
174 | extern void usb_set_hub_port_connect_type(struct usb_device *hdev, int port1, | 184 | extern void usb_set_hub_port_connect_type(struct usb_device *hdev, int port1, |
175 | enum usb_port_connect_type type); | 185 | enum usb_port_connect_type type); |
186 | extern void usb_hub_adjust_deviceremovable(struct usb_device *hdev, | ||
187 | struct usb_hub_descriptor *desc); | ||
176 | 188 | ||
177 | #ifdef CONFIG_ACPI | 189 | #ifdef CONFIG_ACPI |
178 | extern int usb_acpi_register(void); | 190 | extern int usb_acpi_register(void); |