Lines Matching full:role
27 unsigned int dr; /* data role */
28 bool pr; /* power role (true if VBUS enabled) */
135 * cros_ec_usb_get_role() - Get role info about possible PD device attached to a
140 * Return: role info on success, -ENOTCONN if no cable is connected, <0 on
151 pd_control.role = USB_PD_CTRL_ROLE_NO_CHANGE; in cros_ec_usb_get_role()
165 return resp.role; in cros_ec_usb_get_role()
187 static const char *cros_ec_usb_role_string(unsigned int role) in cros_ec_usb_role_string() argument
189 return role == DR_NONE ? "DISCONNECTED" : in cros_ec_usb_role_string()
190 (role == DR_HOST ? "DFP" : "UFP"); in cros_ec_usb_role_string()
222 unsigned int role) in cros_ec_usb_power_type_is_wall_wart() argument
250 int role, power_type; in extcon_cros_ec_detect_cable() local
265 role = cros_ec_usb_get_role(info, &polarity); in extcon_cros_ec_detect_cable()
266 if (role < 0) { in extcon_cros_ec_detect_cable()
267 if (role != -ENOTCONN) { in extcon_cros_ec_detect_cable()
268 dev_err(dev, "failed getting role err = %d\n", role); in extcon_cros_ec_detect_cable()
269 return role; in extcon_cros_ec_detect_cable()
275 dr = (role & PD_CTRL_RESP_ROLE_DATA) ? DR_HOST : DR_DEVICE; in extcon_cros_ec_detect_cable()
276 pr = (role & PD_CTRL_RESP_ROLE_POWER); in extcon_cros_ec_detect_cable()
286 "connected role 0x%x pwr type %d dr %d pr %d pol %d mux %d dp %d hpd %d\n", in extcon_cros_ec_detect_cable()
287 role, power_type, dr, pr, polarity, mux, dp, hpd); in extcon_cros_ec_detect_cable()
295 cros_ec_usb_power_type_is_wall_wart(power_type, role)) in extcon_cros_ec_detect_cable()
302 dev_dbg(dev, "Type/Role switch! type = %s role = %s\n", in extcon_cros_ec_detect_cable()