diff options
Diffstat (limited to 'drivers/usb/gadget/omap_udc.c')
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index f81e4f025f23..82fd24935332 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/usb/otg.h> | 44 | #include <linux/usb/otg.h> |
45 | #include <linux/dma-mapping.h> | 45 | #include <linux/dma-mapping.h> |
46 | #include <linux/clk.h> | 46 | #include <linux/clk.h> |
47 | #include <linux/prefetch.h> | ||
47 | 48 | ||
48 | #include <asm/byteorder.h> | 49 | #include <asm/byteorder.h> |
49 | #include <asm/io.h> | 50 | #include <asm/io.h> |
@@ -54,7 +55,6 @@ | |||
54 | 55 | ||
55 | #include <plat/dma.h> | 56 | #include <plat/dma.h> |
56 | #include <plat/usb.h> | 57 | #include <plat/usb.h> |
57 | #include <plat/control.h> | ||
58 | 58 | ||
59 | #include "omap_udc.h" | 59 | #include "omap_udc.h" |
60 | 60 | ||
@@ -2102,7 +2102,8 @@ static inline int machine_without_vbus_sense(void) | |||
2102 | ); | 2102 | ); |
2103 | } | 2103 | } |
2104 | 2104 | ||
2105 | int usb_gadget_register_driver (struct usb_gadget_driver *driver) | 2105 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
2106 | int (*bind)(struct usb_gadget *)) | ||
2106 | { | 2107 | { |
2107 | int status = -ENODEV; | 2108 | int status = -ENODEV; |
2108 | struct omap_ep *ep; | 2109 | struct omap_ep *ep; |
@@ -2114,8 +2115,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
2114 | if (!driver | 2115 | if (!driver |
2115 | // FIXME if otg, check: driver->is_otg | 2116 | // FIXME if otg, check: driver->is_otg |
2116 | || driver->speed < USB_SPEED_FULL | 2117 | || driver->speed < USB_SPEED_FULL |
2117 | || !driver->bind | 2118 | || !bind || !driver->setup) |
2118 | || !driver->setup) | ||
2119 | return -EINVAL; | 2119 | return -EINVAL; |
2120 | 2120 | ||
2121 | spin_lock_irqsave(&udc->lock, flags); | 2121 | spin_lock_irqsave(&udc->lock, flags); |
@@ -2145,7 +2145,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
2145 | if (udc->dc_clk != NULL) | 2145 | if (udc->dc_clk != NULL) |
2146 | omap_udc_enable_clock(1); | 2146 | omap_udc_enable_clock(1); |
2147 | 2147 | ||
2148 | status = driver->bind (&udc->gadget); | 2148 | status = bind(&udc->gadget); |
2149 | if (status) { | 2149 | if (status) { |
2150 | DBG("bind to %s --> %d\n", driver->driver.name, status); | 2150 | DBG("bind to %s --> %d\n", driver->driver.name, status); |
2151 | udc->gadget.dev.driver = NULL; | 2151 | udc->gadget.dev.driver = NULL; |
@@ -2186,7 +2186,7 @@ done: | |||
2186 | omap_udc_enable_clock(0); | 2186 | omap_udc_enable_clock(0); |
2187 | return status; | 2187 | return status; |
2188 | } | 2188 | } |
2189 | EXPORT_SYMBOL(usb_gadget_register_driver); | 2189 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
2190 | 2190 | ||
2191 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) | 2191 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) |
2192 | { | 2192 | { |
@@ -2309,21 +2309,12 @@ static char *trx_mode(unsigned m, int enabled) | |||
2309 | static int proc_otg_show(struct seq_file *s) | 2309 | static int proc_otg_show(struct seq_file *s) |
2310 | { | 2310 | { |
2311 | u32 tmp; | 2311 | u32 tmp; |
2312 | u32 trans; | 2312 | u32 trans = 0; |
2313 | char *ctrl_name; | 2313 | char *ctrl_name = "(UNKNOWN)"; |
2314 | 2314 | ||
2315 | /* XXX This needs major revision for OMAP2+ */ | ||
2315 | tmp = omap_readl(OTG_REV); | 2316 | tmp = omap_readl(OTG_REV); |
2316 | if (cpu_is_omap24xx()) { | 2317 | if (cpu_class_is_omap1()) { |
2317 | /* | ||
2318 | * REVISIT: Not clear how this works on OMAP2. trans | ||
2319 | * is ANDed to produce bits 7 and 8, which might make | ||
2320 | * sense for USB_TRANSCEIVER_CTRL on OMAP1, | ||
2321 | * but with CONTROL_DEVCONF, these bits have something to | ||
2322 | * do with the frame adjustment counter and McBSP2. | ||
2323 | */ | ||
2324 | ctrl_name = "control_devconf"; | ||
2325 | trans = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
2326 | } else { | ||
2327 | ctrl_name = "tranceiver_ctrl"; | 2318 | ctrl_name = "tranceiver_ctrl"; |
2328 | trans = omap_readw(USB_TRANSCEIVER_CTRL); | 2319 | trans = omap_readw(USB_TRANSCEIVER_CTRL); |
2329 | } | 2320 | } |