Lines Matching defs:otg
21 #include <linux/usb/otg.h>
77 switch (tu->phy.otg->state) {
80 if (tu->phy.otg->gadget)
81 usb_gadget_vbus_connect(tu->phy.otg->gadget);
82 tu->phy.otg->state = OTG_STATE_B_PERIPHERAL;
90 tu->phy.otg->state = OTG_STATE_A_HOST;
97 switch (tu->phy.otg->state) {
99 if (tu->phy.otg->gadget)
100 usb_gadget_vbus_disconnect(tu->phy.otg->gadget);
101 tu->phy.otg->state = OTG_STATE_B_IDLE;
105 tu->phy.otg->state = OTG_STATE_A_IDLE;
130 tu->phy.otg->state = OTG_STATE_A_IDLE;
137 tu->phy.otg->state = OTG_STATE_A_IDLE;
149 tu->phy.otg->state = OTG_STATE_B_IDLE;
156 if (tu->phy.otg->gadget)
157 usb_gadget_vbus_disconnect(tu->phy.otg->gadget);
158 tu->phy.otg->state = OTG_STATE_B_IDLE;
166 if (tu->phy.otg->gadget)
167 usb_gadget_vbus_disconnect(tu->phy.otg->gadget);
171 tu->phy.otg->state = OTG_STATE_UNDEFINED;
192 static int tahvo_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
194 struct tahvo_usb *tu = container_of(otg->usb_phy, struct tahvo_usb,
204 otg->host = NULL;
210 otg->host = NULL;
214 otg->host = host;
221 static int tahvo_usb_set_peripheral(struct usb_otg *otg,
224 struct tahvo_usb *tu = container_of(otg->usb_phy, struct tahvo_usb,
234 tu->phy.otg->gadget = NULL;
239 tu->phy.otg->gadget = gadget;
286 if (tu->phy.otg->host) {
298 if (tu->phy.otg->gadget) {
332 tu->phy.otg = devm_kzalloc(&pdev->dev, sizeof(*tu->phy.otg),
334 if (!tu->phy.otg)
379 tu->phy.otg->state = OTG_STATE_UNDEFINED;
383 tu->phy.otg->usb_phy = &tu->phy;
384 tu->phy.otg->set_host = tahvo_usb_set_host;
385 tu->phy.otg->set_peripheral = tahvo_usb_set_peripheral;