Lines Matching refs:fsm
125 void (*chrg_vbus)(struct otg_fsm *fsm, int on);
126 void (*drv_vbus)(struct otg_fsm *fsm, int on);
127 void (*loc_conn)(struct otg_fsm *fsm, int on);
128 void (*loc_sof)(struct otg_fsm *fsm, int on);
129 void (*start_pulse)(struct otg_fsm *fsm);
130 void (*start_adp_prb)(struct otg_fsm *fsm);
131 void (*start_adp_sns)(struct otg_fsm *fsm);
132 void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
133 void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
134 int (*start_host)(struct otg_fsm *fsm, int on);
135 int (*start_gadget)(struct otg_fsm *fsm, int on);
139 static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on) in otg_chrg_vbus() argument
141 if (!fsm->ops->chrg_vbus) in otg_chrg_vbus()
143 fsm->ops->chrg_vbus(fsm, on); in otg_chrg_vbus()
147 static inline int otg_drv_vbus(struct otg_fsm *fsm, int on) in otg_drv_vbus() argument
149 if (!fsm->ops->drv_vbus) in otg_drv_vbus()
151 if (fsm->drv_vbus != on) { in otg_drv_vbus()
152 fsm->drv_vbus = on; in otg_drv_vbus()
153 fsm->ops->drv_vbus(fsm, on); in otg_drv_vbus()
158 static inline int otg_loc_conn(struct otg_fsm *fsm, int on) in otg_loc_conn() argument
160 if (!fsm->ops->loc_conn) in otg_loc_conn()
162 if (fsm->loc_conn != on) { in otg_loc_conn()
163 fsm->loc_conn = on; in otg_loc_conn()
164 fsm->ops->loc_conn(fsm, on); in otg_loc_conn()
169 static inline int otg_loc_sof(struct otg_fsm *fsm, int on) in otg_loc_sof() argument
171 if (!fsm->ops->loc_sof) in otg_loc_sof()
173 if (fsm->loc_sof != on) { in otg_loc_sof()
174 fsm->loc_sof = on; in otg_loc_sof()
175 fsm->ops->loc_sof(fsm, on); in otg_loc_sof()
180 static inline int otg_start_pulse(struct otg_fsm *fsm) in otg_start_pulse() argument
182 if (!fsm->ops->start_pulse) in otg_start_pulse()
184 if (!fsm->data_pulse) { in otg_start_pulse()
185 fsm->data_pulse = 1; in otg_start_pulse()
186 fsm->ops->start_pulse(fsm); in otg_start_pulse()
191 static inline int otg_start_adp_prb(struct otg_fsm *fsm) in otg_start_adp_prb() argument
193 if (!fsm->ops->start_adp_prb) in otg_start_adp_prb()
195 if (!fsm->adp_prb) { in otg_start_adp_prb()
196 fsm->adp_sns = 0; in otg_start_adp_prb()
197 fsm->adp_prb = 1; in otg_start_adp_prb()
198 fsm->ops->start_adp_prb(fsm); in otg_start_adp_prb()
203 static inline int otg_start_adp_sns(struct otg_fsm *fsm) in otg_start_adp_sns() argument
205 if (!fsm->ops->start_adp_sns) in otg_start_adp_sns()
207 if (!fsm->adp_sns) { in otg_start_adp_sns()
208 fsm->adp_sns = 1; in otg_start_adp_sns()
209 fsm->ops->start_adp_sns(fsm); in otg_start_adp_sns()
214 static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) in otg_add_timer() argument
216 if (!fsm->ops->add_timer) in otg_add_timer()
218 fsm->ops->add_timer(fsm, timer); in otg_add_timer()
222 static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) in otg_del_timer() argument
224 if (!fsm->ops->del_timer) in otg_del_timer()
226 fsm->ops->del_timer(fsm, timer); in otg_del_timer()
230 static inline int otg_start_host(struct otg_fsm *fsm, int on) in otg_start_host() argument
232 if (!fsm->ops->start_host) in otg_start_host()
234 return fsm->ops->start_host(fsm, on); in otg_start_host()
237 static inline int otg_start_gadget(struct otg_fsm *fsm, int on) in otg_start_gadget() argument
239 if (!fsm->ops->start_gadget) in otg_start_gadget()
241 return fsm->ops->start_gadget(fsm, on); in otg_start_gadget()
244 int otg_statemachine(struct otg_fsm *fsm);