• Home
  • Raw
  • Download

Lines Matching full:otg

20 #include <linux/usb/otg.h>
27 #define DRIVER_DESC "Marvell USB OTG transceiver driver"
32 static const char driver_name[] = "mv-otg";
51 static int mv_otg_set_vbus(struct usb_otg *otg, bool on) in mv_otg_set_vbus() argument
53 struct mv_otg *mvotg = container_of(otg->usb_phy, struct mv_otg, phy); in mv_otg_set_vbus()
60 static int mv_otg_set_host(struct usb_otg *otg, in mv_otg_set_host() argument
63 otg->host = host; in mv_otg_set_host()
68 static int mv_otg_set_peripheral(struct usb_otg *otg, in mv_otg_set_peripheral() argument
71 otg->gadget = gadget; in mv_otg_set_peripheral()
196 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_host() local
199 if (!otg->host) in mv_otg_start_host()
204 hcd = bus_to_hcd(otg->host); in mv_otg_start_host()
217 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_periphrals() local
219 if (!otg->gadget) in mv_otg_start_periphrals()
225 usb_gadget_vbus_connect(otg->gadget); in mv_otg_start_periphrals()
227 usb_gadget_vbus_disconnect(otg->gadget); in mv_otg_start_periphrals()
247 dev_dbg(&mvotg->pdev->dev, "otg enabled\n"); in mv_otg_enable_internal()
276 dev_dbg(&mvotg->pdev->dev, "otg disabled\n"); in mv_otg_disable_internal()
332 int old_state = mvotg->phy.otg->state; in mv_otg_update_state()
336 mvotg->phy.otg->state = OTG_STATE_B_IDLE; in mv_otg_update_state()
340 mvotg->phy.otg->state = OTG_STATE_A_IDLE; in mv_otg_update_state()
342 mvotg->phy.otg->state = OTG_STATE_B_PERIPHERAL; in mv_otg_update_state()
346 mvotg->phy.otg->state = OTG_STATE_B_IDLE; in mv_otg_update_state()
350 mvotg->phy.otg->state = OTG_STATE_B_IDLE; in mv_otg_update_state()
353 mvotg->phy.otg->state = OTG_STATE_A_WAIT_VRISE; in mv_otg_update_state()
357 mvotg->phy.otg->state = OTG_STATE_A_WAIT_BCON; in mv_otg_update_state()
364 mvotg->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in mv_otg_update_state()
369 mvotg->phy.otg->state = OTG_STATE_A_VBUS_ERR; in mv_otg_update_state()
373 mvotg->phy.otg->state = OTG_STATE_A_HOST; in mv_otg_update_state()
379 mvotg->phy.otg->state = OTG_STATE_A_WAIT_BCON; in mv_otg_update_state()
381 mvotg->phy.otg->state = OTG_STATE_A_VBUS_ERR; in mv_otg_update_state()
387 mvotg->phy.otg->state = OTG_STATE_A_IDLE; in mv_otg_update_state()
393 mvotg->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in mv_otg_update_state()
405 struct usb_otg *otg; in mv_otg_work() local
413 otg = mvotg->phy.otg; in mv_otg_work()
414 old_state = otg->state; in mv_otg_work()
422 if (old_state != mvotg->phy.otg->state) { in mv_otg_work()
425 state_string[mvotg->phy.otg->state]); in mv_otg_work()
427 switch (mvotg->phy.otg->state) { in mv_otg_work()
429 otg->default_a = 0; in mv_otg_work()
442 otg->default_a = 1; in mv_otg_work()
449 mv_otg_set_vbus(otg, 1); in mv_otg_work()
470 mv_otg_set_vbus(otg, 0); in mv_otg_work()
539 if (mvotg->phy.otg->state != OTG_STATE_B_IDLE in a_bus_req_store()
540 && mvotg->phy.otg->state != OTG_STATE_A_IDLE) in a_bus_req_store()
569 if (!mvotg->phy.otg->default_a) in a_clr_err_store()
605 if (!mvotg->phy.otg->default_a) in a_bus_drop_store()
668 struct usb_otg *otg; in mv_otg_probe() local
681 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in mv_otg_probe()
682 if (!otg) in mv_otg_probe()
696 dev_dbg(&pdev->dev, "cannot create workqueue for OTG\n"); in mv_otg_probe()
702 /* OTG common part */ in mv_otg_probe()
705 mvotg->phy.otg = otg; in mv_otg_probe()
708 otg->state = OTG_STATE_UNDEFINED; in mv_otg_probe()
709 otg->usb_phy = &mvotg->phy; in mv_otg_probe()
710 otg->set_host = mv_otg_set_host; in mv_otg_probe()
711 otg->set_peripheral = mv_otg_set_peripheral; in mv_otg_probe()
712 otg->set_vbus = mv_otg_set_vbus; in mv_otg_probe()
751 dev_err(&pdev->dev, "mv otg enable error %d\n", retval); in mv_otg_probe()
800 dev_err(&pdev->dev, "Request irq %d for OTG failed\n", in mv_otg_probe()
828 "successful probe OTG device %s clock gating.\n", in mv_otg_probe()
849 if (mvotg->phy.otg->state != OTG_STATE_B_IDLE) { in mv_otg_suspend()
851 "OTG state is not B_IDLE, it is %d!\n", in mv_otg_suspend()
852 mvotg->phy.otg->state); in mv_otg_suspend()