Lines Matching full:fsm

95  * OTG Output status. Read only for users. Updated by OTG FSM helpers defined
115 * Unused as OTG fsm uses otg->host->b_hnp_enable instead
119 * Unused as OTG fsm uses otg->gadget->b_hnp_enable instead
191 void (*chrg_vbus)(struct otg_fsm *fsm, int on);
192 void (*drv_vbus)(struct otg_fsm *fsm, int on);
193 void (*loc_conn)(struct otg_fsm *fsm, int on);
194 void (*loc_sof)(struct otg_fsm *fsm, int on);
195 void (*start_pulse)(struct otg_fsm *fsm);
196 void (*start_adp_prb)(struct otg_fsm *fsm);
197 void (*start_adp_sns)(struct otg_fsm *fsm);
198 void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
199 void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
200 int (*start_host)(struct otg_fsm *fsm, int on);
201 int (*start_gadget)(struct otg_fsm *fsm, int on);
205 static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on) in otg_chrg_vbus() argument
207 if (!fsm->ops->chrg_vbus) in otg_chrg_vbus()
209 fsm->ops->chrg_vbus(fsm, on); in otg_chrg_vbus()
213 static inline int otg_drv_vbus(struct otg_fsm *fsm, int on) in otg_drv_vbus() argument
215 if (!fsm->ops->drv_vbus) in otg_drv_vbus()
217 if (fsm->drv_vbus != on) { in otg_drv_vbus()
218 fsm->drv_vbus = on; in otg_drv_vbus()
219 fsm->ops->drv_vbus(fsm, on); in otg_drv_vbus()
224 static inline int otg_loc_conn(struct otg_fsm *fsm, int on) in otg_loc_conn() argument
226 if (!fsm->ops->loc_conn) in otg_loc_conn()
228 if (fsm->loc_conn != on) { in otg_loc_conn()
229 fsm->loc_conn = on; in otg_loc_conn()
230 fsm->ops->loc_conn(fsm, on); in otg_loc_conn()
235 static inline int otg_loc_sof(struct otg_fsm *fsm, int on) in otg_loc_sof() argument
237 if (!fsm->ops->loc_sof) in otg_loc_sof()
239 if (fsm->loc_sof != on) { in otg_loc_sof()
240 fsm->loc_sof = on; in otg_loc_sof()
241 fsm->ops->loc_sof(fsm, on); in otg_loc_sof()
246 static inline int otg_start_pulse(struct otg_fsm *fsm) in otg_start_pulse() argument
248 if (!fsm->ops->start_pulse) in otg_start_pulse()
250 if (!fsm->data_pulse) { in otg_start_pulse()
251 fsm->data_pulse = 1; in otg_start_pulse()
252 fsm->ops->start_pulse(fsm); in otg_start_pulse()
257 static inline int otg_start_adp_prb(struct otg_fsm *fsm) in otg_start_adp_prb() argument
259 if (!fsm->ops->start_adp_prb) in otg_start_adp_prb()
261 if (!fsm->adp_prb) { in otg_start_adp_prb()
262 fsm->adp_sns = 0; in otg_start_adp_prb()
263 fsm->adp_prb = 1; in otg_start_adp_prb()
264 fsm->ops->start_adp_prb(fsm); in otg_start_adp_prb()
269 static inline int otg_start_adp_sns(struct otg_fsm *fsm) in otg_start_adp_sns() argument
271 if (!fsm->ops->start_adp_sns) in otg_start_adp_sns()
273 if (!fsm->adp_sns) { in otg_start_adp_sns()
274 fsm->adp_sns = 1; in otg_start_adp_sns()
275 fsm->ops->start_adp_sns(fsm); in otg_start_adp_sns()
280 static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) in otg_add_timer() argument
282 if (!fsm->ops->add_timer) in otg_add_timer()
284 fsm->ops->add_timer(fsm, timer); in otg_add_timer()
288 static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) in otg_del_timer() argument
290 if (!fsm->ops->del_timer) in otg_del_timer()
292 fsm->ops->del_timer(fsm, timer); in otg_del_timer()
296 static inline int otg_start_host(struct otg_fsm *fsm, int on) in otg_start_host() argument
298 if (!fsm->ops->start_host) in otg_start_host()
300 return fsm->ops->start_host(fsm, on); in otg_start_host()
303 static inline int otg_start_gadget(struct otg_fsm *fsm, int on) in otg_start_gadget() argument
305 if (!fsm->ops->start_gadget) in otg_start_gadget()
307 return fsm->ops->start_gadget(fsm, on); in otg_start_gadget()
310 int otg_statemachine(struct otg_fsm *fsm);