Lines Matching refs: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,
202 otg->host = NULL;
208 otg->host = NULL;
212 otg->host = host;
219 static int tahvo_usb_set_peripheral(struct usb_otg *otg,
222 struct tahvo_usb *tu = container_of(otg->usb_phy, struct tahvo_usb,
230 tu->phy.otg->gadget = NULL;
235 tu->phy.otg->gadget = gadget;
282 if (tu->phy.otg->host) {
294 if (tu->phy.otg->gadget) {
328 tu->phy.otg = devm_kzalloc(&pdev->dev, sizeof(*tu->phy.otg),
330 if (!tu->phy.otg)
375 tu->phy.otg->state = OTG_STATE_UNDEFINED;
379 tu->phy.otg->usb_phy = &tu->phy;
380 tu->phy.otg->set_host = tahvo_usb_set_host;
381 tu->phy.otg->set_peripheral = tahvo_usb_set_peripheral;