Lines Matching +full:maximum +full:- +full:speed
1 // SPDX-License-Identifier: GPL-2.0
7 * compiled-in as well. Otherwise, if either of the two stacks is
29 * usb_ep_type_string() - Returns human readable-name of the endpoint type.
30 * @ep_type: The endpoint type to return human-readable name for. If it's not
70 [USB_SPEED_LOW] = "low-speed",
71 [USB_SPEED_FULL] = "full-speed",
72 [USB_SPEED_HIGH] = "high-speed",
74 [USB_SPEED_SUPER] = "super-speed",
75 [USB_SPEED_SUPER_PLUS] = "super-speed-plus",
80 [USB_SSP_GEN_2x1] = "super-speed-plus-gen2x1",
81 [USB_SSP_GEN_1x2] = "super-speed-plus-gen1x2",
82 [USB_SSP_GEN_2x2] = "super-speed-plus-gen2x2",
86 * usb_speed_string() - Returns human readable-name of the speed.
87 * @speed: The speed to return human-readable name for. If it's not
91 const char *usb_speed_string(enum usb_device_speed speed) in usb_speed_string() argument
93 if (speed < 0 || speed >= ARRAY_SIZE(speed_names)) in usb_speed_string()
94 speed = USB_SPEED_UNKNOWN; in usb_speed_string()
95 return speed_names[speed]; in usb_speed_string()
100 * usb_get_maximum_speed - Get maximum requested speed for a given USB
104 * The function gets the maximum speed string from property "maximum-speed",
112 ret = device_property_read_string(dev, "maximum-speed", &maximum_speed); in usb_get_maximum_speed()
126 * usb_get_maximum_ssp_rate - Get the signaling rate generation and lane count
130 * If the string from "maximum-speed" property is super-speed-plus-genXxY where
139 ret = device_property_read_string(dev, "maximum-speed", &maximum_speed); in usb_get_maximum_ssp_rate()
149 * usb_state_string - Returns human readable name for the state.
150 * @state: The state to return a human-readable name for. If it's not
204 * usb_decode_interval - Decode bInterval into the time expressed in 1us unit
206 * @speed: The speed that the endpoint works as
212 enum usb_device_speed speed) in usb_decode_interval() argument
219 if (speed == USB_SPEED_HIGH) in usb_decode_interval()
220 interval = epd->bInterval; in usb_decode_interval()
223 interval = 1 << (epd->bInterval - 1); in usb_decode_interval()
227 if (speed == USB_SPEED_HIGH && usb_endpoint_dir_out(epd)) in usb_decode_interval()
228 interval = epd->bInterval; in usb_decode_interval()
231 if (speed >= USB_SPEED_HIGH) in usb_decode_interval()
232 interval = 1 << (epd->bInterval - 1); in usb_decode_interval()
234 interval = epd->bInterval; in usb_decode_interval()
238 interval *= (speed >= USB_SPEED_HIGH) ? 125 : 1000; in usb_decode_interval()
246 * of_usb_get_dr_mode_by_phy - Get dual role mode for the controller device
249 * @arg0: phandle args[0] for phy's with #phy-cells >= 1, or -1 for
250 * phys which do not have phy-cells
270 if (arg0 == -1) { in of_usb_get_dr_mode_by_phy()
276 "phys", "#phy-cells", in of_usb_get_dr_mode_by_phy()
302 * of_usb_host_tpl_support - to get if Targeted Peripheral List is supported
303 * for given targeted hosts (non-PC hosts)
310 return of_property_read_bool(np, "tpl-support"); in of_usb_host_tpl_support()
315 * of_usb_update_otg_caps - to update usb otg capabilities according to
328 return -EINVAL; in of_usb_update_otg_caps()
330 if (!of_property_read_u32(np, "otg-rev", &otg_rev)) { in of_usb_update_otg_caps()
337 if (otg_caps->otg_rev) in of_usb_update_otg_caps()
338 otg_caps->otg_rev = min_t(u16, otg_rev, in of_usb_update_otg_caps()
339 otg_caps->otg_rev); in of_usb_update_otg_caps()
341 otg_caps->otg_rev = otg_rev; in of_usb_update_otg_caps()
344 pr_err("%pOF: unsupported otg-rev: 0x%x\n", in of_usb_update_otg_caps()
346 return -EINVAL; in of_usb_update_otg_caps()
350 * otg-rev is mandatory for otg properties, if not passed in of_usb_update_otg_caps()
352 * Non-dt platform can set it afterwards. in of_usb_update_otg_caps()
354 otg_caps->otg_rev = 0; in of_usb_update_otg_caps()
357 if (of_property_read_bool(np, "hnp-disable")) in of_usb_update_otg_caps()
358 otg_caps->hnp_support = false; in of_usb_update_otg_caps()
359 if (of_property_read_bool(np, "srp-disable")) in of_usb_update_otg_caps()
360 otg_caps->srp_support = false; in of_usb_update_otg_caps()
361 if (of_property_read_bool(np, "adp-disable") || in of_usb_update_otg_caps()
362 (otg_caps->otg_rev < 0x0200)) in of_usb_update_otg_caps()
363 otg_caps->adp_support = false; in of_usb_update_otg_caps()
370 * usb_of_get_companion_dev - Find the companion device
385 node = of_parse_phandle(dev->of_node, "companion", 0); in usb_of_get_companion_dev()
391 return pdev ? &pdev->dev : NULL; in usb_of_get_companion_dev()