Lines Matching refs:otg
224 return usb_otg_state_string(isp->phy.otg->state); in state_name()
239 isp->phy.otg->state = OTG_STATE_UNDEFINED; in power_down()
268 if (!isp->phy.otg->host) in host_suspend()
274 dev = isp->phy.otg->host->controller; in host_suspend()
286 if (!isp->phy.otg->host) in host_resume()
289 dev = isp->phy.otg->host->controller; in host_resume()
296 isp->phy.otg->gadget->b_hnp_enable = 0; in gadget_suspend()
297 isp->phy.otg->gadget->a_hnp_support = 0; in gadget_suspend()
298 isp->phy.otg->gadget->a_alt_hnp_support = 0; in gadget_suspend()
299 return usb_gadget_vbus_disconnect(isp->phy.otg->gadget); in gadget_suspend()
329 if (isp->phy.otg->state == OTG_STATE_A_IDLE) in a_idle()
332 isp->phy.otg->default_a = 1; in a_idle()
333 if (isp->phy.otg->host) { in a_idle()
334 isp->phy.otg->host->is_b_host = 0; in a_idle()
337 if (isp->phy.otg->gadget) { in a_idle()
338 isp->phy.otg->gadget->is_a_peripheral = 1; in a_idle()
341 isp->phy.otg->state = OTG_STATE_A_IDLE; in a_idle()
353 if (isp->phy.otg->state == OTG_STATE_B_IDLE) in b_idle()
356 isp->phy.otg->default_a = 0; in b_idle()
357 if (isp->phy.otg->host) { in b_idle()
358 isp->phy.otg->host->is_b_host = 1; in b_idle()
361 if (isp->phy.otg->gadget) { in b_idle()
362 isp->phy.otg->gadget->is_a_peripheral = 0; in b_idle()
365 isp->phy.otg->state = OTG_STATE_B_IDLE; in b_idle()
464 if (isp->phy.otg->state == state && !extra) in check_state()
488 else if (isp->phy.otg->state == OTG_STATE_A_WAIT_VFALL) { in update_otg1()
495 if (isp->phy.otg->state == OTG_STATE_B_IDLE in update_otg1()
496 || isp->phy.otg->state in update_otg1()
503 if (isp->phy.otg->state == OTG_STATE_A_IDLE in update_otg1()
504 || isp->phy.otg->state == OTG_STATE_UNDEFINED) { in update_otg1()
538 switch (isp->phy.otg->state) { in otg_update_isp()
544 if (isp->phy.otg->gadget->b_hnp_enable) { in otg_update_isp()
545 isp->phy.otg->state = OTG_STATE_B_WAIT_ACON; in otg_update_isp()
572 if (!(isp->phy.otg->host)) in otg_update_isp()
575 switch (isp->phy.otg->state) { in otg_update_isp()
586 isp->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in otg_update_isp()
595 isp->phy.otg->state = OTG_STATE_A_WAIT_VRISE; in otg_update_isp()
615 switch (isp->phy.otg->state) { in otg_update_isp()
619 isp->phy.otg->state = OTG_STATE_B_PERIPHERAL; in otg_update_isp()
625 isp->phy.otg->state = OTG_STATE_A_PERIPHERAL; in otg_update_isp()
646 struct usb_otg *otg = isp->phy.otg; in omap_otg_irq() local
663 if (isp->phy.otg->state == OTG_STATE_B_SRP_INIT) in omap_otg_irq()
681 isp->phy.otg->state = OTG_STATE_B_PERIPHERAL; in omap_otg_irq()
693 switch (isp->phy.otg->state) { in omap_otg_irq()
695 if (!otg->host) in omap_otg_irq()
724 isp->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in omap_otg_irq()
738 isp->phy.otg->state = OTG_STATE_A_VBUS_ERR; in omap_otg_irq()
759 switch (isp->phy.otg->state) { in omap_otg_irq()
775 if (otg->host) { in omap_otg_irq()
776 switch (isp->phy.otg->state) { in omap_otg_irq()
778 isp->phy.otg->state = OTG_STATE_B_HOST; in omap_otg_irq()
783 isp->phy.otg->state = OTG_STATE_A_HOST; in omap_otg_irq()
787 isp->phy.otg->state = OTG_STATE_A_WAIT_BCON; in omap_otg_irq()
801 usb_bus_start_enum(otg->host, otg->host->otg_port); in omap_otg_irq()
916 usb_gadget_vbus_connect(isp->phy.otg->gadget); in b_peripheral()
926 isp->phy.otg->state = OTG_STATE_B_PERIPHERAL; in b_peripheral()
934 struct usb_otg *otg = isp->phy.otg; in isp_update_otg() local
936 enum usb_otg_state state = isp->phy.otg->state; in isp_update_otg()
944 if (otg->default_a) { in isp_update_otg()
959 isp->phy.otg->state = OTG_STATE_A_HOST; in isp_update_otg()
967 isp->phy.otg->state = OTG_STATE_A_VBUS_ERR; in isp_update_otg()
976 usb_gadget_vbus_disconnect(otg->gadget); in isp_update_otg()
983 if (otg->host && state == OTG_STATE_A_IDLE) in isp_update_otg()
993 if (otg->default_a) { in isp_update_otg()
996 isp->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in isp_update_otg()
1009 isp->phy.otg->state = OTG_STATE_B_IDLE; in isp_update_otg()
1020 switch (isp->phy.otg->state) { in isp_update_otg()
1042 if (otg->gadget && (isp_bstat & OTG_B_SESS_VLD)) { in isp_update_otg()
1060 if (state != isp->phy.otg->state) in isp_update_otg()
1118 switch (isp->phy.otg->state) { in isp1301_work()
1121 isp->phy.otg->state = OTG_STATE_A_HOST; in isp1301_work()
1130 isp->phy.otg->state = OTG_STATE_B_HOST; in isp1301_work()
1193 kfree(isp->phy.otg); in isp1301_release()
1260 isp1301_set_host(struct usb_otg *otg, struct usb_bus *host) in isp1301_set_host() argument
1262 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_set_host()
1270 otg->host = NULL; in isp1301_set_host()
1275 otg->host = host; in isp1301_set_host()
1278 if (otg->gadget) in isp1301_set_host()
1284 otg->host = host; in isp1301_set_host()
1316 isp1301_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) in isp1301_set_peripheral() argument
1318 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_set_peripheral()
1325 if (!otg->default_a) in isp1301_set_peripheral()
1327 usb_gadget_vbus_disconnect(otg->gadget); in isp1301_set_peripheral()
1328 otg->gadget = NULL; in isp1301_set_peripheral()
1334 otg->gadget = gadget; in isp1301_set_peripheral()
1337 if (otg->host) in isp1301_set_peripheral()
1342 otg->gadget = gadget; in isp1301_set_peripheral()
1355 isp->phy.otg->state = OTG_STATE_B_IDLE; in isp1301_set_peripheral()
1390 if (dev->otg->state == OTG_STATE_B_PERIPHERAL) in isp1301_set_power()
1396 isp1301_start_srp(struct usb_otg *otg) in isp1301_start_srp() argument
1398 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_start_srp()
1401 if (isp != the_transceiver || isp->phy.otg->state != OTG_STATE_B_IDLE) in isp1301_start_srp()
1411 isp->phy.otg->state = OTG_STATE_B_SRP_INIT; in isp1301_start_srp()
1422 isp1301_start_hnp(struct usb_otg *otg) in isp1301_start_hnp() argument
1425 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_start_hnp()
1430 if (otg->default_a && (otg->host == NULL || !otg->host->b_hnp_enable)) in isp1301_start_hnp()
1432 if (!otg->default_a && (otg->gadget == NULL in isp1301_start_hnp()
1433 || !otg->gadget->b_hnp_enable)) in isp1301_start_hnp()
1439 switch (isp->phy.otg->state) { in isp1301_start_hnp()
1441 isp->phy.otg->state = OTG_STATE_B_PERIPHERAL; in isp1301_start_hnp()
1451 usb_gadget_vbus_connect(otg->gadget); in isp1301_start_hnp()
1489 isp->phy.otg = kzalloc(sizeof *isp->phy.otg, GFP_KERNEL); in isp1301_probe()
1490 if (!isp->phy.otg) { in isp1301_probe()
1576 isp->phy.otg->usb_phy = &isp->phy; in isp1301_probe()
1577 isp->phy.otg->set_host = isp1301_set_host; in isp1301_probe()
1578 isp->phy.otg->set_peripheral = isp1301_set_peripheral; in isp1301_probe()
1579 isp->phy.otg->start_srp = isp1301_start_srp; in isp1301_probe()
1580 isp->phy.otg->start_hnp = isp1301_start_hnp; in isp1301_probe()
1606 kfree(isp->phy.otg); in isp1301_probe()