Lines Matching full:role
3 * USB Role Switch Support
10 #include <linux/usb/role.h>
22 enum usb_role role; member
36 * usb_role_switch_set_role - Set USB role for a switch
37 * @sw: USB role switch
38 * @role: USB role to be switched to
40 * Set USB role @role for @sw.
42 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument
51 ret = sw->set(sw, role); in usb_role_switch_set_role()
53 sw->role = role; in usb_role_switch_set_role()
64 * usb_role_switch_get_role - Get the USB role for a switch
65 * @sw: USB role switch
67 * Depending on the role-switch-driver this function returns either a cached
68 * value of the last set role, or reads back the actual value from the hardware.
72 enum usb_role role; in usb_role_switch_get_role() local
80 role = sw->get(sw); in usb_role_switch_get_role()
82 role = sw->role; in usb_role_switch_get_role()
86 return role; in usb_role_switch_get_role()
109 if (!fwnode_property_present(parent, "usb-role-switch")) { in usb_role_switch_is_parent()
120 * usb_role_switch_get - Find USB role switch linked with the caller
123 * Finds and returns role switch linked with @dev. The reference count for the
132 sw = device_connection_find_match(dev, "usb-role-switch", NULL, in usb_role_switch_get()
143 * fwnode_usb_role_switch_get - Find USB role switch linked with the caller
155 sw = fwnode_connection_find_match(fwnode, "usb-role-switch", in fwnode_usb_role_switch_get()
166 * @sw: USB Role Switch
180 * usb_role_switch_find_by_fwnode - Find USB role switch with its fwnode
181 * @fwnode: fwnode of the USB Role Switch
183 * Finds and returns role switch with @fwnode. The reference count for the
224 enum usb_role role = usb_role_switch_get_role(sw); in role_show() local
226 return sprintf(buf, "%s\n", usb_roles[role]); in role_show()
251 static DEVICE_ATTR_RW(role);
295 * usb_role_switch_register - Register USB Role Switch
299 * USB Role Switch is a device capable or choosing the role for USB connector.
300 * On platforms where the USB controller is dual-role capable, the controller
305 * Returns handle to a new role switch or ERR_PTR. The content of @desc is
336 dev_set_name(&sw->dev, "%s-role-switch", in usb_role_switch_register()
352 * usb_role_switch_unregister - Unregsiter USB Role Switch
353 * @sw: USB Role Switch
366 * @sw: USB Role Switch
377 * @sw: USB Role Switch
401 MODULE_DESCRIPTION("USB Role Class");