Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1365809
| From | John Youn <johnyoun@synopsys.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFT PATCH 2/4] usb: dwc2: gadget: Only initialize device if in device mode |
| Date | 2016-03-29 04:40 +0200 |
| Message-ID | <rhRJw-809-15@gated-at.bofh.it> (permalink) |
| References | <rhRJv-809-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
In dwc2_hsotg_udc_start(), don't initialize the controller for device
mode unless we are actually in device mode.
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 818f158..181080b 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3127,8 +3127,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.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFT PATCH 0/4] usb: dwc2: Fix core reset and force mode delay problems John Youn <johnyoun@synopsys.com> - 2016-03-29 04:40 +0200 [RFT PATCH 4/4] usb: dwc2: Properly account for the force mode delays John Youn <johnyoun@synopsys.com> - 2016-03-29 04:40 +0200 [RFT PATCH 1/4] usb: dwc2: do not override forced dr_mode in gadget setup John Youn <johnyoun@synopsys.com> - 2016-03-29 04:40 +0200 [RFT PATCH 2/4] usb: dwc2: gadget: Only initialize device if in device mode John Youn <johnyoun@synopsys.com> - 2016-03-29 04:40 +0200 [RFT PATCH 3/4] usb: dwc2: Add delay to core soft reset John Youn <johnyoun@synopsys.com> - 2016-03-29 04:40 +0200 Re: [RFT PATCH 0/4] usb: dwc2: Fix core reset and force mode delay problems Stefan Wahren <stefan.wahren@i2se.com> - 2016-03-31 11:00 +0200 Re: [RFT PATCH 0/4] usb: dwc2: Fix core reset and force mode delay problems Michael Niewoehner <linux@mniewoehner.de> - 2016-03-31 22:50 +0200 Re: [RFT PATCH 0/4] usb: dwc2: Fix core reset and force mode delay problems Michael Niewoehner <linux@mniewoehner.de> - 2016-03-31 23:50 +0200
csiph-web