Lines Matching refs:role

10 #include <linux/usb/role.h>
23 enum usb_role role;
37 * usb_role_switch_set_role - Set USB role for a switch
38 * @sw: USB role switch
39 * @role: USB role to be switched to
41 * Set USB role @role for @sw.
43 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role)
52 ret = sw->set(sw, role);
54 sw->role = role;
65 * usb_role_switch_get_role - Get the USB role for a switch
66 * @sw: USB role switch
68 * Depending on the role-switch-driver this function returns either a cached
69 * value of the last set role, or reads back the actual value from the hardware.
73 enum usb_role role;
81 role = sw->get(sw);
83 role = sw->role;
87 return role;
110 if (!fwnode_property_present(parent, "usb-role-switch")) {
121 * usb_role_switch_get - Find USB role switch linked with the caller
124 * Finds and returns role switch linked with @dev. The reference count for the
133 sw = device_connection_find_match(dev, "usb-role-switch", NULL,
144 * fwnode_usb_role_switch_get - Find USB role switch linked with the caller
156 sw = fwnode_connection_find_match(fwnode, "usb-role-switch",
181 * usb_role_switch_find_by_fwnode - Find USB role switch with its fwnode
184 * Finds and returns role switch with @fwnode. The reference count for the
228 enum usb_role role = usb_role_switch_get_role(sw);
230 return sprintf(buf, "%s\n", usb_roles[role]);
255 static DEVICE_ATTR_RW(role);
303 * USB Role Switch is a device capable or choosing the role for USB connector.
304 * On platforms where the USB controller is dual-role capable, the controller
309 * Returns handle to a new role switch or ERR_PTR. The content of @desc is
341 dev_set_name(&sw->dev, "%s-role-switch",