Lines Matching full:role

3  * USB Role Switch Support
10 #include <linux/usb/role.h>
25 enum usb_role role; member
40 * usb_role_switch_set_role - Set USB role for a switch
41 * @sw: USB role switch
42 * @role: USB role to be switched to
44 * Set USB role @role for @sw.
46 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument
58 ret = sw->set(sw, role); in usb_role_switch_set_role()
60 sw->role = role; in usb_role_switch_set_role()
71 * usb_role_switch_get_role - Get the USB role for a switch
72 * @sw: USB role switch
74 * Depending on the role-switch-driver this function returns either a cached
75 * value of the last set role, or reads back the actual value from the hardware.
79 enum usb_role role; in usb_role_switch_get_role() local
87 role = sw->get(sw); in usb_role_switch_get_role()
89 role = sw->role; in usb_role_switch_get_role()
93 return role; in usb_role_switch_get_role()
116 if (!fwnode_property_present(parent, "usb-role-switch")) { in usb_role_switch_is_parent()
127 * usb_role_switch_get - Find USB role switch linked with the caller
130 * Finds and returns role switch linked with @dev. The reference count for the
139 sw = device_connection_find_match(dev, "usb-role-switch", NULL, in usb_role_switch_get()
150 * fwnode_usb_role_switch_get - Find USB role switch linked with the caller
162 sw = fwnode_connection_find_match(fwnode, "usb-role-switch", in fwnode_usb_role_switch_get()
173 * @sw: USB Role Switch
187 * usb_role_switch_find_by_fwnode - Find USB role switch with its fwnode
188 * @fwnode: fwnode of the USB Role Switch
190 * Finds and returns role switch with @fwnode. The reference count for the
230 const char *usb_role_string(enum usb_role role) in usb_role_string() argument
232 if (role < 0 || role >= ARRAY_SIZE(usb_roles)) in usb_role_string()
235 return usb_roles[role]; in usb_role_string()
243 enum usb_role role = usb_role_switch_get_role(sw); in role_show() local
245 return sprintf(buf, "%s\n", usb_roles[role]); in role_show()
270 static DEVICE_ATTR_RW(role);
313 * usb_role_switch_register - Register USB Role Switch
317 * USB Role Switch is a device capable or choosing the role for USB connector.
318 * On platforms where the USB controller is dual-role capable, the controller
323 * Returns handle to a new role switch or ERR_PTR. The content of @desc is
355 dev_set_name(&sw->dev, "%s-role-switch", in usb_role_switch_register()
374 * usb_role_switch_unregister - Unregsiter USB Role Switch
375 * @sw: USB Role Switch
390 * @sw: USB Role Switch
401 * @sw: USB Role Switch
424 MODULE_DESCRIPTION("USB Role Class");