summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:41 +0200
commitd2bb6342d6a812f3ff0dcf17180c0b01b85cacfb (patch)
tree662664ac398af8749af7f3c69bb298394a0fc057 /drivers/usb
parente9299c644a17b7ae6a91d3a4b6ccdd9acba443fe (diff)
parent8fc0a99f32ea083b2e0eee217c813cf36aa8c521 (diff)
downloadbarebox-d2bb6342d6a812f3ff0dcf17180c0b01b85cacfb.tar.gz
barebox-d2bb6342d6a812f3ff0dcf17180c0b01b85cacfb.tar.xz
Merge branch 'for-next/misc' into master
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc2/dwc2.c16
-rw-r--r--drivers/usb/dwc2/dwc2.h4
-rw-r--r--drivers/usb/dwc2/gadget.c6
-rw-r--r--drivers/usb/dwc2/host.c13
-rw-r--r--drivers/usb/musb/musb_host.c4
5 files changed, 27 insertions, 16 deletions
diff --git a/drivers/usb/dwc2/dwc2.c b/drivers/usb/dwc2/dwc2.c
index 908d624794..282e6754b0 100644
--- a/drivers/usb/dwc2/dwc2.c
+++ b/drivers/usb/dwc2/dwc2.c
@@ -15,19 +15,6 @@
#include "dwc2.h"
-static void dwc2_uninit_common(struct dwc2 *dwc2)
-{
- uint32_t hprt0;
-
- hprt0 = dwc2_readl(dwc2, HPRT0);
-
- /* Put everything in reset. */
- hprt0 &= ~(HPRT0_ENA | HPRT0_ENACHG | HPRT0_CONNDET | HPRT0_OVRCURRCHG);
- hprt0 |= HPRT0_RST;
-
- dwc2_writel(dwc2, hprt0, HPRT0);
-}
-
static int dwc2_set_mode(void *ctx, enum usb_dr_mode mode)
{
struct dwc2 *dwc2 = ctx;
@@ -98,7 +85,8 @@ static void dwc2_remove(struct device_d *dev)
{
struct dwc2 *dwc2 = dev->priv;
- dwc2_uninit_common(dwc2);
+ dwc2_host_uninit(dwc2);
+ dwc2_gadget_uninit(dwc2);
}
static const struct of_device_id dwc2_platform_dt_ids[] = {
diff --git a/drivers/usb/dwc2/dwc2.h b/drivers/usb/dwc2/dwc2.h
index 5e845f3491..30ad906656 100644
--- a/drivers/usb/dwc2/dwc2.h
+++ b/drivers/usb/dwc2/dwc2.h
@@ -34,13 +34,17 @@ int dwc2_submit_roothub(struct dwc2 *dwc2, struct usb_device *dev,
unsigned long pipe, void *buf, int len,
struct devrequest *setup);
int dwc2_register_host(struct dwc2 *dwc2);
+void dwc2_host_uninit(struct dwc2 *dwc2);
#else
static inline int dwc2_register_host(struct dwc2 *dwc2) { return -ENODEV; }
+static inline void dwc2_host_uninit(struct dwc2 *dwc2) {};
#endif
/* Gadget functions */
#ifdef CONFIG_USB_DWC2_GADGET
int dwc2_gadget_init(struct dwc2 *dwc2);
+void dwc2_gadget_uninit(struct dwc2 *dwc2);
#else
static inline int dwc2_gadget_init(struct dwc2 *dwc2) { return -ENODEV; }
+static inline void dwc2_gadget_uninit(struct dwc2 *dwc2) {};
#endif
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 6a65b9b117..aa7447c9b4 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2734,3 +2734,9 @@ int dwc2_gadget_init(struct dwc2 *dwc2)
return 0;
}
+
+void dwc2_gadget_uninit(struct dwc2 *dwc2)
+{
+ dwc2_core_disconnect(dwc2);
+ dwc2_gadget_disconnect(dwc2);
+}
diff --git a/drivers/usb/dwc2/host.c b/drivers/usb/dwc2/host.c
index 13cb3472d7..510a07dfb9 100644
--- a/drivers/usb/dwc2/host.c
+++ b/drivers/usb/dwc2/host.c
@@ -788,3 +788,16 @@ int dwc2_register_host(struct dwc2 *dwc2)
return usb_register_host(host);
}
+
+void dwc2_host_uninit(struct dwc2 *dwc2)
+{
+ uint32_t hprt0;
+
+ hprt0 = dwc2_readl(dwc2, HPRT0);
+
+ /* Put everything in reset. */
+ hprt0 &= ~(HPRT0_ENA | HPRT0_ENACHG | HPRT0_CONNDET | HPRT0_OVRCURRCHG);
+ hprt0 |= HPRT0_RST;
+
+ dwc2_writel(dwc2, hprt0, HPRT0);
+}
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 68d819af2c..be9651b049 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1189,8 +1189,8 @@ void musb_host_rx(struct musb *musb, u8 epnum)
pipe = urb->pipe;
- dev_dbg(musb->controller, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)\n",
- epnum, rx_csr, urb->actual_length, 0);
+ dev_dbg(musb->controller, "<== hw %d rxcsr %04x, urb actual %d (+dma 0)\n",
+ epnum, rx_csr, urb->actual_length);
/* check for errors, concurrent stall & unlink is not really
* handled yet! */