diff options
author | Angus Ainslie <angus@akkea.ca> | 2022-02-02 15:08:55 -0800 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2022-02-16 16:52:56 +0100 |
commit | fb146fbc1ae551ce3bdb2966dd36a0b38e62b5dc (patch) | |
tree | 5aac1e3b57b44075830b3dd30a74632ccd8d83e0 | |
parent | c08db05455bcb2259849a096acf2e90cce258849 (diff) | |
download | u-boot-fb146fbc1ae551ce3bdb2966dd36a0b38e62b5dc.zip u-boot-fb146fbc1ae551ce3bdb2966dd36a0b38e62b5dc.tar.gz u-boot-fb146fbc1ae551ce3bdb2966dd36a0b38e62b5dc.tar.bz2 |
usb: dwc3: core: stop the core when it's removed
If u-boot doesn't stop the core when it's finished with it then
linux can't find it.
Signed-off-by: Angus Ainslie <angus@akkea.ca>
-rw-r--r-- | drivers/usb/dwc3/core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index ce1c0e8..b592a48 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -706,6 +706,14 @@ static void dwc3_gadget_run(struct dwc3 *dwc) mdelay(100); } +static void dwc3_core_stop(struct dwc3 *dwc) +{ + u32 reg; + + reg = dwc3_readl(dwc->regs, DWC3_DCTL); + dwc3_writel(dwc->regs, DWC3_DCTL, reg & ~(DWC3_DCTL_RUN_STOP)); +} + static void dwc3_core_exit_mode(struct dwc3 *dwc) { switch (dwc->dr_mode) { @@ -1128,6 +1136,7 @@ void dwc3_remove(struct dwc3 *dwc) dwc3_core_exit_mode(dwc); dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); + dwc3_core_stop(dwc); dwc3_core_exit(dwc); kfree(dwc->mem); } |