Lines Matching +full:otg +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0+
22 #include <linux/usb/otg.h>
27 #include "phy-mv-usb.h"
29 #define DRIVER_DESC "Marvell USB OTG transceiver driver"
34 static const char driver_name[] = "mv-otg";
53 static int mv_otg_set_vbus(struct usb_otg *otg, bool on) in mv_otg_set_vbus() argument
55 struct mv_otg *mvotg = container_of(otg->usb_phy, struct mv_otg, phy); in mv_otg_set_vbus()
56 if (mvotg->pdata->set_vbus == NULL) in mv_otg_set_vbus()
57 return -ENODEV; in mv_otg_set_vbus()
59 return mvotg->pdata->set_vbus(on); in mv_otg_set_vbus()
62 static int mv_otg_set_host(struct usb_otg *otg, in mv_otg_set_host() argument
65 otg->host = host; in mv_otg_set_host()
70 static int mv_otg_set_peripheral(struct usb_otg *otg, in mv_otg_set_peripheral() argument
73 otg->gadget = gadget; in mv_otg_set_peripheral()
81 dev_dbg(&mvotg->pdev->dev, "transceiver is updated\n"); in mv_otg_run_state_machine()
82 if (!mvotg->qwork) in mv_otg_run_state_machine()
85 queue_delayed_work(mvotg->qwork, &mvotg->work, delay); in mv_otg_run_state_machine()
93 mvotg->otg_ctrl.a_wait_bcon_timeout = 1; in mv_otg_timer_await_bcon()
95 dev_info(&mvotg->pdev->dev, "B Device No Response!\n"); in mv_otg_timer_await_bcon()
97 if (spin_trylock(&mvotg->wq_lock)) { in mv_otg_timer_await_bcon()
99 spin_unlock(&mvotg->wq_lock); in mv_otg_timer_await_bcon()
103 static int mv_otg_cancel_timer(struct mv_otg *mvotg, unsigned int id) in mv_otg_cancel_timer() argument
107 if (id >= OTG_TIMER_NUM) in mv_otg_cancel_timer()
108 return -EINVAL; in mv_otg_cancel_timer()
110 timer = &mvotg->otg_ctrl.timer[id]; in mv_otg_cancel_timer()
118 static int mv_otg_set_timer(struct mv_otg *mvotg, unsigned int id, in mv_otg_set_timer() argument
123 if (id >= OTG_TIMER_NUM) in mv_otg_set_timer()
124 return -EINVAL; in mv_otg_set_timer()
126 timer = &mvotg->otg_ctrl.timer[id]; in mv_otg_set_timer()
128 dev_err(&mvotg->pdev->dev, "Timer%d is already running\n", id); in mv_otg_set_timer()
129 return -EBUSY; in mv_otg_set_timer()
132 timer->expires = jiffies + interval; in mv_otg_set_timer()
144 tmp = readl(&mvotg->op_regs->usbcmd); in mv_otg_reset()
146 writel(tmp, &mvotg->op_regs->usbcmd); in mv_otg_reset()
149 writel(USBCMD_CTRL_RESET, &mvotg->op_regs->usbcmd); in mv_otg_reset()
151 ret = readl_poll_timeout_atomic(&mvotg->op_regs->usbcmd, tmp, in mv_otg_reset()
154 dev_err(&mvotg->pdev->dev, in mv_otg_reset()
159 writel(0x0, &mvotg->op_regs->usbintr); in mv_otg_reset()
160 tmp = readl(&mvotg->op_regs->usbsts); in mv_otg_reset()
161 writel(tmp, &mvotg->op_regs->usbsts); in mv_otg_reset()
170 mvotg->irq_en = OTGSC_INTR_A_SESSION_VALID in mv_otg_init_irq()
172 mvotg->irq_status = OTGSC_INTSTS_A_SESSION_VALID in mv_otg_init_irq()
175 if (mvotg->pdata->vbus == NULL) { in mv_otg_init_irq()
176 mvotg->irq_en |= OTGSC_INTR_B_SESSION_VALID in mv_otg_init_irq()
178 mvotg->irq_status |= OTGSC_INTSTS_B_SESSION_VALID in mv_otg_init_irq()
182 if (mvotg->pdata->id == NULL) { in mv_otg_init_irq()
183 mvotg->irq_en |= OTGSC_INTR_USB_ID; in mv_otg_init_irq()
184 mvotg->irq_status |= OTGSC_INTSTS_USB_ID; in mv_otg_init_irq()
187 otgsc = readl(&mvotg->op_regs->otgsc); in mv_otg_init_irq()
188 otgsc |= mvotg->irq_en; in mv_otg_init_irq()
189 writel(otgsc, &mvotg->op_regs->otgsc); in mv_otg_init_irq()
195 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_host() local
198 if (!otg->host) in mv_otg_start_host()
201 dev_info(&mvotg->pdev->dev, "%s host\n", on ? "start" : "stop"); in mv_otg_start_host()
203 hcd = bus_to_hcd(otg->host); in mv_otg_start_host()
206 usb_add_hcd(hcd, hcd->irq, IRQF_SHARED); in mv_otg_start_host()
207 device_wakeup_enable(hcd->self.controller); in mv_otg_start_host()
216 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_periphrals() local
218 if (!otg->gadget) in mv_otg_start_periphrals()
221 dev_info(mvotg->phy.dev, "gadget %s\n", str_on_off(on)); in mv_otg_start_periphrals()
224 usb_gadget_vbus_connect(otg->gadget); in mv_otg_start_periphrals()
226 usb_gadget_vbus_disconnect(otg->gadget); in mv_otg_start_periphrals()
231 clk_prepare_enable(mvotg->clk); in otg_clock_enable()
236 clk_disable_unprepare(mvotg->clk); in otg_clock_disable()
243 if (mvotg->active) in mv_otg_enable_internal()
246 dev_dbg(&mvotg->pdev->dev, "otg enabled\n"); in mv_otg_enable_internal()
249 if (mvotg->pdata->phy_init) { in mv_otg_enable_internal()
250 retval = mvotg->pdata->phy_init(mvotg->phy_regs); in mv_otg_enable_internal()
252 dev_err(&mvotg->pdev->dev, in mv_otg_enable_internal()
258 mvotg->active = 1; in mv_otg_enable_internal()
266 if (mvotg->clock_gating) in mv_otg_enable()
274 if (mvotg->active) { in mv_otg_disable_internal()
275 dev_dbg(&mvotg->pdev->dev, "otg disabled\n"); in mv_otg_disable_internal()
276 if (mvotg->pdata->phy_deinit) in mv_otg_disable_internal()
277 mvotg->pdata->phy_deinit(mvotg->phy_regs); in mv_otg_disable_internal()
279 mvotg->active = 0; in mv_otg_disable_internal()
285 if (mvotg->clock_gating) in mv_otg_disable()
291 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; in mv_otg_update_inputs()
294 otgsc = readl(&mvotg->op_regs->otgsc); in mv_otg_update_inputs()
296 if (mvotg->pdata->vbus) { in mv_otg_update_inputs()
297 if (mvotg->pdata->vbus->poll() == VBUS_HIGH) { in mv_otg_update_inputs()
298 otg_ctrl->b_sess_vld = 1; in mv_otg_update_inputs()
299 otg_ctrl->b_sess_end = 0; in mv_otg_update_inputs()
301 otg_ctrl->b_sess_vld = 0; in mv_otg_update_inputs()
302 otg_ctrl->b_sess_end = 1; in mv_otg_update_inputs()
305 otg_ctrl->b_sess_vld = !!(otgsc & OTGSC_STS_B_SESSION_VALID); in mv_otg_update_inputs()
306 otg_ctrl->b_sess_end = !!(otgsc & OTGSC_STS_B_SESSION_END); in mv_otg_update_inputs()
309 if (mvotg->pdata->id) in mv_otg_update_inputs()
310 otg_ctrl->id = !!mvotg->pdata->id->poll(); in mv_otg_update_inputs()
312 otg_ctrl->id = !!(otgsc & OTGSC_STS_USB_ID); in mv_otg_update_inputs()
314 if (mvotg->pdata->otg_force_a_bus_req && !otg_ctrl->id) in mv_otg_update_inputs()
315 otg_ctrl->a_bus_req = 1; in mv_otg_update_inputs()
317 otg_ctrl->a_sess_vld = !!(otgsc & OTGSC_STS_A_SESSION_VALID); in mv_otg_update_inputs()
318 otg_ctrl->a_vbus_vld = !!(otgsc & OTGSC_STS_A_VBUS_VALID); in mv_otg_update_inputs()
320 dev_dbg(&mvotg->pdev->dev, "%s: ", __func__); in mv_otg_update_inputs()
321 dev_dbg(&mvotg->pdev->dev, "id %d\n", otg_ctrl->id); in mv_otg_update_inputs()
322 dev_dbg(&mvotg->pdev->dev, "b_sess_vld %d\n", otg_ctrl->b_sess_vld); in mv_otg_update_inputs()
323 dev_dbg(&mvotg->pdev->dev, "b_sess_end %d\n", otg_ctrl->b_sess_end); in mv_otg_update_inputs()
324 dev_dbg(&mvotg->pdev->dev, "a_vbus_vld %d\n", otg_ctrl->a_vbus_vld); in mv_otg_update_inputs()
325 dev_dbg(&mvotg->pdev->dev, "a_sess_vld %d\n", otg_ctrl->a_sess_vld); in mv_otg_update_inputs()
330 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; in mv_otg_update_state()
331 int old_state = mvotg->phy.otg->state; in mv_otg_update_state()
335 mvotg->phy.otg->state = OTG_STATE_B_IDLE; in mv_otg_update_state()
338 if (otg_ctrl->id == 0) in mv_otg_update_state()
339 mvotg->phy.otg->state = OTG_STATE_A_IDLE; in mv_otg_update_state()
340 else if (otg_ctrl->b_sess_vld) in mv_otg_update_state()
341 mvotg->phy.otg->state = OTG_STATE_B_PERIPHERAL; in mv_otg_update_state()
344 if (!otg_ctrl->b_sess_vld || otg_ctrl->id == 0) in mv_otg_update_state()
345 mvotg->phy.otg->state = OTG_STATE_B_IDLE; in mv_otg_update_state()
348 if (otg_ctrl->id) in mv_otg_update_state()
349 mvotg->phy.otg->state = OTG_STATE_B_IDLE; in mv_otg_update_state()
350 else if (!(otg_ctrl->a_bus_drop) && in mv_otg_update_state()
351 (otg_ctrl->a_bus_req || otg_ctrl->a_srp_det)) in mv_otg_update_state()
352 mvotg->phy.otg->state = OTG_STATE_A_WAIT_VRISE; in mv_otg_update_state()
355 if (otg_ctrl->a_vbus_vld) in mv_otg_update_state()
356 mvotg->phy.otg->state = OTG_STATE_A_WAIT_BCON; in mv_otg_update_state()
359 if (otg_ctrl->id || otg_ctrl->a_bus_drop in mv_otg_update_state()
360 || otg_ctrl->a_wait_bcon_timeout) { in mv_otg_update_state()
362 mvotg->otg_ctrl.a_wait_bcon_timeout = 0; in mv_otg_update_state()
363 mvotg->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in mv_otg_update_state()
364 otg_ctrl->a_bus_req = 0; in mv_otg_update_state()
365 } else if (!otg_ctrl->a_vbus_vld) { in mv_otg_update_state()
367 mvotg->otg_ctrl.a_wait_bcon_timeout = 0; in mv_otg_update_state()
368 mvotg->phy.otg->state = OTG_STATE_A_VBUS_ERR; in mv_otg_update_state()
369 } else if (otg_ctrl->b_conn) { in mv_otg_update_state()
371 mvotg->otg_ctrl.a_wait_bcon_timeout = 0; in mv_otg_update_state()
372 mvotg->phy.otg->state = OTG_STATE_A_HOST; in mv_otg_update_state()
376 if (otg_ctrl->id || !otg_ctrl->b_conn in mv_otg_update_state()
377 || otg_ctrl->a_bus_drop) in mv_otg_update_state()
378 mvotg->phy.otg->state = OTG_STATE_A_WAIT_BCON; in mv_otg_update_state()
379 else if (!otg_ctrl->a_vbus_vld) in mv_otg_update_state()
380 mvotg->phy.otg->state = OTG_STATE_A_VBUS_ERR; in mv_otg_update_state()
383 if (otg_ctrl->id in mv_otg_update_state()
384 || (!otg_ctrl->b_conn && otg_ctrl->a_sess_vld) in mv_otg_update_state()
385 || otg_ctrl->a_bus_req) in mv_otg_update_state()
386 mvotg->phy.otg->state = OTG_STATE_A_IDLE; in mv_otg_update_state()
389 if (otg_ctrl->id || otg_ctrl->a_clr_err in mv_otg_update_state()
390 || otg_ctrl->a_bus_drop) { in mv_otg_update_state()
391 otg_ctrl->a_clr_err = 0; in mv_otg_update_state()
392 mvotg->phy.otg->state = OTG_STATE_A_WAIT_VFALL; in mv_otg_update_state()
403 struct usb_otg *otg; in mv_otg_work() local
410 otg = mvotg->phy.otg; in mv_otg_work()
411 old_state = otg->state; in mv_otg_work()
413 if (!mvotg->active) in mv_otg_work()
419 if (old_state != mvotg->phy.otg->state) { in mv_otg_work()
420 dev_info(&mvotg->pdev->dev, "change from state %s to %s\n", in mv_otg_work()
422 state_string[mvotg->phy.otg->state]); in mv_otg_work()
424 switch (mvotg->phy.otg->state) { in mv_otg_work()
426 otg->default_a = 0; in mv_otg_work()
431 usb_phy_set_event(&mvotg->phy, USB_EVENT_NONE); in mv_otg_work()
436 usb_phy_set_event(&mvotg->phy, USB_EVENT_ENUMERATED); in mv_otg_work()
439 otg->default_a = 1; in mv_otg_work()
446 mv_otg_set_vbus(otg, 1); in mv_otg_work()
457 mvotg->otg_ctrl.b_conn = 1; in mv_otg_work()
466 mvotg->otg_ctrl.b_conn = 0; in mv_otg_work()
467 mv_otg_set_vbus(otg, 0); in mv_otg_work()
483 otgsc = readl(&mvotg->op_regs->otgsc); in mv_otg_irq()
484 writel(otgsc, &mvotg->op_regs->otgsc); in mv_otg_irq()
487 * if we have vbus, then the vbus detection for B-device in mv_otg_irq()
490 if (mvotg->pdata->vbus) in mv_otg_irq()
495 if ((otgsc & mvotg->irq_status) == 0) in mv_otg_irq()
508 if (!mvotg->active) { in mv_otg_inputs_irq()
523 mvotg->otg_ctrl.a_bus_req); in a_bus_req_show()
533 return -1; in a_bus_req_store()
536 if (mvotg->phy.otg->state != OTG_STATE_B_IDLE in a_bus_req_store()
537 && mvotg->phy.otg->state != OTG_STATE_A_IDLE) in a_bus_req_store()
538 return -1; in a_bus_req_store()
540 /* The clock may disabled and we need to set irq for ID detected */ in a_bus_req_store()
545 mvotg->otg_ctrl.a_bus_req = 1; in a_bus_req_store()
546 mvotg->otg_ctrl.a_bus_drop = 0; in a_bus_req_store()
547 dev_dbg(&mvotg->pdev->dev, in a_bus_req_store()
550 if (spin_trylock(&mvotg->wq_lock)) { in a_bus_req_store()
552 spin_unlock(&mvotg->wq_lock); in a_bus_req_store()
566 if (!mvotg->phy.otg->default_a) in a_clr_err_store()
567 return -1; in a_clr_err_store()
570 return -1; in a_clr_err_store()
573 mvotg->otg_ctrl.a_clr_err = 1; in a_clr_err_store()
574 dev_dbg(&mvotg->pdev->dev, in a_clr_err_store()
578 if (spin_trylock(&mvotg->wq_lock)) { in a_clr_err_store()
580 spin_unlock(&mvotg->wq_lock); in a_clr_err_store()
594 mvotg->otg_ctrl.a_bus_drop); in a_bus_drop_show()
602 if (!mvotg->phy.otg->default_a) in a_bus_drop_store()
603 return -1; in a_bus_drop_store()
606 return -1; in a_bus_drop_store()
609 mvotg->otg_ctrl.a_bus_drop = 0; in a_bus_drop_store()
610 dev_dbg(&mvotg->pdev->dev, in a_bus_drop_store()
613 mvotg->otg_ctrl.a_bus_drop = 1; in a_bus_drop_store()
614 mvotg->otg_ctrl.a_bus_req = 0; in a_bus_drop_store()
615 dev_dbg(&mvotg->pdev->dev, in a_bus_drop_store()
617 dev_dbg(&mvotg->pdev->dev, in a_bus_drop_store()
621 if (spin_trylock(&mvotg->wq_lock)) { in a_bus_drop_store()
623 spin_unlock(&mvotg->wq_lock); in a_bus_drop_store()
652 if (mvotg->qwork) in mv_otg_remove()
653 destroy_workqueue(mvotg->qwork); in mv_otg_remove()
657 usb_remove_phy(&mvotg->phy); in mv_otg_remove()
662 struct mv_usb_platform_data *pdata = dev_get_platdata(&pdev->dev); in mv_otg_probe()
664 struct usb_otg *otg; in mv_otg_probe() local
669 dev_err(&pdev->dev, "failed to get platform data\n"); in mv_otg_probe()
670 return -ENODEV; in mv_otg_probe()
673 mvotg = devm_kzalloc(&pdev->dev, sizeof(*mvotg), GFP_KERNEL); in mv_otg_probe()
675 return -ENOMEM; in mv_otg_probe()
677 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in mv_otg_probe()
678 if (!otg) in mv_otg_probe()
679 return -ENOMEM; in mv_otg_probe()
683 mvotg->pdev = pdev; in mv_otg_probe()
684 mvotg->pdata = pdata; in mv_otg_probe()
686 mvotg->clk = devm_clk_get(&pdev->dev, NULL); in mv_otg_probe()
687 if (IS_ERR(mvotg->clk)) in mv_otg_probe()
688 return PTR_ERR(mvotg->clk); in mv_otg_probe()
690 mvotg->qwork = create_singlethread_workqueue("mv_otg_queue"); in mv_otg_probe()
691 if (!mvotg->qwork) { in mv_otg_probe()
692 dev_dbg(&pdev->dev, "cannot create workqueue for OTG\n"); in mv_otg_probe()
693 return -ENOMEM; in mv_otg_probe()
696 INIT_DELAYED_WORK(&mvotg->work, mv_otg_work); in mv_otg_probe()
698 /* OTG common part */ in mv_otg_probe()
699 mvotg->pdev = pdev; in mv_otg_probe()
700 mvotg->phy.dev = &pdev->dev; in mv_otg_probe()
701 mvotg->phy.otg = otg; in mv_otg_probe()
702 mvotg->phy.label = driver_name; in mv_otg_probe()
704 otg->state = OTG_STATE_UNDEFINED; in mv_otg_probe()
705 otg->usb_phy = &mvotg->phy; in mv_otg_probe()
706 otg->set_host = mv_otg_set_host; in mv_otg_probe()
707 otg->set_peripheral = mv_otg_set_peripheral; in mv_otg_probe()
708 otg->set_vbus = mv_otg_set_vbus; in mv_otg_probe()
711 timer_setup(&mvotg->otg_ctrl.timer[i], in mv_otg_probe()
714 r = platform_get_resource_byname(mvotg->pdev, in mv_otg_probe()
717 dev_err(&pdev->dev, "no phy I/O memory resource defined\n"); in mv_otg_probe()
718 retval = -ENODEV; in mv_otg_probe()
722 mvotg->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r)); in mv_otg_probe()
723 if (mvotg->phy_regs == NULL) { in mv_otg_probe()
724 dev_err(&pdev->dev, "failed to map phy I/O memory\n"); in mv_otg_probe()
725 retval = -EFAULT; in mv_otg_probe()
729 r = platform_get_resource_byname(mvotg->pdev, in mv_otg_probe()
732 dev_err(&pdev->dev, "no I/O memory resource defined\n"); in mv_otg_probe()
733 retval = -ENODEV; in mv_otg_probe()
737 mvotg->cap_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r)); in mv_otg_probe()
738 if (mvotg->cap_regs == NULL) { in mv_otg_probe()
739 dev_err(&pdev->dev, "failed to map I/O memory\n"); in mv_otg_probe()
740 retval = -EFAULT; in mv_otg_probe()
747 dev_err(&pdev->dev, "mv otg enable error %d\n", retval); in mv_otg_probe()
751 mvotg->op_regs = in mv_otg_probe()
752 (struct mv_otg_regs __iomem *) ((unsigned long) mvotg->cap_regs in mv_otg_probe()
753 + (readl(mvotg->cap_regs) & CAPLENGTH_MASK)); in mv_otg_probe()
755 if (pdata->id) { in mv_otg_probe()
756 retval = devm_request_threaded_irq(&pdev->dev, pdata->id->irq, in mv_otg_probe()
758 IRQF_ONESHOT, "id", mvotg); in mv_otg_probe()
760 dev_info(&pdev->dev, in mv_otg_probe()
761 "Failed to request irq for ID\n"); in mv_otg_probe()
762 pdata->id = NULL; in mv_otg_probe()
766 if (pdata->vbus) { in mv_otg_probe()
767 mvotg->clock_gating = 1; in mv_otg_probe()
768 retval = devm_request_threaded_irq(&pdev->dev, pdata->vbus->irq, in mv_otg_probe()
772 dev_info(&pdev->dev, in mv_otg_probe()
775 mvotg->clock_gating = 0; in mv_otg_probe()
776 pdata->vbus = NULL; in mv_otg_probe()
780 if (pdata->disable_otg_clock_gating) in mv_otg_probe()
781 mvotg->clock_gating = 0; in mv_otg_probe()
786 r = platform_get_resource(mvotg->pdev, IORESOURCE_IRQ, 0); in mv_otg_probe()
788 dev_err(&pdev->dev, "no IRQ resource defined\n"); in mv_otg_probe()
789 retval = -ENODEV; in mv_otg_probe()
793 mvotg->irq = r->start; in mv_otg_probe()
794 if (devm_request_irq(&pdev->dev, mvotg->irq, mv_otg_irq, IRQF_SHARED, in mv_otg_probe()
796 dev_err(&pdev->dev, "Request irq %d for OTG failed\n", in mv_otg_probe()
797 mvotg->irq); in mv_otg_probe()
798 mvotg->irq = 0; in mv_otg_probe()
799 retval = -ENODEV; in mv_otg_probe()
803 retval = usb_add_phy(&mvotg->phy, USB_PHY_TYPE_USB2); in mv_otg_probe()
805 dev_err(&pdev->dev, "can't register transceiver, %d\n", in mv_otg_probe()
810 spin_lock_init(&mvotg->wq_lock); in mv_otg_probe()
811 if (spin_trylock(&mvotg->wq_lock)) { in mv_otg_probe()
813 spin_unlock(&mvotg->wq_lock); in mv_otg_probe()
816 dev_info(&pdev->dev, in mv_otg_probe()
817 "successful probe OTG device %s clock gating.\n", in mv_otg_probe()
818 mvotg->clock_gating ? "with" : "without"); in mv_otg_probe()
825 destroy_workqueue(mvotg->qwork); in mv_otg_probe()
835 if (mvotg->phy.otg->state != OTG_STATE_B_IDLE) { in mv_otg_suspend()
836 dev_info(&pdev->dev, in mv_otg_suspend()
837 "OTG state is not B_IDLE, it is %d!\n", in mv_otg_suspend()
838 mvotg->phy.otg->state); in mv_otg_suspend()
839 return -EAGAIN; in mv_otg_suspend()
842 if (!mvotg->clock_gating) in mv_otg_suspend()
853 if (!mvotg->clock_gating) { in mv_otg_resume()
856 otgsc = readl(&mvotg->op_regs->otgsc); in mv_otg_resume()
857 otgsc |= mvotg->irq_en; in mv_otg_resume()
858 writel(otgsc, &mvotg->op_regs->otgsc); in mv_otg_resume()
860 if (spin_trylock(&mvotg->wq_lock)) { in mv_otg_resume()
862 spin_unlock(&mvotg->wq_lock); in mv_otg_resume()