Patchwork [U-Boot,01/17] usb: mv_udc: Unbreak the mv_udc driver

login
register
mail settings
Submitter Marek Vasut
Date July 10, 2013, 1:16 a.m.
Message ID <1373419003-10919-2-git-send-email-marex@denx.de>
Download mbox | patch
Permalink /patch/257935/
State Awaiting Upstream
Delegated to: Marek Vasut
Headers show

Comments

Marek Vasut - July 10, 2013, 1:16 a.m.
The mv_udc driver is broken for a while and doesn't even compile.
This patch fixes the issues and gets the driver into working state
again. This driver was tested on Freescale i.MX233/i.MX28 .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Lei Wen <leiwen@marvell.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Stefano Babic <sbabic@denx.de>
---
 drivers/serial/usbtty.h           |    2 ++
 drivers/usb/gadget/gadget_chips.h |    2 +-
 drivers/usb/gadget/mv_udc.c       |    7 ++++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index eb670da..4a0bd45 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -35,6 +35,8 @@ 
 #include <usb/pxa27x_udc.h>
 #elif defined(CONFIG_DW_UDC)
 #include <usb/designware_udc.h>
+#elif defined(CONFIG_MV_UDC)
+#include <usb/mv_udc.h>
 #endif
 
 #include <version.h>
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index e570142..6953174 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -144,7 +144,7 @@ 
 #define	gadget_is_m66592(g)	0
 #endif
 
-#ifdef CONFIG_USB_GADGET_MV
+#ifdef CONFIG_MV_UDC
 #define gadget_is_mv(g)        (!strcmp("mv_udc", (g)->name))
 #else
 #define gadget_is_mv(g)        0
diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index cdbdcfa..db30bdd 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -33,6 +33,10 @@ 
 #include <linux/types.h>
 #include <usb/mv_udc.h>
 
+#if CONFIG_USB_MAX_CONTROLLER_COUNT > 1
+#error This driver only supports one single controller.
+#endif
+
 #ifndef DEBUG
 #define DBG(x...) do {} while (0)
 #else
@@ -469,6 +473,7 @@  int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 {
 	struct mv_udc *udc = controller.udc;
 	int             retval;
+	void *ctrl;
 
 	if (!driver
 			|| driver->speed < USB_SPEED_FULL
@@ -479,7 +484,7 @@  int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 	}
 
 	if (!mvudc_probe()) {
-		usb_lowlevel_init();
+		usb_lowlevel_init(0, &ctrl);
 		/* select ULPI phy */
 		writel(PTS(PTS_ENABLE) | PFSC, &udc->portsc);
 	}