From a7eafcfe45427235804ef60e9983a84fbce3ea07 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 10 Jul 2013 03:16:27 +0200 Subject: usb: mv_udc: Unbreak the mv_udc driver 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 Cc: Fabio Estevam Cc: Lei Wen Cc: Otavio Salvador Cc: Stefano Babic --- drivers/usb/gadget/gadget_chips.h | 2 +- drivers/usb/gadget/mv_udc.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/usb') diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index f038747..aa54b85 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 7fa5288..93e5389 100644 --- a/drivers/usb/gadget/mv_udc.c +++ b/drivers/usb/gadget/mv_udc.c @@ -17,6 +17,10 @@ #include #include +#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 @@ -453,6 +457,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 @@ -463,7 +468,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); } -- cgit v1.1