Lines Matching refs:fsm
204 void (*chrg_vbus)(struct otg_fsm *fsm, int on);
205 void (*drv_vbus)(struct otg_fsm *fsm, int on);
206 void (*loc_conn)(struct otg_fsm *fsm, int on);
207 void (*loc_sof)(struct otg_fsm *fsm, int on);
208 void (*start_pulse)(struct otg_fsm *fsm);
209 void (*start_adp_prb)(struct otg_fsm *fsm);
210 void (*start_adp_sns)(struct otg_fsm *fsm);
211 void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
212 void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
213 int (*start_host)(struct otg_fsm *fsm, int on);
214 int (*start_gadget)(struct otg_fsm *fsm, int on);
218 static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on) in otg_chrg_vbus() argument
220 if (!fsm->ops->chrg_vbus) in otg_chrg_vbus()
222 fsm->ops->chrg_vbus(fsm, on); in otg_chrg_vbus()
226 static inline int otg_drv_vbus(struct otg_fsm *fsm, int on) in otg_drv_vbus() argument
228 if (!fsm->ops->drv_vbus) in otg_drv_vbus()
230 if (fsm->drv_vbus != on) { in otg_drv_vbus()
231 fsm->drv_vbus = on; in otg_drv_vbus()
232 fsm->ops->drv_vbus(fsm, on); in otg_drv_vbus()
237 static inline int otg_loc_conn(struct otg_fsm *fsm, int on) in otg_loc_conn() argument
239 if (!fsm->ops->loc_conn) in otg_loc_conn()
241 if (fsm->loc_conn != on) { in otg_loc_conn()
242 fsm->loc_conn = on; in otg_loc_conn()
243 fsm->ops->loc_conn(fsm, on); in otg_loc_conn()
248 static inline int otg_loc_sof(struct otg_fsm *fsm, int on) in otg_loc_sof() argument
250 if (!fsm->ops->loc_sof) in otg_loc_sof()
252 if (fsm->loc_sof != on) { in otg_loc_sof()
253 fsm->loc_sof = on; in otg_loc_sof()
254 fsm->ops->loc_sof(fsm, on); in otg_loc_sof()
259 static inline int otg_start_pulse(struct otg_fsm *fsm) in otg_start_pulse() argument
261 if (!fsm->ops->start_pulse) in otg_start_pulse()
263 if (!fsm->data_pulse) { in otg_start_pulse()
264 fsm->data_pulse = 1; in otg_start_pulse()
265 fsm->ops->start_pulse(fsm); in otg_start_pulse()
270 static inline int otg_start_adp_prb(struct otg_fsm *fsm) in otg_start_adp_prb() argument
272 if (!fsm->ops->start_adp_prb) in otg_start_adp_prb()
274 if (!fsm->adp_prb) { in otg_start_adp_prb()
275 fsm->adp_sns = 0; in otg_start_adp_prb()
276 fsm->adp_prb = 1; in otg_start_adp_prb()
277 fsm->ops->start_adp_prb(fsm); in otg_start_adp_prb()
282 static inline int otg_start_adp_sns(struct otg_fsm *fsm) in otg_start_adp_sns() argument
284 if (!fsm->ops->start_adp_sns) in otg_start_adp_sns()
286 if (!fsm->adp_sns) { in otg_start_adp_sns()
287 fsm->adp_sns = 1; in otg_start_adp_sns()
288 fsm->ops->start_adp_sns(fsm); in otg_start_adp_sns()
293 static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) in otg_add_timer() argument
295 if (!fsm->ops->add_timer) in otg_add_timer()
297 fsm->ops->add_timer(fsm, timer); in otg_add_timer()
301 static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) in otg_del_timer() argument
303 if (!fsm->ops->del_timer) in otg_del_timer()
305 fsm->ops->del_timer(fsm, timer); in otg_del_timer()
309 static inline int otg_start_host(struct otg_fsm *fsm, int on) in otg_start_host() argument
311 if (!fsm->ops->start_host) in otg_start_host()
313 return fsm->ops->start_host(fsm, on); in otg_start_host()
316 static inline int otg_start_gadget(struct otg_fsm *fsm, int on) in otg_start_gadget() argument
318 if (!fsm->ops->start_gadget) in otg_start_gadget()
320 return fsm->ops->start_gadget(fsm, on); in otg_start_gadget()
323 int otg_statemachine(struct otg_fsm *fsm);