Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474616

[RFT PATCH v4 1/3] usb: dwc2: gadget: Only initialize device if in device mode

From John Youn <johnyoun@synopsys.com>
Newsgroups linux.kernel
Subject [RFT PATCH v4 1/3] usb: dwc2: gadget: Only initialize device if in device mode
Date 2016-09-01 23:20 +0200
Message-ID <scHyW-75a-27@gated-at.bofh.it> (permalink)
References <scHpf-70l-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


In dwc2_hsotg_udc_start(), don't initialize the controller for device
mode unless we are actually in device mode.

Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: John Youn <johnyoun@synopsys.com>
---
 drivers/usb/dwc2/gadget.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 94bd19a..4cd6403 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3466,8 +3466,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);
 
-- 
2.9.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays John Youn <johnyoun@synopsys.com> - 2016-09-01 23:10 +0200
  [RFT PATCH v4 1/3] usb: dwc2: gadget: Only initialize device if in device mode John Youn <johnyoun@synopsys.com> - 2016-09-01 23:20 +0200
  Re: [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode  delays Stefan Wahren <stefan.wahren@i2se.com> - 2016-09-06 23:50 +0200
    Re: [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays Felipe Balbi <balbi@kernel.org> - 2016-09-07 12:40 +0200

csiph-web