Lines Matching refs:role
19 #include <linux/usb/role.h>
127 * struct ci_role_driver - host/gadget role driver
128 * @start: start this role
129 * @stop: stop this role
130 * @suspend: system suspend handler for this role
131 * @resume: system resume handler for this role
132 * @irq: irq handler for this role
133 * @name: role name string (host/gadget)
171 * @role: current role
178 * @work: work for role changing
212 * @mutex: protect code from concorrent running when doing role switch
220 enum ci_role role;
272 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]);
273 return ci->roles[ci->role];
276 static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role)
280 if (role >= CI_ROLE_END)
283 if (!ci->roles[role])
286 ret = ci->roles[role]->start(ci);
290 ci->role = role;
293 if (role == CI_ROLE_HOST)
305 enum ci_role role = ci->role;
307 if (role == CI_ROLE_END)
310 ci->role = CI_ROLE_END;
312 ci->roles[role]->stop(ci);
320 if (ci->role == CI_ROLE_HOST)
322 else if (ci->role == CI_ROLE_GADGET && ci->vbus_active)
328 static inline enum ci_role usb_role_to_ci_role(enum usb_role role)
330 if (role == USB_ROLE_HOST)
332 else if (role == USB_ROLE_DEVICE)