[<prev] [next>] [day] [month] [year] [list]
Message-Id: <db6f89882b40cfbefd5c6d7281f30742774fbd15.1618464534.git.Arthur.Petrosyan@synopsys.com>
Date: Thu, 15 Apr 2021 09:39:35 +0400
From: Artur Petrosyan <Arthur.Petrosyan@...opsys.com>
To: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: John Youn <John.Youn@...opsys.com>,
Artur Petrosyan <Arthur.Petrosyan@...opsys.com>,
Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
Subject: [PATCH 02/15] usb: dwc2: Reset DEVADDR after exiting gadget hibernation.
Initially resetting device address was done in dwc2_hsotg_irq()
interrupt handler. However, when core is hibernated USB RESET
is not handled in dwc2_hsotg_irq() handler, instead USB RESET
interrupt is handled in dwc2_handle_gpwrdn_intr() handler.
- Added reset device address to zero when core exits from gadget
hibernation.
Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@...opsys.com>
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
---
drivers/usb/dwc2/gadget.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 2f50f3e62caa..e6bb1bdb2760 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -5305,6 +5305,10 @@ int dwc2_gadget_exit_hibernation(struct dwc2_hsotg *hsotg,
dwc2_writel(hsotg, dr->dcfg, DCFG);
dwc2_writel(hsotg, dr->dctl, DCTL);
+ /* On USB Reset, reset device address to zero */
+ if (reset)
+ dwc2_clear_bit(hsotg, DCFG, DCFG_DEVADDR_MASK);
+
/* De-assert Wakeup Logic */
gpwrdn = dwc2_readl(hsotg, GPWRDN);
gpwrdn &= ~GPWRDN_PMUACTV;
--
2.25.1
Powered by blists - more mailing lists