|
@@ -60,6 +60,24 @@ const char *usb_speed_string(enum usb_device_speed speed)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(usb_speed_string);
|
|
|
|
|
|
+enum usb_device_speed usb_get_maximum_speed(struct device *dev)
|
|
|
+{
|
|
|
+ const char *maximum_speed;
|
|
|
+ int err;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ err = device_property_read_string(dev, "maximum-speed", &maximum_speed);
|
|
|
+ if (err < 0)
|
|
|
+ return USB_SPEED_UNKNOWN;
|
|
|
+
|
|
|
+ for (i = 0; i < ARRAY_SIZE(speed_names); i++)
|
|
|
+ if (strcmp(maximum_speed, speed_names[i]) == 0)
|
|
|
+ return i;
|
|
|
+
|
|
|
+ return USB_SPEED_UNKNOWN;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(usb_get_maximum_speed);
|
|
|
+
|
|
|
const char *usb_state_string(enum usb_device_state state)
|
|
|
{
|
|
|
static const char *const names[] = {
|
|
@@ -113,32 +131,6 @@ enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(of_usb_get_dr_mode);
|
|
|
|
|
|
-/**
|
|
|
- * of_usb_get_maximum_speed - Get maximum requested speed for a given USB
|
|
|
- * controller.
|
|
|
- * @np: Pointer to the given device_node
|
|
|
- *
|
|
|
- * The function gets the maximum speed string from property "maximum-speed",
|
|
|
- * and returns the corresponding enum usb_device_speed.
|
|
|
- */
|
|
|
-enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np)
|
|
|
-{
|
|
|
- const char *maximum_speed;
|
|
|
- int err;
|
|
|
- int i;
|
|
|
-
|
|
|
- err = of_property_read_string(np, "maximum-speed", &maximum_speed);
|
|
|
- if (err < 0)
|
|
|
- return USB_SPEED_UNKNOWN;
|
|
|
-
|
|
|
- for (i = 0; i < ARRAY_SIZE(speed_names); i++)
|
|
|
- if (strcmp(maximum_speed, speed_names[i]) == 0)
|
|
|
- return i;
|
|
|
-
|
|
|
- return USB_SPEED_UNKNOWN;
|
|
|
-}
|
|
|
-EXPORT_SYMBOL_GPL(of_usb_get_maximum_speed);
|
|
|
-
|
|
|
/**
|
|
|
* of_usb_host_tpl_support - to get if Targeted Peripheral List is supported
|
|
|
* for given targeted hosts (non-PC hosts)
|