Lines Matching full:role
3 * USB Role Switch Support
10 #include <linux/usb/role.h>
21 enum usb_role role; member
35 * usb_role_switch_set_role - Set USB role for a switch
36 * @sw: USB role switch
37 * @role: USB role to be switched to
39 * Set USB role @role for @sw.
41 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role) in usb_role_switch_set_role() argument
50 ret = sw->set(sw->dev.parent, role); in usb_role_switch_set_role()
52 sw->role = role; in usb_role_switch_set_role()
61 * usb_role_switch_get_role - Get the USB role for a switch
62 * @sw: USB role switch
64 * Depending on the role-switch-driver this function returns either a cached
65 * value of the last set role, or reads back the actual value from the hardware.
69 enum usb_role role; in usb_role_switch_get_role() local
77 role = sw->get(sw->dev.parent); in usb_role_switch_get_role()
79 role = sw->role; in usb_role_switch_get_role()
83 return role; in usb_role_switch_get_role()
104 * usb_role_switch_get - Find USB role switch linked with the caller
107 * Finds and returns role switch linked with @dev. The reference count for the
114 sw = device_connection_find_match(dev, "usb-role-switch", NULL, in usb_role_switch_get()
126 * @sw: USB Role Switch
161 enum usb_role role = usb_role_switch_get_role(sw); in role_show() local
163 return sprintf(buf, "%s\n", usb_roles[role]); in role_show()
188 static DEVICE_ATTR_RW(role);
232 * usb_role_switch_register - Register USB Role Switch
236 * USB Role Switch is a device capable or choosing the role for USB connector.
237 * On platforms where the USB controller is dual-role capable, the controller
242 * Returns handle to a new role switch or ERR_PTR. The content of @desc is
271 dev_set_name(&sw->dev, "%s-role-switch", dev_name(parent)); in usb_role_switch_register()
286 * usb_role_switch_unregister - Unregsiter USB Role Switch
287 * @sw: USB Role Switch
314 MODULE_DESCRIPTION("USB Role Class");