Lines Matching refs:role

42 	WARN_ON(!cdns->roles[cdns->role]);  in cdns3_get_current_role_driver()
43 return cdns->roles[cdns->role]; in cdns3_get_current_role_driver()
46 static int cdns3_role_start(struct cdns3 *cdns, enum usb_role role) in cdns3_role_start() argument
50 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns3_role_start()
54 cdns->role = role; in cdns3_role_start()
57 if (!cdns->roles[role]) in cdns3_role_start()
60 if (cdns->roles[role]->state == CDNS3_ROLE_STATE_ACTIVE) in cdns3_role_start()
64 ret = cdns->roles[role]->start(cdns); in cdns3_role_start()
66 cdns->roles[role]->state = CDNS3_ROLE_STATE_ACTIVE; in cdns3_role_start()
74 enum usb_role role = cdns->role; in cdns3_role_stop() local
76 if (WARN_ON(role > USB_ROLE_DEVICE)) in cdns3_role_stop()
79 if (cdns->roles[role]->state == CDNS3_ROLE_STATE_INACTIVE) in cdns3_role_stop()
83 cdns->roles[role]->stop(cdns); in cdns3_role_stop()
84 cdns->roles[role]->state = CDNS3_ROLE_STATE_INACTIVE; in cdns3_role_stop()
110 cdns->role = USB_ROLE_NONE; in cdns3_core_init_role()
196 enum usb_role role; in cdsn3_hw_role_state_machine() local
211 role = cdns->role; in cdsn3_hw_role_state_machine()
213 switch (role) { in cdsn3_hw_role_state_machine()
220 role = USB_ROLE_HOST; in cdsn3_hw_role_state_machine()
222 role = USB_ROLE_DEVICE; in cdsn3_hw_role_state_machine()
226 role = USB_ROLE_NONE; in cdsn3_hw_role_state_machine()
230 role = USB_ROLE_NONE; in cdsn3_hw_role_state_machine()
234 dev_dbg(cdns->dev, "role %d -> %d\n", cdns->role, role); in cdsn3_hw_role_state_machine()
236 return role; in cdsn3_hw_role_state_machine()
240 role = USB_ROLE_HOST; in cdsn3_hw_role_state_machine()
242 role = USB_ROLE_DEVICE; in cdsn3_hw_role_state_machine()
244 return role; in cdsn3_hw_role_state_machine()
291 current_role = cdns->role; in cdns3_hw_role_switch()