[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a27f7de13d9b1e1ba83fcfb4ec978596bc96f8ca.1473302184.git.johnyoun@synopsys.com>
Date: Wed, 07 Sep 2016 19:39:37 -0700
From: John Youn <johnyoun@...opsys.com>
To: linux-kernel@...r.kernel.org
Cc: Doug Anderson <dianders@...omium.org>
Subject: [PATCH v5 1/3] 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.
Tested-by: Heiko Stuebner <heiko@...ech.de>
Tested-by: Stefan Wahren <stefan.wahren@...e.com>
Signed-off-by: John Youn <johnyoun@...opsys.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
Powered by blists - more mailing lists