usb: musb-new: Add support for DM_USB
Enable DM for USB peripheral in the musb-new driver.
Also make sure that the driver can be used in the SPL.
This implies that:
* the driver must work with and without the OF_CONTROL option. That
in turn, implies that the platform data can be passed in a struct
ti_musb_platdata or be read from the dtb
* usb.o is linked in the SPL if host support is enabled
Another change is that the driver does not fail to bind (and stop the boot
process) if one of the child driver does not bind. Reporting the error is
enough. This kind of error would appear if the port is configured in the
DTS but the driver is not activated in the config.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/drivers/usb/musb-new/musb_gadget.c b/drivers/usb/musb-new/musb_gadget.c
index 8b6cec1..b35d33f 100644
--- a/drivers/usb/musb-new/musb_gadget.c
+++ b/drivers/usb/musb-new/musb_gadget.c
@@ -1775,6 +1775,14 @@
struct usb_gadget_driver *driver);
static int musb_gadget_stop(struct usb_gadget *g,
struct usb_gadget_driver *driver);
+#else
+static int musb_gadget_stop(struct usb_gadget *g)
+{
+ struct musb *musb = gadget_to_musb(g);
+
+ musb_stop(musb);
+ return 0;
+}
#endif
static const struct usb_gadget_ops musb_gadget_operations = {
@@ -1787,6 +1795,9 @@
#ifndef __UBOOT__
.udc_start = musb_gadget_start,
.udc_stop = musb_gadget_stop,
+#else
+ .udc_start = musb_gadget_start,
+ .udc_stop = musb_gadget_stop,
#endif
};