• Home
  • Raw
  • Download

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()
1263 isp1301_set_host(struct usb_otg *otg, struct usb_bus *host) in isp1301_set_host() argument
1265 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_set_host()
1273 otg->host = NULL; in isp1301_set_host()
1278 otg->host = host; in isp1301_set_host()
1281 if (otg->gadget) in isp1301_set_host()
1287 otg->host = host; in isp1301_set_host()
1319 isp1301_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) in isp1301_set_peripheral() argument
1321 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_set_peripheral()
1328 if (!otg->default_a) in isp1301_set_peripheral()
1330 usb_gadget_vbus_disconnect(otg->gadget); in isp1301_set_peripheral()
1331 otg->gadget = NULL; in isp1301_set_peripheral()
1337 otg->gadget = gadget; in isp1301_set_peripheral()
1340 if (otg->host) in isp1301_set_peripheral()
1345 otg->gadget = gadget; in isp1301_set_peripheral()
1358 isp->phy.otg->state = OTG_STATE_B_IDLE; in isp1301_set_peripheral()
1393 if (dev->otg->state == OTG_STATE_B_PERIPHERAL) in isp1301_set_power()
1399 isp1301_start_srp(struct usb_otg *otg) in isp1301_start_srp() argument
1401 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_start_srp()
1404 if (isp != the_transceiver || isp->phy.otg->state != OTG_STATE_B_IDLE) in isp1301_start_srp()
1414 isp->phy.otg->state = OTG_STATE_B_SRP_INIT; in isp1301_start_srp()
1425 isp1301_start_hnp(struct usb_otg *otg) in isp1301_start_hnp() argument
1428 struct isp1301 *isp = container_of(otg->usb_phy, struct isp1301, phy); in isp1301_start_hnp()
1433 if (otg->default_a && (otg->host == NULL || !otg->host->b_hnp_enable)) in isp1301_start_hnp()
1435 if (!otg->default_a && (otg->gadget == NULL in isp1301_start_hnp()
1436 || !otg->gadget->b_hnp_enable)) in isp1301_start_hnp()
1442 switch (isp->phy.otg->state) { in isp1301_start_hnp()
1444 isp->phy.otg->state = OTG_STATE_B_PERIPHERAL; in isp1301_start_hnp()
1454 usb_gadget_vbus_connect(otg->gadget); in isp1301_start_hnp()
1491 isp->phy.otg = kzalloc(sizeof *isp->phy.otg, GFP_KERNEL); in isp1301_probe()
1492 if (!isp->phy.otg) { in isp1301_probe()
1571 isp->phy.otg->usb_phy = &isp->phy; in isp1301_probe()
1572 isp->phy.otg->set_host = isp1301_set_host, in isp1301_probe()
1573 isp->phy.otg->set_peripheral = isp1301_set_peripheral, in isp1301_probe()
1574 isp->phy.otg->start_srp = isp1301_start_srp, in isp1301_probe()
1575 isp->phy.otg->start_hnp = isp1301_start_hnp, in isp1301_probe()
1601 kfree(isp->phy.otg); in isp1301_probe()