Lines Matching refs:role
19 #include <linux/usb/role.h>
126 * struct ci_role_driver - host/gadget role driver
127 * @start: start this role
128 * @stop: stop this role
129 * @irq: irq handler for this role
130 * @name: role name string (host/gadget)
166 * @role: current role
173 * @work: work for role changing
207 * @mutex: protect code from concorrent running when doing role switch
215 enum ci_role role;
266 BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]);
267 return ci->roles[ci->role];
270 static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role)
274 if (role >= CI_ROLE_END)
277 if (!ci->roles[role])
280 ret = ci->roles[role]->start(ci);
282 ci->role = role;
288 enum ci_role role = ci->role;
290 if (role == CI_ROLE_END)
293 ci->role = CI_ROLE_END;
295 ci->roles[role]->stop(ci);
300 if (ci->role == CI_ROLE_HOST)
302 else if (ci->role == CI_ROLE_GADGET && ci->vbus_active)
308 static inline enum ci_role usb_role_to_ci_role(enum usb_role role)
310 if (role == USB_ROLE_HOST)
312 else if (role == USB_ROLE_DEVICE)