Lines Matching defs:role
575 if (ci->role != CI_ROLE_END)
606 enum usb_role role;
610 role = ci_role_to_usb_role(ci);
613 return role;
617 enum usb_role role)
624 cable->connected = (role == USB_ROLE_HOST);
628 cable->connected = (role == USB_ROLE_DEVICE);
636 enum ci_role role;
640 role = ci_otg_role(ci);
645 * role switch, the defalt role is gadget, and the
648 role = CI_ROLE_GADGET;
651 role = ci->roles[CI_ROLE_HOST] ? CI_ROLE_HOST
655 return role;
840 enum ci_role role;
845 role = ci_get_role(ci);
847 if (ci->role != role) {
849 } else if (role == CI_ROLE_GADGET) {
972 if (ci->role != CI_ROLE_END)
982 enum ci_role role;
986 dev_warn(dev, "Current configuration is not dual-role, quit\n");
990 for (role = CI_ROLE_HOST; role < CI_ROLE_END; role++)
991 if (!strncmp(buf, ci->roles[role]->name,
992 strlen(ci->roles[role]->name)))
995 if (role == CI_ROLE_END)
1000 if (role == ci->role) {
1008 ret = ci_role_start(ci, role);
1009 if (!ret && ci->role == CI_ROLE_GADGET)
1017 static DEVICE_ATTR_RW(role);
1139 /* initialize role(s) before the interrupt is requested */
1174 if (device_property_read_bool(dev, "usb-role-switch")) {
1188 ci->role = ci_get_role(ci);
1190 ret = ci_role_start(ci, ci->role);
1192 dev_err(dev, "can't start %s role\n",
1198 if (ci->role == CI_ROLE_GADGET)
1389 /* Extra routine per role before system suspend */
1390 if (ci->role != CI_ROLE_END && ci_role(ci)->suspend)
1432 /* Extra routine per role after system resume */
1433 if (ci->role != CI_ROLE_END && ci_role(ci)->resume)