Lines Matching refs:role
28 unsigned int dr; /* data role */
29 bool pr; /* power role (true if VBUS enabled) */
136 * cros_ec_usb_get_role() - Get role info about possible PD device attached to a
141 * Return: role info on success, -ENOTCONN if no cable is connected, <0 on
152 pd_control.role = USB_PD_CTRL_ROLE_NO_CHANGE;
166 return resp.role;
188 static const char *cros_ec_usb_role_string(unsigned int role)
190 return role == DR_NONE ? "DISCONNECTED" :
191 (role == DR_HOST ? "DFP" : "UFP");
223 unsigned int role)
251 int role, power_type;
266 role = cros_ec_usb_get_role(info, &polarity);
267 if (role < 0) {
268 if (role != -ENOTCONN) {
269 dev_err(dev, "failed getting role err = %d\n", role);
270 return role;
276 dr = (role & PD_CTRL_RESP_ROLE_DATA) ? DR_HOST : DR_DEVICE;
277 pr = (role & PD_CTRL_RESP_ROLE_POWER);
287 "connected role 0x%x pwr type %d dr %d pr %d pol %d mux %d dp %d hpd %d\n",
288 role, power_type, dr, pr, polarity, mux, dp, hpd);
296 cros_ec_usb_power_type_is_wall_wart(power_type, role))
303 dev_dbg(dev, "Type/Role switch! type = %s role = %s\n",