mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
UPSTREAM: usb: dwc2: gadget: Only initialize device if in device mode
In dwc2_hsotg_udc_start(), don't initialize the controller for device
mode unless we are actually in device mode.
Change-Id: I6cb115683fc172987928d3e0ea4c2c03cf2b0706
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit d0f0ac56b3)
This commit is contained in:
@@ -3467,8 +3467,11 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget,
|
||||
otg_set_peripheral(hsotg->uphy->otg, &hsotg->gadget);
|
||||
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
dwc2_hsotg_init(hsotg);
|
||||
dwc2_hsotg_core_init_disconnected(hsotg, false);
|
||||
if (dwc2_hw_is_device(hsotg)) {
|
||||
dwc2_hsotg_init(hsotg);
|
||||
dwc2_hsotg_core_init_disconnected(hsotg, false);
|
||||
}
|
||||
|
||||
hsotg->enabled = 0;
|
||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user