Lines Matching full:role
19 #include <linux/usb/role.h>
128 * struct ci_role_driver - host/gadget role driver
129 * @start: start this role
130 * @stop: stop this role
131 * @suspend: system suspend handler for this role
132 * @resume: system resume handler for this role
133 * @irq: irq handler for this role
134 * @name: role name string (host/gadget)
172 * @role: current role
179 * @work: work for role changing
213 * @mutex: protect code from concorrent running when doing role switch
221 enum ci_role role; member
274 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]); in ci_role()
275 return ci->roles[ci->role]; in ci_role()
278 static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role) in ci_role_start() argument
282 if (role >= CI_ROLE_END) in ci_role_start()
285 if (!ci->roles[role]) in ci_role_start()
288 ret = ci->roles[role]->start(ci); in ci_role_start()
292 ci->role = role; in ci_role_start()
295 if (role == CI_ROLE_HOST) in ci_role_start()
307 enum ci_role role = ci->role; in ci_role_stop() local
309 if (role == CI_ROLE_END) in ci_role_stop()
312 ci->role = CI_ROLE_END; in ci_role_stop()
314 ci->roles[role]->stop(ci); in ci_role_stop()
322 if (ci->role == CI_ROLE_HOST) in ci_role_to_usb_role()
324 else if (ci->role == CI_ROLE_GADGET && ci->vbus_active) in ci_role_to_usb_role()
330 static inline enum ci_role usb_role_to_ci_role(enum usb_role role) in usb_role_to_ci_role() argument
332 if (role == USB_ROLE_HOST) in usb_role_to_ci_role()
334 else if (role == USB_ROLE_DEVICE) in usb_role_to_ci_role()