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 <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>
This commit is contained in:
parent
9fab4bf4cc
commit
a7eafcfe45
|
@ -22,6 +22,8 @@
|
||||||
#include <usb/pxa27x_udc.h>
|
#include <usb/pxa27x_udc.h>
|
||||||
#elif defined(CONFIG_DW_UDC)
|
#elif defined(CONFIG_DW_UDC)
|
||||||
#include <usb/designware_udc.h>
|
#include <usb/designware_udc.h>
|
||||||
|
#elif defined(CONFIG_MV_UDC)
|
||||||
|
#include <usb/mv_udc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
#define gadget_is_m66592(g) 0
|
#define gadget_is_m66592(g) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_USB_GADGET_MV
|
#ifdef CONFIG_MV_UDC
|
||||||
#define gadget_is_mv(g) (!strcmp("mv_udc", (g)->name))
|
#define gadget_is_mv(g) (!strcmp("mv_udc", (g)->name))
|
||||||
#else
|
#else
|
||||||
#define gadget_is_mv(g) 0
|
#define gadget_is_mv(g) 0
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <usb/mv_udc.h>
|
#include <usb/mv_udc.h>
|
||||||
|
|
||||||
|
#if CONFIG_USB_MAX_CONTROLLER_COUNT > 1
|
||||||
|
#error This driver only supports one single controller.
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
#define DBG(x...) do {} while (0)
|
#define DBG(x...) do {} while (0)
|
||||||
#else
|
#else
|
||||||
|
@ -453,6 +457,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
|
||||||
{
|
{
|
||||||
struct mv_udc *udc = controller.udc;
|
struct mv_udc *udc = controller.udc;
|
||||||
int retval;
|
int retval;
|
||||||
|
void *ctrl;
|
||||||
|
|
||||||
if (!driver
|
if (!driver
|
||||||
|| driver->speed < USB_SPEED_FULL
|
|| driver->speed < USB_SPEED_FULL
|
||||||
|
@ -463,7 +468,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mvudc_probe()) {
|
if (!mvudc_probe()) {
|
||||||
usb_lowlevel_init();
|
usb_lowlevel_init(0, &ctrl);
|
||||||
/* select ULPI phy */
|
/* select ULPI phy */
|
||||||
writel(PTS(PTS_ENABLE) | PFSC, &udc->portsc);
|
writel(PTS(PTS_ENABLE) | PFSC, &udc->portsc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue