Lines Matching +full:otg +full:- +full:rev

1 // SPDX-License-Identifier: GPL-2.0
7 * compiled-in as well. Otherwise, if either of the two stacks is
17 #include <linux/usb/otg.h>
30 * usb_ep_type_string() - Returns human readable-name of the endpoint type.
31 * @ep_type: The endpoint type to return human-readable name for. If it's not
71 [USB_SPEED_LOW] = "low-speed",
72 [USB_SPEED_FULL] = "full-speed",
73 [USB_SPEED_HIGH] = "high-speed",
75 [USB_SPEED_SUPER] = "super-speed",
76 [USB_SPEED_SUPER_PLUS] = "super-speed-plus",
81 [USB_SSP_GEN_2x1] = "super-speed-plus-gen2x1",
82 [USB_SSP_GEN_1x2] = "super-speed-plus-gen1x2",
83 [USB_SSP_GEN_2x2] = "super-speed-plus-gen2x2",
87 * usb_speed_string() - Returns human readable-name of the speed.
88 * @speed: The speed to return human-readable name for. If it's not
101 * usb_get_maximum_speed - Get maximum requested speed for a given USB
105 * The function gets the maximum speed string from property "maximum-speed",
110 const char *p = "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
179 [USB_DR_MODE_OTG] = "otg",
204 * usb_get_role_switch_default_mode - Get default mode for given device
207 * The function gets string from property 'role-switch-default-mode',
215 ret = device_property_read_string(dev, "role-switch-default-mode", &str); in usb_get_role_switch_default_mode()
224 * usb_decode_interval - Decode bInterval into the time expressed in 1us unit
240 interval = epd->bInterval; in usb_decode_interval()
243 interval = 1 << (epd->bInterval - 1); in usb_decode_interval()
248 interval = epd->bInterval; in usb_decode_interval()
252 interval = 1 << (epd->bInterval - 1); in usb_decode_interval()
254 interval = epd->bInterval; in usb_decode_interval()
266 * of_usb_get_dr_mode_by_phy - Get dual role mode for the controller device
269 * @arg0: phandle args[0] for phy's with #phy-cells >= 1, or -1 for
270 * phys which do not have phy-cells
289 if (arg0 == -1) { in of_usb_get_dr_mode_by_phy()
295 "phys", "#phy-cells", in of_usb_get_dr_mode_by_phy()
321 * of_usb_host_tpl_support - to get if Targeted Peripheral List is supported
322 * for given targeted hosts (non-PC hosts)
329 return of_property_read_bool(np, "tpl-support"); in of_usb_host_tpl_support()
334 * of_usb_update_otg_caps - to update usb otg capabilities according to
339 * The function updates the otg capabilities
347 return -EINVAL; in of_usb_update_otg_caps()
349 if (!of_property_read_u32(np, "otg-rev", &otg_rev)) { in of_usb_update_otg_caps()
356 if (otg_caps->otg_rev) in of_usb_update_otg_caps()
357 otg_caps->otg_rev = min_t(u16, otg_rev, in of_usb_update_otg_caps()
358 otg_caps->otg_rev); in of_usb_update_otg_caps()
360 otg_caps->otg_rev = otg_rev; in of_usb_update_otg_caps()
363 pr_err("%pOF: unsupported otg-rev: 0x%x\n", in of_usb_update_otg_caps()
365 return -EINVAL; in of_usb_update_otg_caps()
369 * otg-rev is mandatory for otg properties, if not passed in of_usb_update_otg_caps()
370 * we set it to be 0 and assume it's a legacy otg device. in of_usb_update_otg_caps()
371 * Non-dt platform can set it afterwards. in of_usb_update_otg_caps()
373 otg_caps->otg_rev = 0; in of_usb_update_otg_caps()
376 if (of_property_read_bool(np, "hnp-disable")) in of_usb_update_otg_caps()
377 otg_caps->hnp_support = false; in of_usb_update_otg_caps()
378 if (of_property_read_bool(np, "srp-disable")) in of_usb_update_otg_caps()
379 otg_caps->srp_support = false; in of_usb_update_otg_caps()
380 if (of_property_read_bool(np, "adp-disable") || in of_usb_update_otg_caps()
381 (otg_caps->otg_rev < 0x0200)) in of_usb_update_otg_caps()
382 otg_caps->adp_support = false; in of_usb_update_otg_caps()
389 * usb_of_get_companion_dev - Find the companion device
404 node = of_parse_phandle(dev->of_node, "companion", 0); in usb_of_get_companion_dev()
410 return pdev ? &pdev->dev : NULL; in usb_of_get_companion_dev()