Lines Matching refs:otg
77 switch (tu->phy.otg->state) { in check_vbus_state()
80 if (tu->phy.otg->gadget) in check_vbus_state()
81 usb_gadget_vbus_connect(tu->phy.otg->gadget); in check_vbus_state()
82 tu->phy.otg->state = OTG_STATE_B_PERIPHERAL; in check_vbus_state()
90 tu->phy.otg->state = OTG_STATE_A_HOST; in check_vbus_state()
97 switch (tu->phy.otg->state) { in check_vbus_state()
99 if (tu->phy.otg->gadget) in check_vbus_state()
100 usb_gadget_vbus_disconnect(tu->phy.otg->gadget); in check_vbus_state()
101 tu->phy.otg->state = OTG_STATE_B_IDLE; in check_vbus_state()
105 tu->phy.otg->state = OTG_STATE_A_IDLE; in check_vbus_state()
130 tu->phy.otg->state = OTG_STATE_A_IDLE; in tahvo_usb_become_host()
137 tu->phy.otg->state = OTG_STATE_A_IDLE; in tahvo_usb_stop_host()
149 tu->phy.otg->state = OTG_STATE_B_IDLE; in tahvo_usb_become_peripheral()
156 if (tu->phy.otg->gadget) in tahvo_usb_stop_peripheral()
157 usb_gadget_vbus_disconnect(tu->phy.otg->gadget); in tahvo_usb_stop_peripheral()
158 tu->phy.otg->state = OTG_STATE_B_IDLE; in tahvo_usb_stop_peripheral()
166 if (tu->phy.otg->gadget) in tahvo_usb_power_off()
167 usb_gadget_vbus_disconnect(tu->phy.otg->gadget); in tahvo_usb_power_off()
171 tu->phy.otg->state = OTG_STATE_UNDEFINED; in tahvo_usb_power_off()
192 static int tahvo_usb_set_host(struct usb_otg *otg, struct usb_bus *host) in tahvo_usb_set_host() argument
194 struct tahvo_usb *tu = container_of(otg->usb_phy, struct tahvo_usb, in tahvo_usb_set_host()
202 otg->host = NULL; in tahvo_usb_set_host()
208 otg->host = NULL; in tahvo_usb_set_host()
212 otg->host = host; in tahvo_usb_set_host()
219 static int tahvo_usb_set_peripheral(struct usb_otg *otg, in tahvo_usb_set_peripheral() argument
222 struct tahvo_usb *tu = container_of(otg->usb_phy, struct tahvo_usb, in tahvo_usb_set_peripheral()
230 tu->phy.otg->gadget = NULL; in tahvo_usb_set_peripheral()
235 tu->phy.otg->gadget = gadget; in tahvo_usb_set_peripheral()
282 if (tu->phy.otg->host) { in otg_mode_store()
294 if (tu->phy.otg->gadget) { in otg_mode_store()
328 tu->phy.otg = devm_kzalloc(&pdev->dev, sizeof(*tu->phy.otg), in tahvo_usb_probe()
330 if (!tu->phy.otg) in tahvo_usb_probe()
375 tu->phy.otg->state = OTG_STATE_UNDEFINED; in tahvo_usb_probe()
379 tu->phy.otg->usb_phy = &tu->phy; in tahvo_usb_probe()
380 tu->phy.otg->set_host = tahvo_usb_set_host; in tahvo_usb_probe()
381 tu->phy.otg->set_peripheral = tahvo_usb_set_peripheral; in tahvo_usb_probe()