Lines Matching defs:otg

46 static const char driver_name[] = "fsl-usb2-otg";
258 if ((fsl_otg_dev->phy.otg->state == OTG_STATE_B_SRP_INIT) &&
271 if (!fsl_otg_dev->phy.otg->host->b_hnp_enable)
459 struct usb_otg *otg = fsm->otg;
462 container_of(otg->usb_phy, struct fsl_otg, phy);
465 if (!otg->host)
467 dev = otg->host->controller;
526 struct usb_otg *otg = fsm->otg;
529 if (!otg->gadget || !otg->gadget->dev.parent)
533 dev = otg->gadget->dev.parent;
550 static int fsl_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
554 if (!otg)
557 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
561 otg->host = host;
569 otg->host->otg_port = fsl_otg_initdata.otg_port;
570 otg->host->is_b_host = otg_dev->fsm.id;
586 otg->state = OTG_STATE_UNDEFINED;
599 static int fsl_otg_set_peripheral(struct usb_otg *otg,
604 if (!otg)
607 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
614 if (!otg->default_a)
615 otg->gadget->ops->vbus_draw(otg->gadget, 0);
616 usb_gadget_vbus_disconnect(otg->gadget);
617 otg->gadget = 0;
623 otg->gadget = gadget;
624 otg->gadget->is_a_peripheral = !otg_dev->fsm.id;
662 static int fsl_otg_start_srp(struct usb_otg *otg)
666 if (!otg || otg->state != OTG_STATE_B_IDLE)
669 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
680 static int fsl_otg_start_hnp(struct usb_otg *otg)
684 if (!otg)
687 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
709 struct usb_otg *otg = ((struct fsl_otg *)dev_id)->phy.otg;
715 /* Only clear otg interrupts */
720 otg->default_a = (fsm->id == 0);
726 otg->default_a = (fsm->id == 0);
733 if (otg->host)
734 otg->host->is_b_host = fsm->id;
735 if (otg->gadget)
736 otg->gadget->is_a_peripheral = !fsm->id;
780 /* allocate space to fsl otg device */
785 fsl_otg_tc->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
786 if (!fsl_otg_tc->phy.otg) {
804 /* initialize the otg structure */
808 fsl_otg_tc->phy.otg->usb_phy = &fsl_otg_tc->phy;
809 fsl_otg_tc->phy.otg->set_host = fsl_otg_set_host;
810 fsl_otg_tc->phy.otg->set_peripheral = fsl_otg_set_peripheral;
811 fsl_otg_tc->phy.otg->start_hnp = fsl_otg_start_hnp;
812 fsl_otg_tc->phy.otg->start_srp = fsl_otg_start_srp;
816 /* Store the otg transceiver */
826 kfree(fsl_otg_tc->phy.otg);
847 fsm->otg = p_otg->phy.otg;
884 kfree(p_otg->phy.otg);
944 p_otg->phy.otg->state = OTG_STATE_UNDEFINED;
947 p_otg->phy.otg->state = OTG_STATE_A_IDLE;
996 kfree(fsl_otg_dev->phy.otg);