Lines Matching defs:fsm

117 void fsl_otg_chrg_vbus(struct otg_fsm *fsm, int on)
153 void fsl_otg_drv_vbus(struct otg_fsm *fsm, int on)
171 void fsl_otg_loc_conn(struct otg_fsm *fsm, int on)
190 void fsl_otg_loc_sof(struct otg_fsm *fsm, int on)
205 void fsl_otg_start_pulse(struct otg_fsm *fsm)
218 fsl_otg_add_timer(fsm, b_data_pulse_tmr);
235 fsl_otg_chrg_vbus(&fsl_otg_dev->fsm, 1);
237 fsl_otg_add_timer(&fsl_otg_dev->fsm, b_vbus_pulse_tmr);
242 fsl_otg_chrg_vbus(&fsl_otg_dev->fsm, 0);
250 fsl_otg_add_timer(&fsl_otg_dev->fsm, b_srp_wait_tmr);
259 fsl_otg_dev->fsm.b_sess_vld)
260 fsl_otg_dev->fsm.b_srp_done = 1;
272 fsl_otg_add_timer(&fsl_otg_dev->fsm, a_wait_enum_tmr);
274 otg_statemachine(&fsl_otg_dev->fsm);
284 int fsl_otg_init_timers(struct otg_fsm *fsm)
288 (unsigned long)&fsm->a_wait_vrise_tmout);
293 (unsigned long)&fsm->a_wait_bcon_tmout);
298 (unsigned long)&fsm->a_aidl_bdis_tmout);
303 (unsigned long)&fsm->b_ase0_brst_tmout);
308 (unsigned long)&fsm->b_se0_srp);
313 (unsigned long)&fsm->b_srp_done);
318 (unsigned long)&fsm);
393 void fsl_otg_add_timer(struct otg_fsm *fsm, void *gtimer)
411 static void fsl_otg_fsm_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer t)
419 fsl_otg_add_timer(fsm, timer);
423 void fsl_otg_del_timer(struct otg_fsm *fsm, void *gtimer)
433 static void fsl_otg_fsm_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer t)
441 fsl_otg_del_timer(fsm, timer);
457 int fsl_otg_start_host(struct otg_fsm *fsm, int on)
459 struct usb_otg *otg = fsm->otg;
473 fsm->a_vbus_vld =
484 if (fsm->id) {
486 fsl_otg_drv_vbus(fsm, 1);
509 if (fsm->id)
511 fsl_otg_drv_vbus(fsm, 0);
524 int fsl_otg_start_gadget(struct otg_fsm *fsm, int on)
526 struct usb_otg *otg = fsm->otg;
563 otg_dev->fsm.a_bus_drop = 0;
564 otg_dev->fsm.a_bus_req = 1;
570 otg->host->is_b_host = otg_dev->fsm.id;
584 struct otg_fsm *fsm = &otg_dev->fsm;
587 fsm->protocol = PROTO_UNDEF;
593 otg_statemachine(&otg_dev->fsm);
618 otg_dev->fsm.b_bus_req = 0;
619 otg_statemachine(&otg_dev->fsm);
624 otg->gadget->is_a_peripheral = !otg_dev->fsm.id;
626 otg_dev->fsm.b_bus_req = 1;
629 pr_debug("ID pin=%d\n", otg_dev->fsm.id);
630 if (otg_dev->fsm.id == 1) {
631 fsl_otg_start_host(&otg_dev->fsm, 0);
632 otg_drv_vbus(&otg_dev->fsm, 0);
633 fsl_otg_start_gadget(&otg_dev->fsm, 1);
652 struct otg_fsm *fsm = &og->fsm;
654 if (fsm->id) { /* switch to gadget */
655 fsl_otg_start_host(fsm, 0);
656 otg_drv_vbus(fsm, 0);
657 fsl_otg_start_gadget(fsm, 1);
673 otg_dev->fsm.b_bus_req = 1;
674 otg_statemachine(&otg_dev->fsm);
694 otg_dev->fsm.a_bus_req = 0;
695 otg_statemachine(&otg_dev->fsm);
708 struct otg_fsm *fsm = &((struct fsl_otg *)dev_id)->fsm;
719 fsm->id = (otg_sc & OTGSC_STS_USB_ID) ? 1 : 0;
720 otg->default_a = (fsm->id == 0);
725 fsm->id = (otg_sc & OTGSC_STS_USB_ID) ? 1 : 0;
726 otg->default_a = (fsm->id == 0);
728 if (fsm->id)
729 fsm->b_conn = 0;
731 fsm->a_conn = 0;
734 otg->host->is_b_host = fsm->id;
736 otg->gadget->is_a_peripheral = !fsm->id;
737 VDBG("ID int (ID is %d)\n", fsm->id);
739 if (fsm->id) { /* switch to gadget */
747 fsl_otg_start_gadget(fsm, 0);
748 otg_drv_vbus(fsm, 1);
749 fsl_otg_start_host(fsm, 1);
794 status = fsl_otg_init_timers(&fsl_otg_tc->fsm);
799 mutex_init(&fsl_otg_tc->fsm.lock);
802 fsl_otg_tc->fsm.ops = &fsl_otg_ops;
836 struct otg_fsm *fsm;
843 fsm = &p_otg->fsm;
847 fsm->otg = p_otg->phy.otg;
945 p_otg->fsm.id = 1;
948 p_otg->fsm.id = 0;
951 pr_debug("initial ID pin=%d\n", p_otg->fsm.id);