aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/Kconfig12
-rw-r--r--drivers/usb/gadget/Makefile2
-rw-r--r--drivers/usb/gadget/ether.c2
-rw-r--r--drivers/usb/gadget/gadget_chips.h4
-rw-r--r--drivers/usb/gadget/inode.c2
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c (renamed from drivers/usb/gadget/pxa2xx_udc.c)315
-rw-r--r--drivers/usb/gadget/pxa25x_udc.h (renamed from drivers/usb/gadget/pxa2xx_udc.h)29
-rw-r--r--drivers/usb/gadget/pxa27x_udc.c9
-rw-r--r--drivers/usb/gadget/pxa27x_udc.h8
-rw-r--r--drivers/usb/host/ohci-pxa27x.c3
10 files changed, 193 insertions, 193 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 3565d4352826..d6bab0d5f453 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -172,7 +172,7 @@ config USB_NET2280
172 default USB_GADGET 172 default USB_GADGET
173 select USB_GADGET_SELECTED 173 select USB_GADGET_SELECTED
174 174
175config USB_GADGET_PXA2XX 175config USB_GADGET_PXA25X
176 boolean "PXA 25x or IXP 4xx" 176 boolean "PXA 25x or IXP 4xx"
177 depends on (ARCH_PXA && PXA25x) || ARCH_IXP4XX 177 depends on (ARCH_PXA && PXA25x) || ARCH_IXP4XX
178 help 178 help
@@ -184,19 +184,19 @@ config USB_GADGET_PXA2XX
184 zero (for control transfers). 184 zero (for control transfers).
185 185
186 Say "y" to link the driver statically, or "m" to build a 186 Say "y" to link the driver statically, or "m" to build a
187 dynamically linked module called "pxa2xx_udc" and force all 187 dynamically linked module called "pxa25x_udc" and force all
188 gadget drivers to also be dynamically linked. 188 gadget drivers to also be dynamically linked.
189 189
190config USB_PXA2XX 190config USB_PXA25X
191 tristate 191 tristate
192 depends on USB_GADGET_PXA2XX 192 depends on USB_GADGET_PXA25X
193 default USB_GADGET 193 default USB_GADGET
194 select USB_GADGET_SELECTED 194 select USB_GADGET_SELECTED
195 195
196# if there's only one gadget driver, using only two bulk endpoints, 196# if there's only one gadget driver, using only two bulk endpoints,
197# don't waste memory for the other endpoints 197# don't waste memory for the other endpoints
198config USB_PXA2XX_SMALL 198config USB_PXA25X_SMALL
199 depends on USB_GADGET_PXA2XX 199 depends on USB_GADGET_PXA25X
200 bool 200 bool
201 default n if USB_ETH_RNDIS 201 default n if USB_ETH_RNDIS
202 default y if USB_ZERO 202 default y if USB_ZERO
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 12357255d740..e258afd25faf 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -8,7 +8,7 @@ endif
8obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o 8obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o
9obj-$(CONFIG_USB_NET2280) += net2280.o 9obj-$(CONFIG_USB_NET2280) += net2280.o
10obj-$(CONFIG_USB_AMD5536UDC) += amd5536udc.o 10obj-$(CONFIG_USB_AMD5536UDC) += amd5536udc.o
11obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o 11obj-$(CONFIG_USB_PXA25X) += pxa25x_udc.o
12obj-$(CONFIG_USB_PXA27X) += pxa27x_udc.o 12obj-$(CONFIG_USB_PXA27X) += pxa27x_udc.o
13obj-$(CONFIG_USB_GOKU) += goku_udc.o 13obj-$(CONFIG_USB_GOKU) += goku_udc.o
14obj-$(CONFIG_USB_OMAP) += omap_udc.o 14obj-$(CONFIG_USB_OMAP) += omap_udc.o
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 8d61ea67a817..4ce3950b997f 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -262,7 +262,7 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
262/* For CDC-incapable hardware, choose the simple cdc subset. 262/* For CDC-incapable hardware, choose the simple cdc subset.
263 * Anything that talks bulk (without notable bugs) can do this. 263 * Anything that talks bulk (without notable bugs) can do this.
264 */ 264 */
265#ifdef CONFIG_USB_GADGET_PXA2XX 265#ifdef CONFIG_USB_GADGET_PXA25X
266#define DEV_CONFIG_SUBSET 266#define DEV_CONFIG_SUBSET
267#endif 267#endif
268 268
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index f7f159c1002b..ca5149ea7312 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -29,8 +29,8 @@
29#define gadget_is_dummy(g) 0 29#define gadget_is_dummy(g) 0
30#endif 30#endif
31 31
32#ifdef CONFIG_USB_GADGET_PXA2XX 32#ifdef CONFIG_USB_GADGET_PXA25X
33#define gadget_is_pxa(g) !strcmp("pxa2xx_udc", (g)->name) 33#define gadget_is_pxa(g) !strcmp("pxa25x_udc", (g)->name)
34#else 34#else
35#define gadget_is_pxa(g) 0 35#define gadget_is_pxa(g) 0
36#endif 36#endif
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 69b0a2754f2a..f132a9219e11 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1501,7 +1501,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1501 } 1501 }
1502 break; 1502 break;
1503 1503
1504#ifndef CONFIG_USB_GADGET_PXA2XX 1504#ifndef CONFIG_USB_GADGET_PXA25X
1505 /* PXA automagically handles this request too */ 1505 /* PXA automagically handles this request too */
1506 case USB_REQ_GET_CONFIGURATION: 1506 case USB_REQ_GET_CONFIGURATION:
1507 if (ctrl->bRequestType != 0x80) 1507 if (ctrl->bRequestType != 0x80)
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 08f699b1fc57..5d50031938ab 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * linux/drivers/usb/gadget/pxa2xx_udc.c
3 * Intel PXA25x and IXP4xx on-chip full speed USB device controllers 2 * Intel PXA25x and IXP4xx on-chip full speed USB device controllers
4 * 3 *
5 * Copyright (C) 2002 Intrinsyc, Inc. (Frank Becker) 4 * Copyright (C) 2002 Intrinsyc, Inc. (Frank Becker)
@@ -46,19 +45,25 @@
46#include <linux/err.h> 45#include <linux/err.h>
47#include <linux/seq_file.h> 46#include <linux/seq_file.h>
48#include <linux/debugfs.h> 47#include <linux/debugfs.h>
48#include <linux/io.h>
49 49
50#include <asm/byteorder.h> 50#include <asm/byteorder.h>
51#include <asm/dma.h> 51#include <asm/dma.h>
52#include <asm/gpio.h> 52#include <asm/gpio.h>
53#include <asm/io.h>
54#include <asm/system.h> 53#include <asm/system.h>
55#include <asm/mach-types.h> 54#include <asm/mach-types.h>
56#include <asm/unaligned.h> 55#include <asm/unaligned.h>
57#include <asm/hardware.h>
58 56
59#include <linux/usb/ch9.h> 57#include <linux/usb/ch9.h>
60#include <linux/usb/gadget.h> 58#include <linux/usb/gadget.h>
61 59
60/*
61 * This driver is PXA25x only. Grab the right register definitions.
62 */
63#ifdef CONFIG_ARCH_PXA
64#include <asm/arch/pxa25x-udc.h>
65#endif
66
62#include <asm/mach/udc_pxa2xx.h> 67#include <asm/mach/udc_pxa2xx.h>
63 68
64 69
@@ -91,7 +96,7 @@
91#define DRIVER_DESC "PXA 25x USB Device Controller driver" 96#define DRIVER_DESC "PXA 25x USB Device Controller driver"
92 97
93 98
94static const char driver_name [] = "pxa2xx_udc"; 99static const char driver_name [] = "pxa25x_udc";
95 100
96static const char ep0name [] = "ep0"; 101static const char ep0name [] = "ep0";
97 102
@@ -111,10 +116,10 @@ static const char ep0name [] = "ep0";
111 116
112#endif 117#endif
113 118
114#include "pxa2xx_udc.h" 119#include "pxa25x_udc.h"
115 120
116 121
117#ifdef CONFIG_USB_PXA2XX_SMALL 122#ifdef CONFIG_USB_PXA25X_SMALL
118#define SIZE_STR " (small)" 123#define SIZE_STR " (small)"
119#else 124#else
120#define SIZE_STR "" 125#define SIZE_STR ""
@@ -126,8 +131,8 @@ static const char ep0name [] = "ep0";
126 * --------------------------------------------------------------------------- 131 * ---------------------------------------------------------------------------
127 */ 132 */
128 133
129static void pxa2xx_ep_fifo_flush (struct usb_ep *ep); 134static void pxa25x_ep_fifo_flush (struct usb_ep *ep);
130static void nuke (struct pxa2xx_ep *, int status); 135static void nuke (struct pxa25x_ep *, int status);
131 136
132/* one GPIO should be used to detect VBUS from the host */ 137/* one GPIO should be used to detect VBUS from the host */
133static int is_vbus_present(void) 138static int is_vbus_present(void)
@@ -147,9 +152,10 @@ static int is_vbus_present(void)
147static void pullup_off(void) 152static void pullup_off(void)
148{ 153{
149 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 154 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
155 int off_level = mach->gpio_pullup_inverted;
150 156
151 if (mach->gpio_pullup) 157 if (mach->gpio_pullup)
152 gpio_set_value(mach->gpio_pullup, 0); 158 gpio_set_value(mach->gpio_pullup, off_level);
153 else if (mach->udc_command) 159 else if (mach->udc_command)
154 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); 160 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
155} 161}
@@ -157,9 +163,10 @@ static void pullup_off(void)
157static void pullup_on(void) 163static void pullup_on(void)
158{ 164{
159 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 165 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
166 int on_level = !mach->gpio_pullup_inverted;
160 167
161 if (mach->gpio_pullup) 168 if (mach->gpio_pullup)
162 gpio_set_value(mach->gpio_pullup, 1); 169 gpio_set_value(mach->gpio_pullup, on_level);
163 else if (mach->udc_command) 170 else if (mach->udc_command)
164 mach->udc_command(PXA2XX_UDC_CMD_CONNECT); 171 mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
165} 172}
@@ -212,24 +219,24 @@ static inline void udc_ack_int_UDCCR(int mask)
212/* 219/*
213 * endpoint enable/disable 220 * endpoint enable/disable
214 * 221 *
215 * we need to verify the descriptors used to enable endpoints. since pxa2xx 222 * we need to verify the descriptors used to enable endpoints. since pxa25x
216 * endpoint configurations are fixed, and are pretty much always enabled, 223 * endpoint configurations are fixed, and are pretty much always enabled,
217 * there's not a lot to manage here. 224 * there's not a lot to manage here.
218 * 225 *
219 * because pxa2xx can't selectively initialize bulk (or interrupt) endpoints, 226 * because pxa25x can't selectively initialize bulk (or interrupt) endpoints,
220 * (resetting endpoint halt and toggle), SET_INTERFACE is unusable except 227 * (resetting endpoint halt and toggle), SET_INTERFACE is unusable except
221 * for a single interface (with only the default altsetting) and for gadget 228 * for a single interface (with only the default altsetting) and for gadget
222 * drivers that don't halt endpoints (not reset by set_interface). that also 229 * drivers that don't halt endpoints (not reset by set_interface). that also
223 * means that if you use ISO, you must violate the USB spec rule that all 230 * means that if you use ISO, you must violate the USB spec rule that all
224 * iso endpoints must be in non-default altsettings. 231 * iso endpoints must be in non-default altsettings.
225 */ 232 */
226static int pxa2xx_ep_enable (struct usb_ep *_ep, 233static int pxa25x_ep_enable (struct usb_ep *_ep,
227 const struct usb_endpoint_descriptor *desc) 234 const struct usb_endpoint_descriptor *desc)
228{ 235{
229 struct pxa2xx_ep *ep; 236 struct pxa25x_ep *ep;
230 struct pxa2xx_udc *dev; 237 struct pxa25x_udc *dev;
231 238
232 ep = container_of (_ep, struct pxa2xx_ep, ep); 239 ep = container_of (_ep, struct pxa25x_ep, ep);
233 if (!_ep || !desc || ep->desc || _ep->name == ep0name 240 if (!_ep || !desc || ep->desc || _ep->name == ep0name
234 || desc->bDescriptorType != USB_DT_ENDPOINT 241 || desc->bDescriptorType != USB_DT_ENDPOINT
235 || ep->bEndpointAddress != desc->bEndpointAddress 242 || ep->bEndpointAddress != desc->bEndpointAddress
@@ -268,7 +275,7 @@ static int pxa2xx_ep_enable (struct usb_ep *_ep,
268 ep->ep.maxpacket = le16_to_cpu (desc->wMaxPacketSize); 275 ep->ep.maxpacket = le16_to_cpu (desc->wMaxPacketSize);
269 276
270 /* flush fifo (mostly for OUT buffers) */ 277 /* flush fifo (mostly for OUT buffers) */
271 pxa2xx_ep_fifo_flush (_ep); 278 pxa25x_ep_fifo_flush (_ep);
272 279
273 /* ... reset halt state too, if we could ... */ 280 /* ... reset halt state too, if we could ... */
274 281
@@ -276,12 +283,12 @@ static int pxa2xx_ep_enable (struct usb_ep *_ep,
276 return 0; 283 return 0;
277} 284}
278 285
279static int pxa2xx_ep_disable (struct usb_ep *_ep) 286static int pxa25x_ep_disable (struct usb_ep *_ep)
280{ 287{
281 struct pxa2xx_ep *ep; 288 struct pxa25x_ep *ep;
282 unsigned long flags; 289 unsigned long flags;
283 290
284 ep = container_of (_ep, struct pxa2xx_ep, ep); 291 ep = container_of (_ep, struct pxa25x_ep, ep);
285 if (!_ep || !ep->desc) { 292 if (!_ep || !ep->desc) {
286 DMSG("%s, %s not enabled\n", __func__, 293 DMSG("%s, %s not enabled\n", __func__,
287 _ep ? ep->ep.name : NULL); 294 _ep ? ep->ep.name : NULL);
@@ -292,7 +299,7 @@ static int pxa2xx_ep_disable (struct usb_ep *_ep)
292 nuke (ep, -ESHUTDOWN); 299 nuke (ep, -ESHUTDOWN);
293 300
294 /* flush fifo (mostly for IN buffers) */ 301 /* flush fifo (mostly for IN buffers) */
295 pxa2xx_ep_fifo_flush (_ep); 302 pxa25x_ep_fifo_flush (_ep);
296 303
297 ep->desc = NULL; 304 ep->desc = NULL;
298 ep->stopped = 1; 305 ep->stopped = 1;
@@ -304,18 +311,18 @@ static int pxa2xx_ep_disable (struct usb_ep *_ep)
304 311
305/*-------------------------------------------------------------------------*/ 312/*-------------------------------------------------------------------------*/
306 313
307/* for the pxa2xx, these can just wrap kmalloc/kfree. gadget drivers 314/* for the pxa25x, these can just wrap kmalloc/kfree. gadget drivers
308 * must still pass correctly initialized endpoints, since other controller 315 * must still pass correctly initialized endpoints, since other controller
309 * drivers may care about how it's currently set up (dma issues etc). 316 * drivers may care about how it's currently set up (dma issues etc).
310 */ 317 */
311 318
312/* 319/*
313 * pxa2xx_ep_alloc_request - allocate a request data structure 320 * pxa25x_ep_alloc_request - allocate a request data structure
314 */ 321 */
315static struct usb_request * 322static struct usb_request *
316pxa2xx_ep_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags) 323pxa25x_ep_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags)
317{ 324{
318 struct pxa2xx_request *req; 325 struct pxa25x_request *req;
319 326
320 req = kzalloc(sizeof(*req), gfp_flags); 327 req = kzalloc(sizeof(*req), gfp_flags);
321 if (!req) 328 if (!req)
@@ -327,14 +334,14 @@ pxa2xx_ep_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags)
327 334
328 335
329/* 336/*
330 * pxa2xx_ep_free_request - deallocate a request data structure 337 * pxa25x_ep_free_request - deallocate a request data structure
331 */ 338 */
332static void 339static void
333pxa2xx_ep_free_request (struct usb_ep *_ep, struct usb_request *_req) 340pxa25x_ep_free_request (struct usb_ep *_ep, struct usb_request *_req)
334{ 341{
335 struct pxa2xx_request *req; 342 struct pxa25x_request *req;
336 343
337 req = container_of (_req, struct pxa2xx_request, req); 344 req = container_of (_req, struct pxa25x_request, req);
338 WARN_ON (!list_empty (&req->queue)); 345 WARN_ON (!list_empty (&req->queue));
339 kfree(req); 346 kfree(req);
340} 347}
@@ -344,7 +351,7 @@ pxa2xx_ep_free_request (struct usb_ep *_ep, struct usb_request *_req)
344/* 351/*
345 * done - retire a request; caller blocked irqs 352 * done - retire a request; caller blocked irqs
346 */ 353 */
347static void done(struct pxa2xx_ep *ep, struct pxa2xx_request *req, int status) 354static void done(struct pxa25x_ep *ep, struct pxa25x_request *req, int status)
348{ 355{
349 unsigned stopped = ep->stopped; 356 unsigned stopped = ep->stopped;
350 357
@@ -367,13 +374,13 @@ static void done(struct pxa2xx_ep *ep, struct pxa2xx_request *req, int status)
367} 374}
368 375
369 376
370static inline void ep0_idle (struct pxa2xx_udc *dev) 377static inline void ep0_idle (struct pxa25x_udc *dev)
371{ 378{
372 dev->ep0state = EP0_IDLE; 379 dev->ep0state = EP0_IDLE;
373} 380}
374 381
375static int 382static int
376write_packet(volatile u32 *uddr, struct pxa2xx_request *req, unsigned max) 383write_packet(volatile u32 *uddr, struct pxa25x_request *req, unsigned max)
377{ 384{
378 u8 *buf; 385 u8 *buf;
379 unsigned length, count; 386 unsigned length, count;
@@ -398,7 +405,7 @@ write_packet(volatile u32 *uddr, struct pxa2xx_request *req, unsigned max)
398 * caller guarantees at least one packet buffer is ready (or a zlp). 405 * caller guarantees at least one packet buffer is ready (or a zlp).
399 */ 406 */
400static int 407static int
401write_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req) 408write_fifo (struct pxa25x_ep *ep, struct pxa25x_request *req)
402{ 409{
403 unsigned max; 410 unsigned max;
404 411
@@ -455,7 +462,7 @@ write_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
455 * ep0 data stage. these chips want very simple state transitions. 462 * ep0 data stage. these chips want very simple state transitions.
456 */ 463 */
457static inline 464static inline
458void ep0start(struct pxa2xx_udc *dev, u32 flags, const char *tag) 465void ep0start(struct pxa25x_udc *dev, u32 flags, const char *tag)
459{ 466{
460 UDCCS0 = flags|UDCCS0_SA|UDCCS0_OPR; 467 UDCCS0 = flags|UDCCS0_SA|UDCCS0_OPR;
461 USIR0 = USIR0_IR0; 468 USIR0 = USIR0_IR0;
@@ -465,7 +472,7 @@ void ep0start(struct pxa2xx_udc *dev, u32 flags, const char *tag)
465} 472}
466 473
467static int 474static int
468write_ep0_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req) 475write_ep0_fifo (struct pxa25x_ep *ep, struct pxa25x_request *req)
469{ 476{
470 unsigned count; 477 unsigned count;
471 int is_short; 478 int is_short;
@@ -525,7 +532,7 @@ write_ep0_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
525 * request buffer having filled (and maybe overran till end-of-packet). 532 * request buffer having filled (and maybe overran till end-of-packet).
526 */ 533 */
527static int 534static int
528read_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req) 535read_fifo (struct pxa25x_ep *ep, struct pxa25x_request *req)
529{ 536{
530 for (;;) { 537 for (;;) {
531 u32 udccs; 538 u32 udccs;
@@ -602,7 +609,7 @@ read_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
602 * protocols do use them. 609 * protocols do use them.
603 */ 610 */
604static int 611static int
605read_ep0_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req) 612read_ep0_fifo (struct pxa25x_ep *ep, struct pxa25x_request *req)
606{ 613{
607 u8 *buf, byte; 614 u8 *buf, byte;
608 unsigned bufferspace; 615 unsigned bufferspace;
@@ -641,21 +648,21 @@ read_ep0_fifo (struct pxa2xx_ep *ep, struct pxa2xx_request *req)
641/*-------------------------------------------------------------------------*/ 648/*-------------------------------------------------------------------------*/
642 649
643static int 650static int
644pxa2xx_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) 651pxa25x_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
645{ 652{
646 struct pxa2xx_request *req; 653 struct pxa25x_request *req;
647 struct pxa2xx_ep *ep; 654 struct pxa25x_ep *ep;
648 struct pxa2xx_udc *dev; 655 struct pxa25x_udc *dev;
649 unsigned long flags; 656 unsigned long flags;
650 657
651 req = container_of(_req, struct pxa2xx_request, req); 658 req = container_of(_req, struct pxa25x_request, req);
652 if (unlikely (!_req || !_req->complete || !_req->buf 659 if (unlikely (!_req || !_req->complete || !_req->buf
653 || !list_empty(&req->queue))) { 660 || !list_empty(&req->queue))) {
654 DMSG("%s, bad params\n", __func__); 661 DMSG("%s, bad params\n", __func__);
655 return -EINVAL; 662 return -EINVAL;
656 } 663 }
657 664
658 ep = container_of(_ep, struct pxa2xx_ep, ep); 665 ep = container_of(_ep, struct pxa25x_ep, ep);
659 if (unlikely (!_ep || (!ep->desc && ep->ep.name != ep0name))) { 666 if (unlikely (!_ep || (!ep->desc && ep->ep.name != ep0name))) {
660 DMSG("%s, bad ep\n", __func__); 667 DMSG("%s, bad ep\n", __func__);
661 return -EINVAL; 668 return -EINVAL;
@@ -751,14 +758,14 @@ pxa2xx_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
751/* 758/*
752 * nuke - dequeue ALL requests 759 * nuke - dequeue ALL requests
753 */ 760 */
754static void nuke(struct pxa2xx_ep *ep, int status) 761static void nuke(struct pxa25x_ep *ep, int status)
755{ 762{
756 struct pxa2xx_request *req; 763 struct pxa25x_request *req;
757 764
758 /* called with irqs blocked */ 765 /* called with irqs blocked */
759 while (!list_empty(&ep->queue)) { 766 while (!list_empty(&ep->queue)) {
760 req = list_entry(ep->queue.next, 767 req = list_entry(ep->queue.next,
761 struct pxa2xx_request, 768 struct pxa25x_request,
762 queue); 769 queue);
763 done(ep, req, status); 770 done(ep, req, status);
764 } 771 }
@@ -768,13 +775,13 @@ static void nuke(struct pxa2xx_ep *ep, int status)
768 775
769 776
770/* dequeue JUST ONE request */ 777/* dequeue JUST ONE request */
771static int pxa2xx_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) 778static int pxa25x_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
772{ 779{
773 struct pxa2xx_ep *ep; 780 struct pxa25x_ep *ep;
774 struct pxa2xx_request *req; 781 struct pxa25x_request *req;
775 unsigned long flags; 782 unsigned long flags;
776 783
777 ep = container_of(_ep, struct pxa2xx_ep, ep); 784 ep = container_of(_ep, struct pxa25x_ep, ep);
778 if (!_ep || ep->ep.name == ep0name) 785 if (!_ep || ep->ep.name == ep0name)
779 return -EINVAL; 786 return -EINVAL;
780 787
@@ -798,12 +805,12 @@ static int pxa2xx_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
798 805
799/*-------------------------------------------------------------------------*/ 806/*-------------------------------------------------------------------------*/
800 807
801static int pxa2xx_ep_set_halt(struct usb_ep *_ep, int value) 808static int pxa25x_ep_set_halt(struct usb_ep *_ep, int value)
802{ 809{
803 struct pxa2xx_ep *ep; 810 struct pxa25x_ep *ep;
804 unsigned long flags; 811 unsigned long flags;
805 812
806 ep = container_of(_ep, struct pxa2xx_ep, ep); 813 ep = container_of(_ep, struct pxa25x_ep, ep);
807 if (unlikely (!_ep 814 if (unlikely (!_ep
808 || (!ep->desc && ep->ep.name != ep0name)) 815 || (!ep->desc && ep->ep.name != ep0name))
809 || ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) { 816 || ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
@@ -853,11 +860,11 @@ static int pxa2xx_ep_set_halt(struct usb_ep *_ep, int value)
853 return 0; 860 return 0;
854} 861}
855 862
856static int pxa2xx_ep_fifo_status(struct usb_ep *_ep) 863static int pxa25x_ep_fifo_status(struct usb_ep *_ep)
857{ 864{
858 struct pxa2xx_ep *ep; 865 struct pxa25x_ep *ep;
859 866
860 ep = container_of(_ep, struct pxa2xx_ep, ep); 867 ep = container_of(_ep, struct pxa25x_ep, ep);
861 if (!_ep) { 868 if (!_ep) {
862 DMSG("%s, bad ep\n", __func__); 869 DMSG("%s, bad ep\n", __func__);
863 return -ENODEV; 870 return -ENODEV;
@@ -872,11 +879,11 @@ static int pxa2xx_ep_fifo_status(struct usb_ep *_ep)
872 return (*ep->reg_ubcr & 0xfff) + 1; 879 return (*ep->reg_ubcr & 0xfff) + 1;
873} 880}
874 881
875static void pxa2xx_ep_fifo_flush(struct usb_ep *_ep) 882static void pxa25x_ep_fifo_flush(struct usb_ep *_ep)
876{ 883{
877 struct pxa2xx_ep *ep; 884 struct pxa25x_ep *ep;
878 885
879 ep = container_of(_ep, struct pxa2xx_ep, ep); 886 ep = container_of(_ep, struct pxa25x_ep, ep);
880 if (!_ep || ep->ep.name == ep0name || !list_empty(&ep->queue)) { 887 if (!_ep || ep->ep.name == ep0name || !list_empty(&ep->queue)) {
881 DMSG("%s, bad ep\n", __func__); 888 DMSG("%s, bad ep\n", __func__);
882 return; 889 return;
@@ -898,19 +905,19 @@ static void pxa2xx_ep_fifo_flush(struct usb_ep *_ep)
898} 905}
899 906
900 907
901static struct usb_ep_ops pxa2xx_ep_ops = { 908static struct usb_ep_ops pxa25x_ep_ops = {
902 .enable = pxa2xx_ep_enable, 909 .enable = pxa25x_ep_enable,
903 .disable = pxa2xx_ep_disable, 910 .disable = pxa25x_ep_disable,
904 911
905 .alloc_request = pxa2xx_ep_alloc_request, 912 .alloc_request = pxa25x_ep_alloc_request,
906 .free_request = pxa2xx_ep_free_request, 913 .free_request = pxa25x_ep_free_request,
907 914
908 .queue = pxa2xx_ep_queue, 915 .queue = pxa25x_ep_queue,
909 .dequeue = pxa2xx_ep_dequeue, 916 .dequeue = pxa25x_ep_dequeue,
910 917
911 .set_halt = pxa2xx_ep_set_halt, 918 .set_halt = pxa25x_ep_set_halt,
912 .fifo_status = pxa2xx_ep_fifo_status, 919 .fifo_status = pxa25x_ep_fifo_status,
913 .fifo_flush = pxa2xx_ep_fifo_flush, 920 .fifo_flush = pxa25x_ep_fifo_flush,
914}; 921};
915 922
916 923
@@ -919,12 +926,12 @@ static struct usb_ep_ops pxa2xx_ep_ops = {
919 * --------------------------------------------------------------------------- 926 * ---------------------------------------------------------------------------
920 */ 927 */
921 928
922static int pxa2xx_udc_get_frame(struct usb_gadget *_gadget) 929static int pxa25x_udc_get_frame(struct usb_gadget *_gadget)
923{ 930{
924 return ((UFNRH & 0x07) << 8) | (UFNRL & 0xff); 931 return ((UFNRH & 0x07) << 8) | (UFNRL & 0xff);
925} 932}
926 933
927static int pxa2xx_udc_wakeup(struct usb_gadget *_gadget) 934static int pxa25x_udc_wakeup(struct usb_gadget *_gadget)
928{ 935{
929 /* host may not have enabled remote wakeup */ 936 /* host may not have enabled remote wakeup */
930 if ((UDCCS0 & UDCCS0_DRWF) == 0) 937 if ((UDCCS0 & UDCCS0_DRWF) == 0)
@@ -933,14 +940,14 @@ static int pxa2xx_udc_wakeup(struct usb_gadget *_gadget)
933 return 0; 940 return 0;
934} 941}
935 942
936static void stop_activity(struct pxa2xx_udc *, struct usb_gadget_driver *); 943static void stop_activity(struct pxa25x_udc *, struct usb_gadget_driver *);
937static void udc_enable (struct pxa2xx_udc *); 944static void udc_enable (struct pxa25x_udc *);
938static void udc_disable(struct pxa2xx_udc *); 945static void udc_disable(struct pxa25x_udc *);
939 946
940/* We disable the UDC -- and its 48 MHz clock -- whenever it's not 947/* We disable the UDC -- and its 48 MHz clock -- whenever it's not
941 * in active use. 948 * in active use.
942 */ 949 */
943static int pullup(struct pxa2xx_udc *udc) 950static int pullup(struct pxa25x_udc *udc)
944{ 951{
945 int is_active = udc->vbus && udc->pullup && !udc->suspended; 952 int is_active = udc->vbus && udc->pullup && !udc->suspended;
946 DMSG("%s\n", is_active ? "active" : "inactive"); 953 DMSG("%s\n", is_active ? "active" : "inactive");
@@ -970,11 +977,11 @@ static int pullup(struct pxa2xx_udc *udc)
970} 977}
971 978
972/* VBUS reporting logically comes from a transceiver */ 979/* VBUS reporting logically comes from a transceiver */
973static int pxa2xx_udc_vbus_session(struct usb_gadget *_gadget, int is_active) 980static int pxa25x_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
974{ 981{
975 struct pxa2xx_udc *udc; 982 struct pxa25x_udc *udc;
976 983
977 udc = container_of(_gadget, struct pxa2xx_udc, gadget); 984 udc = container_of(_gadget, struct pxa25x_udc, gadget);
978 udc->vbus = (is_active != 0); 985 udc->vbus = (is_active != 0);
979 DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); 986 DMSG("vbus %s\n", is_active ? "supplied" : "inactive");
980 pullup(udc); 987 pullup(udc);
@@ -982,11 +989,11 @@ static int pxa2xx_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
982} 989}
983 990
984/* drivers may have software control over D+ pullup */ 991/* drivers may have software control over D+ pullup */
985static int pxa2xx_udc_pullup(struct usb_gadget *_gadget, int is_active) 992static int pxa25x_udc_pullup(struct usb_gadget *_gadget, int is_active)
986{ 993{
987 struct pxa2xx_udc *udc; 994 struct pxa25x_udc *udc;
988 995
989 udc = container_of(_gadget, struct pxa2xx_udc, gadget); 996 udc = container_of(_gadget, struct pxa25x_udc, gadget);
990 997
991 /* not all boards support pullup control */ 998 /* not all boards support pullup control */
992 if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 999 if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
@@ -997,11 +1004,11 @@ static int pxa2xx_udc_pullup(struct usb_gadget *_gadget, int is_active)
997 return 0; 1004 return 0;
998} 1005}
999 1006
1000static const struct usb_gadget_ops pxa2xx_udc_ops = { 1007static const struct usb_gadget_ops pxa25x_udc_ops = {
1001 .get_frame = pxa2xx_udc_get_frame, 1008 .get_frame = pxa25x_udc_get_frame,
1002 .wakeup = pxa2xx_udc_wakeup, 1009 .wakeup = pxa25x_udc_wakeup,
1003 .vbus_session = pxa2xx_udc_vbus_session, 1010 .vbus_session = pxa25x_udc_vbus_session,
1004 .pullup = pxa2xx_udc_pullup, 1011 .pullup = pxa25x_udc_pullup,
1005 1012
1006 // .vbus_draw ... boards may consume current from VBUS, up to 1013 // .vbus_draw ... boards may consume current from VBUS, up to
1007 // 100-500mA based on config. the 500uA suspend ceiling means 1014 // 100-500mA based on config. the 500uA suspend ceiling means
@@ -1015,7 +1022,7 @@ static const struct usb_gadget_ops pxa2xx_udc_ops = {
1015static int 1022static int
1016udc_seq_show(struct seq_file *m, void *_d) 1023udc_seq_show(struct seq_file *m, void *_d)
1017{ 1024{
1018 struct pxa2xx_udc *dev = m->private; 1025 struct pxa25x_udc *dev = m->private;
1019 unsigned long flags; 1026 unsigned long flags;
1020 int i; 1027 int i;
1021 u32 tmp; 1028 u32 tmp;
@@ -1076,8 +1083,8 @@ udc_seq_show(struct seq_file *m, void *_d)
1076 1083
1077 /* dump endpoint queues */ 1084 /* dump endpoint queues */
1078 for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) { 1085 for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) {
1079 struct pxa2xx_ep *ep = &dev->ep [i]; 1086 struct pxa25x_ep *ep = &dev->ep [i];
1080 struct pxa2xx_request *req; 1087 struct pxa25x_request *req;
1081 1088
1082 if (i != 0) { 1089 if (i != 0) {
1083 const struct usb_endpoint_descriptor *desc; 1090 const struct usb_endpoint_descriptor *desc;
@@ -1150,7 +1157,7 @@ static const struct file_operations debug_fops = {
1150/* 1157/*
1151 * udc_disable - disable USB device controller 1158 * udc_disable - disable USB device controller
1152 */ 1159 */
1153static void udc_disable(struct pxa2xx_udc *dev) 1160static void udc_disable(struct pxa25x_udc *dev)
1154{ 1161{
1155 /* block all irqs */ 1162 /* block all irqs */
1156 udc_set_mask_UDCCR(UDCCR_SRM|UDCCR_REM); 1163 udc_set_mask_UDCCR(UDCCR_SRM|UDCCR_REM);
@@ -1170,7 +1177,7 @@ static void udc_disable(struct pxa2xx_udc *dev)
1170/* 1177/*
1171 * udc_reinit - initialize software state 1178 * udc_reinit - initialize software state
1172 */ 1179 */
1173static void udc_reinit(struct pxa2xx_udc *dev) 1180static void udc_reinit(struct pxa25x_udc *dev)
1174{ 1181{
1175 u32 i; 1182 u32 i;
1176 1183
@@ -1181,7 +1188,7 @@ static void udc_reinit(struct pxa2xx_udc *dev)
1181 1188
1182 /* basic endpoint records init */ 1189 /* basic endpoint records init */
1183 for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) { 1190 for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) {
1184 struct pxa2xx_ep *ep = &dev->ep[i]; 1191 struct pxa25x_ep *ep = &dev->ep[i];
1185 1192
1186 if (i != 0) 1193 if (i != 0)
1187 list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list); 1194 list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list);
@@ -1198,7 +1205,7 @@ static void udc_reinit(struct pxa2xx_udc *dev)
1198/* until it's enabled, this UDC should be completely invisible 1205/* until it's enabled, this UDC should be completely invisible
1199 * to any USB host. 1206 * to any USB host.
1200 */ 1207 */
1201static void udc_enable (struct pxa2xx_udc *dev) 1208static void udc_enable (struct pxa25x_udc *dev)
1202{ 1209{
1203 udc_clear_mask_UDCCR(UDCCR_UDE); 1210 udc_clear_mask_UDCCR(UDCCR_UDE);
1204 1211
@@ -1254,7 +1261,7 @@ static void udc_enable (struct pxa2xx_udc *dev)
1254 */ 1261 */
1255int usb_gadget_register_driver(struct usb_gadget_driver *driver) 1262int usb_gadget_register_driver(struct usb_gadget_driver *driver)
1256{ 1263{
1257 struct pxa2xx_udc *dev = the_controller; 1264 struct pxa25x_udc *dev = the_controller;
1258 int retval; 1265 int retval;
1259 1266
1260 if (!driver 1267 if (!driver
@@ -1299,7 +1306,7 @@ fail:
1299EXPORT_SYMBOL(usb_gadget_register_driver); 1306EXPORT_SYMBOL(usb_gadget_register_driver);
1300 1307
1301static void 1308static void
1302stop_activity(struct pxa2xx_udc *dev, struct usb_gadget_driver *driver) 1309stop_activity(struct pxa25x_udc *dev, struct usb_gadget_driver *driver)
1303{ 1310{
1304 int i; 1311 int i;
1305 1312
@@ -1310,7 +1317,7 @@ stop_activity(struct pxa2xx_udc *dev, struct usb_gadget_driver *driver)
1310 1317
1311 /* prevent new request submissions, kill any outstanding requests */ 1318 /* prevent new request submissions, kill any outstanding requests */
1312 for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) { 1319 for (i = 0; i < PXA_UDC_NUM_ENDPOINTS; i++) {
1313 struct pxa2xx_ep *ep = &dev->ep[i]; 1320 struct pxa25x_ep *ep = &dev->ep[i];
1314 1321
1315 ep->stopped = 1; 1322 ep->stopped = 1;
1316 nuke(ep, -ESHUTDOWN); 1323 nuke(ep, -ESHUTDOWN);
@@ -1327,7 +1334,7 @@ stop_activity(struct pxa2xx_udc *dev, struct usb_gadget_driver *driver)
1327 1334
1328int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) 1335int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1329{ 1336{
1330 struct pxa2xx_udc *dev = the_controller; 1337 struct pxa25x_udc *dev = the_controller;
1331 1338
1332 if (!dev) 1339 if (!dev)
1333 return -ENODEV; 1340 return -ENODEV;
@@ -1364,7 +1371,7 @@ EXPORT_SYMBOL(usb_gadget_unregister_driver);
1364static irqreturn_t 1371static irqreturn_t
1365lubbock_vbus_irq(int irq, void *_dev) 1372lubbock_vbus_irq(int irq, void *_dev)
1366{ 1373{
1367 struct pxa2xx_udc *dev = _dev; 1374 struct pxa25x_udc *dev = _dev;
1368 int vbus; 1375 int vbus;
1369 1376
1370 dev->stats.irqs++; 1377 dev->stats.irqs++;
@@ -1383,7 +1390,7 @@ lubbock_vbus_irq(int irq, void *_dev)
1383 return IRQ_NONE; 1390 return IRQ_NONE;
1384 } 1391 }
1385 1392
1386 pxa2xx_udc_vbus_session(&dev->gadget, vbus); 1393 pxa25x_udc_vbus_session(&dev->gadget, vbus);
1387 return IRQ_HANDLED; 1394 return IRQ_HANDLED;
1388} 1395}
1389 1396
@@ -1391,20 +1398,20 @@ lubbock_vbus_irq(int irq, void *_dev)
1391 1398
1392static irqreturn_t udc_vbus_irq(int irq, void *_dev) 1399static irqreturn_t udc_vbus_irq(int irq, void *_dev)
1393{ 1400{
1394 struct pxa2xx_udc *dev = _dev; 1401 struct pxa25x_udc *dev = _dev;
1395 int vbus = gpio_get_value(dev->mach->gpio_vbus); 1402 int vbus = gpio_get_value(dev->mach->gpio_vbus);
1396 1403
1397 if (dev->mach->gpio_vbus_inverted) 1404 if (dev->mach->gpio_vbus_inverted)
1398 vbus = !vbus; 1405 vbus = !vbus;
1399 1406
1400 pxa2xx_udc_vbus_session(&dev->gadget, vbus); 1407 pxa25x_udc_vbus_session(&dev->gadget, vbus);
1401 return IRQ_HANDLED; 1408 return IRQ_HANDLED;
1402} 1409}
1403 1410
1404 1411
1405/*-------------------------------------------------------------------------*/ 1412/*-------------------------------------------------------------------------*/
1406 1413
1407static inline void clear_ep_state (struct pxa2xx_udc *dev) 1414static inline void clear_ep_state (struct pxa25x_udc *dev)
1408{ 1415{
1409 unsigned i; 1416 unsigned i;
1410 1417
@@ -1417,7 +1424,7 @@ static inline void clear_ep_state (struct pxa2xx_udc *dev)
1417 1424
1418static void udc_watchdog(unsigned long _dev) 1425static void udc_watchdog(unsigned long _dev)
1419{ 1426{
1420 struct pxa2xx_udc *dev = (void *)_dev; 1427 struct pxa25x_udc *dev = (void *)_dev;
1421 1428
1422 local_irq_disable(); 1429 local_irq_disable();
1423 if (dev->ep0state == EP0_STALL 1430 if (dev->ep0state == EP0_STALL
@@ -1430,11 +1437,11 @@ static void udc_watchdog(unsigned long _dev)
1430 local_irq_enable(); 1437 local_irq_enable();
1431} 1438}
1432 1439
1433static void handle_ep0 (struct pxa2xx_udc *dev) 1440static void handle_ep0 (struct pxa25x_udc *dev)
1434{ 1441{
1435 u32 udccs0 = UDCCS0; 1442 u32 udccs0 = UDCCS0;
1436 struct pxa2xx_ep *ep = &dev->ep [0]; 1443 struct pxa25x_ep *ep = &dev->ep [0];
1437 struct pxa2xx_request *req; 1444 struct pxa25x_request *req;
1438 union { 1445 union {
1439 struct usb_ctrlrequest r; 1446 struct usb_ctrlrequest r;
1440 u8 raw [8]; 1447 u8 raw [8];
@@ -1444,7 +1451,7 @@ static void handle_ep0 (struct pxa2xx_udc *dev)
1444 if (list_empty(&ep->queue)) 1451 if (list_empty(&ep->queue))
1445 req = NULL; 1452 req = NULL;
1446 else 1453 else
1447 req = list_entry(ep->queue.next, struct pxa2xx_request, queue); 1454 req = list_entry(ep->queue.next, struct pxa25x_request, queue);
1448 1455
1449 /* clear stall status */ 1456 /* clear stall status */
1450 if (udccs0 & UDCCS0_SST) { 1457 if (udccs0 & UDCCS0_SST) {
@@ -1654,9 +1661,9 @@ stall:
1654 USIR0 = USIR0_IR0; 1661 USIR0 = USIR0_IR0;
1655} 1662}
1656 1663
1657static void handle_ep(struct pxa2xx_ep *ep) 1664static void handle_ep(struct pxa25x_ep *ep)
1658{ 1665{
1659 struct pxa2xx_request *req; 1666 struct pxa25x_request *req;
1660 int is_in = ep->bEndpointAddress & USB_DIR_IN; 1667 int is_in = ep->bEndpointAddress & USB_DIR_IN;
1661 int completed; 1668 int completed;
1662 u32 udccs, tmp; 1669 u32 udccs, tmp;
@@ -1665,7 +1672,7 @@ static void handle_ep(struct pxa2xx_ep *ep)
1665 completed = 0; 1672 completed = 0;
1666 if (likely (!list_empty(&ep->queue))) 1673 if (likely (!list_empty(&ep->queue)))
1667 req = list_entry(ep->queue.next, 1674 req = list_entry(ep->queue.next,
1668 struct pxa2xx_request, queue); 1675 struct pxa25x_request, queue);
1669 else 1676 else
1670 req = NULL; 1677 req = NULL;
1671 1678
@@ -1702,16 +1709,16 @@ static void handle_ep(struct pxa2xx_ep *ep)
1702} 1709}
1703 1710
1704/* 1711/*
1705 * pxa2xx_udc_irq - interrupt handler 1712 * pxa25x_udc_irq - interrupt handler
1706 * 1713 *
1707 * avoid delays in ep0 processing. the control handshaking isn't always 1714 * avoid delays in ep0 processing. the control handshaking isn't always
1708 * under software control (pxa250c0 and the pxa255 are better), and delays 1715 * under software control (pxa250c0 and the pxa255 are better), and delays
1709 * could cause usb protocol errors. 1716 * could cause usb protocol errors.
1710 */ 1717 */
1711static irqreturn_t 1718static irqreturn_t
1712pxa2xx_udc_irq(int irq, void *_dev) 1719pxa25x_udc_irq(int irq, void *_dev)
1713{ 1720{
1714 struct pxa2xx_udc *dev = _dev; 1721 struct pxa25x_udc *dev = _dev;
1715 int handled; 1722 int handled;
1716 1723
1717 dev->stats.irqs++; 1724 dev->stats.irqs++;
@@ -1820,9 +1827,9 @@ static void nop_release (struct device *dev)
1820 * doing it at run-time) to save code, eliminate fault paths, and 1827 * doing it at run-time) to save code, eliminate fault paths, and
1821 * be more obviously correct. 1828 * be more obviously correct.
1822 */ 1829 */
1823static struct pxa2xx_udc memory = { 1830static struct pxa25x_udc memory = {
1824 .gadget = { 1831 .gadget = {
1825 .ops = &pxa2xx_udc_ops, 1832 .ops = &pxa25x_udc_ops,
1826 .ep0 = &memory.ep[0].ep, 1833 .ep0 = &memory.ep[0].ep,
1827 .name = driver_name, 1834 .name = driver_name,
1828 .dev = { 1835 .dev = {
@@ -1835,7 +1842,7 @@ static struct pxa2xx_udc memory = {
1835 .ep[0] = { 1842 .ep[0] = {
1836 .ep = { 1843 .ep = {
1837 .name = ep0name, 1844 .name = ep0name,
1838 .ops = &pxa2xx_ep_ops, 1845 .ops = &pxa25x_ep_ops,
1839 .maxpacket = EP0_FIFO_SIZE, 1846 .maxpacket = EP0_FIFO_SIZE,
1840 }, 1847 },
1841 .dev = &memory, 1848 .dev = &memory,
@@ -1847,7 +1854,7 @@ static struct pxa2xx_udc memory = {
1847 .ep[1] = { 1854 .ep[1] = {
1848 .ep = { 1855 .ep = {
1849 .name = "ep1in-bulk", 1856 .name = "ep1in-bulk",
1850 .ops = &pxa2xx_ep_ops, 1857 .ops = &pxa25x_ep_ops,
1851 .maxpacket = BULK_FIFO_SIZE, 1858 .maxpacket = BULK_FIFO_SIZE,
1852 }, 1859 },
1853 .dev = &memory, 1860 .dev = &memory,
@@ -1860,7 +1867,7 @@ static struct pxa2xx_udc memory = {
1860 .ep[2] = { 1867 .ep[2] = {
1861 .ep = { 1868 .ep = {
1862 .name = "ep2out-bulk", 1869 .name = "ep2out-bulk",
1863 .ops = &pxa2xx_ep_ops, 1870 .ops = &pxa25x_ep_ops,
1864 .maxpacket = BULK_FIFO_SIZE, 1871 .maxpacket = BULK_FIFO_SIZE,
1865 }, 1872 },
1866 .dev = &memory, 1873 .dev = &memory,
@@ -1871,11 +1878,11 @@ static struct pxa2xx_udc memory = {
1871 .reg_ubcr = &UBCR2, 1878 .reg_ubcr = &UBCR2,
1872 .reg_uddr = &UDDR2, 1879 .reg_uddr = &UDDR2,
1873 }, 1880 },
1874#ifndef CONFIG_USB_PXA2XX_SMALL 1881#ifndef CONFIG_USB_PXA25X_SMALL
1875 .ep[3] = { 1882 .ep[3] = {
1876 .ep = { 1883 .ep = {
1877 .name = "ep3in-iso", 1884 .name = "ep3in-iso",
1878 .ops = &pxa2xx_ep_ops, 1885 .ops = &pxa25x_ep_ops,
1879 .maxpacket = ISO_FIFO_SIZE, 1886 .maxpacket = ISO_FIFO_SIZE,
1880 }, 1887 },
1881 .dev = &memory, 1888 .dev = &memory,
@@ -1888,7 +1895,7 @@ static struct pxa2xx_udc memory = {
1888 .ep[4] = { 1895 .ep[4] = {
1889 .ep = { 1896 .ep = {
1890 .name = "ep4out-iso", 1897 .name = "ep4out-iso",
1891 .ops = &pxa2xx_ep_ops, 1898 .ops = &pxa25x_ep_ops,
1892 .maxpacket = ISO_FIFO_SIZE, 1899 .maxpacket = ISO_FIFO_SIZE,
1893 }, 1900 },
1894 .dev = &memory, 1901 .dev = &memory,
@@ -1902,7 +1909,7 @@ static struct pxa2xx_udc memory = {
1902 .ep[5] = { 1909 .ep[5] = {
1903 .ep = { 1910 .ep = {
1904 .name = "ep5in-int", 1911 .name = "ep5in-int",
1905 .ops = &pxa2xx_ep_ops, 1912 .ops = &pxa25x_ep_ops,
1906 .maxpacket = INT_FIFO_SIZE, 1913 .maxpacket = INT_FIFO_SIZE,
1907 }, 1914 },
1908 .dev = &memory, 1915 .dev = &memory,
@@ -1917,7 +1924,7 @@ static struct pxa2xx_udc memory = {
1917 .ep[6] = { 1924 .ep[6] = {
1918 .ep = { 1925 .ep = {
1919 .name = "ep6in-bulk", 1926 .name = "ep6in-bulk",
1920 .ops = &pxa2xx_ep_ops, 1927 .ops = &pxa25x_ep_ops,
1921 .maxpacket = BULK_FIFO_SIZE, 1928 .maxpacket = BULK_FIFO_SIZE,
1922 }, 1929 },
1923 .dev = &memory, 1930 .dev = &memory,
@@ -1930,7 +1937,7 @@ static struct pxa2xx_udc memory = {
1930 .ep[7] = { 1937 .ep[7] = {
1931 .ep = { 1938 .ep = {
1932 .name = "ep7out-bulk", 1939 .name = "ep7out-bulk",
1933 .ops = &pxa2xx_ep_ops, 1940 .ops = &pxa25x_ep_ops,
1934 .maxpacket = BULK_FIFO_SIZE, 1941 .maxpacket = BULK_FIFO_SIZE,
1935 }, 1942 },
1936 .dev = &memory, 1943 .dev = &memory,
@@ -1944,7 +1951,7 @@ static struct pxa2xx_udc memory = {
1944 .ep[8] = { 1951 .ep[8] = {
1945 .ep = { 1952 .ep = {
1946 .name = "ep8in-iso", 1953 .name = "ep8in-iso",
1947 .ops = &pxa2xx_ep_ops, 1954 .ops = &pxa25x_ep_ops,
1948 .maxpacket = ISO_FIFO_SIZE, 1955 .maxpacket = ISO_FIFO_SIZE,
1949 }, 1956 },
1950 .dev = &memory, 1957 .dev = &memory,
@@ -1957,7 +1964,7 @@ static struct pxa2xx_udc memory = {
1957 .ep[9] = { 1964 .ep[9] = {
1958 .ep = { 1965 .ep = {
1959 .name = "ep9out-iso", 1966 .name = "ep9out-iso",
1960 .ops = &pxa2xx_ep_ops, 1967 .ops = &pxa25x_ep_ops,
1961 .maxpacket = ISO_FIFO_SIZE, 1968 .maxpacket = ISO_FIFO_SIZE,
1962 }, 1969 },
1963 .dev = &memory, 1970 .dev = &memory,
@@ -1971,7 +1978,7 @@ static struct pxa2xx_udc memory = {
1971 .ep[10] = { 1978 .ep[10] = {
1972 .ep = { 1979 .ep = {
1973 .name = "ep10in-int", 1980 .name = "ep10in-int",
1974 .ops = &pxa2xx_ep_ops, 1981 .ops = &pxa25x_ep_ops,
1975 .maxpacket = INT_FIFO_SIZE, 1982 .maxpacket = INT_FIFO_SIZE,
1976 }, 1983 },
1977 .dev = &memory, 1984 .dev = &memory,
@@ -1986,7 +1993,7 @@ static struct pxa2xx_udc memory = {
1986 .ep[11] = { 1993 .ep[11] = {
1987 .ep = { 1994 .ep = {
1988 .name = "ep11in-bulk", 1995 .name = "ep11in-bulk",
1989 .ops = &pxa2xx_ep_ops, 1996 .ops = &pxa25x_ep_ops,
1990 .maxpacket = BULK_FIFO_SIZE, 1997 .maxpacket = BULK_FIFO_SIZE,
1991 }, 1998 },
1992 .dev = &memory, 1999 .dev = &memory,
@@ -1999,7 +2006,7 @@ static struct pxa2xx_udc memory = {
1999 .ep[12] = { 2006 .ep[12] = {
2000 .ep = { 2007 .ep = {
2001 .name = "ep12out-bulk", 2008 .name = "ep12out-bulk",
2002 .ops = &pxa2xx_ep_ops, 2009 .ops = &pxa25x_ep_ops,
2003 .maxpacket = BULK_FIFO_SIZE, 2010 .maxpacket = BULK_FIFO_SIZE,
2004 }, 2011 },
2005 .dev = &memory, 2012 .dev = &memory,
@@ -2013,7 +2020,7 @@ static struct pxa2xx_udc memory = {
2013 .ep[13] = { 2020 .ep[13] = {
2014 .ep = { 2021 .ep = {
2015 .name = "ep13in-iso", 2022 .name = "ep13in-iso",
2016 .ops = &pxa2xx_ep_ops, 2023 .ops = &pxa25x_ep_ops,
2017 .maxpacket = ISO_FIFO_SIZE, 2024 .maxpacket = ISO_FIFO_SIZE,
2018 }, 2025 },
2019 .dev = &memory, 2026 .dev = &memory,
@@ -2026,7 +2033,7 @@ static struct pxa2xx_udc memory = {
2026 .ep[14] = { 2033 .ep[14] = {
2027 .ep = { 2034 .ep = {
2028 .name = "ep14out-iso", 2035 .name = "ep14out-iso",
2029 .ops = &pxa2xx_ep_ops, 2036 .ops = &pxa25x_ep_ops,
2030 .maxpacket = ISO_FIFO_SIZE, 2037 .maxpacket = ISO_FIFO_SIZE,
2031 }, 2038 },
2032 .dev = &memory, 2039 .dev = &memory,
@@ -2040,7 +2047,7 @@ static struct pxa2xx_udc memory = {
2040 .ep[15] = { 2047 .ep[15] = {
2041 .ep = { 2048 .ep = {
2042 .name = "ep15in-int", 2049 .name = "ep15in-int",
2043 .ops = &pxa2xx_ep_ops, 2050 .ops = &pxa25x_ep_ops,
2044 .maxpacket = INT_FIFO_SIZE, 2051 .maxpacket = INT_FIFO_SIZE,
2045 }, 2052 },
2046 .dev = &memory, 2053 .dev = &memory,
@@ -2050,7 +2057,7 @@ static struct pxa2xx_udc memory = {
2050 .reg_udccs = &UDCCS15, 2057 .reg_udccs = &UDCCS15,
2051 .reg_uddr = &UDDR15, 2058 .reg_uddr = &UDDR15,
2052 }, 2059 },
2053#endif /* !CONFIG_USB_PXA2XX_SMALL */ 2060#endif /* !CONFIG_USB_PXA25X_SMALL */
2054}; 2061};
2055 2062
2056#define CP15R0_VENDOR_MASK 0xffffe000 2063#define CP15R0_VENDOR_MASK 0xffffe000
@@ -2090,9 +2097,9 @@ static struct pxa2xx_udc memory = {
2090/* 2097/*
2091 * probe - binds to the platform device 2098 * probe - binds to the platform device
2092 */ 2099 */
2093static int __init pxa2xx_udc_probe(struct platform_device *pdev) 2100static int __init pxa25x_udc_probe(struct platform_device *pdev)
2094{ 2101{
2095 struct pxa2xx_udc *dev = &memory; 2102 struct pxa25x_udc *dev = &memory;
2096 int retval, vbus_irq, irq; 2103 int retval, vbus_irq, irq;
2097 u32 chiprev; 2104 u32 chiprev;
2098 2105
@@ -2155,7 +2162,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
2155 2162
2156 if (dev->mach->gpio_vbus) { 2163 if (dev->mach->gpio_vbus) {
2157 if ((retval = gpio_request(dev->mach->gpio_vbus, 2164 if ((retval = gpio_request(dev->mach->gpio_vbus,
2158 "pxa2xx_udc GPIO VBUS"))) { 2165 "pxa25x_udc GPIO VBUS"))) {
2159 dev_dbg(&pdev->dev, 2166 dev_dbg(&pdev->dev,
2160 "can't get vbus gpio %d, err: %d\n", 2167 "can't get vbus gpio %d, err: %d\n",
2161 dev->mach->gpio_vbus, retval); 2168 dev->mach->gpio_vbus, retval);
@@ -2168,7 +2175,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
2168 2175
2169 if (dev->mach->gpio_pullup) { 2176 if (dev->mach->gpio_pullup) {
2170 if ((retval = gpio_request(dev->mach->gpio_pullup, 2177 if ((retval = gpio_request(dev->mach->gpio_pullup,
2171 "pca2xx_udc GPIO PULLUP"))) { 2178 "pca25x_udc GPIO PULLUP"))) {
2172 dev_dbg(&pdev->dev, 2179 dev_dbg(&pdev->dev,
2173 "can't get pullup gpio %d, err: %d\n", 2180 "can't get pullup gpio %d, err: %d\n",
2174 dev->mach->gpio_pullup, retval); 2181 dev->mach->gpio_pullup, retval);
@@ -2194,7 +2201,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
2194 dev->vbus = is_vbus_present(); 2201 dev->vbus = is_vbus_present();
2195 2202
2196 /* irq setup after old hardware state is cleaned up */ 2203 /* irq setup after old hardware state is cleaned up */
2197 retval = request_irq(irq, pxa2xx_udc_irq, 2204 retval = request_irq(irq, pxa25x_udc_irq,
2198 IRQF_DISABLED, driver_name, dev); 2205 IRQF_DISABLED, driver_name, dev);
2199 if (retval != 0) { 2206 if (retval != 0) {
2200 pr_err("%s: can't get irq %d, err %d\n", 2207 pr_err("%s: can't get irq %d, err %d\n",
@@ -2260,14 +2267,14 @@ lubbock_fail0:
2260 return retval; 2267 return retval;
2261} 2268}
2262 2269
2263static void pxa2xx_udc_shutdown(struct platform_device *_dev) 2270static void pxa25x_udc_shutdown(struct platform_device *_dev)
2264{ 2271{
2265 pullup_off(); 2272 pullup_off();
2266} 2273}
2267 2274
2268static int __exit pxa2xx_udc_remove(struct platform_device *pdev) 2275static int __exit pxa25x_udc_remove(struct platform_device *pdev)
2269{ 2276{
2270 struct pxa2xx_udc *dev = platform_get_drvdata(pdev); 2277 struct pxa25x_udc *dev = platform_get_drvdata(pdev);
2271 2278
2272 if (dev->driver) 2279 if (dev->driver)
2273 return -EBUSY; 2280 return -EBUSY;
@@ -2317,9 +2324,9 @@ static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
2317 * VBUS IRQs should probably be ignored so that the PXA device just acts 2324 * VBUS IRQs should probably be ignored so that the PXA device just acts
2318 * "dead" to USB hosts until system resume. 2325 * "dead" to USB hosts until system resume.
2319 */ 2326 */
2320static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state) 2327static int pxa25x_udc_suspend(struct platform_device *dev, pm_message_t state)
2321{ 2328{
2322 struct pxa2xx_udc *udc = platform_get_drvdata(dev); 2329 struct pxa25x_udc *udc = platform_get_drvdata(dev);
2323 unsigned long flags; 2330 unsigned long flags;
2324 2331
2325 if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 2332 if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
@@ -2333,9 +2340,9 @@ static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
2333 return 0; 2340 return 0;
2334} 2341}
2335 2342
2336static int pxa2xx_udc_resume(struct platform_device *dev) 2343static int pxa25x_udc_resume(struct platform_device *dev)
2337{ 2344{
2338 struct pxa2xx_udc *udc = platform_get_drvdata(dev); 2345 struct pxa25x_udc *udc = platform_get_drvdata(dev);
2339 unsigned long flags; 2346 unsigned long flags;
2340 2347
2341 udc->suspended = 0; 2348 udc->suspended = 0;
@@ -2347,27 +2354,27 @@ static int pxa2xx_udc_resume(struct platform_device *dev)
2347} 2354}
2348 2355
2349#else 2356#else
2350#define pxa2xx_udc_suspend NULL 2357#define pxa25x_udc_suspend NULL
2351#define pxa2xx_udc_resume NULL 2358#define pxa25x_udc_resume NULL
2352#endif 2359#endif
2353 2360
2354/*-------------------------------------------------------------------------*/ 2361/*-------------------------------------------------------------------------*/
2355 2362
2356static struct platform_driver udc_driver = { 2363static struct platform_driver udc_driver = {
2357 .shutdown = pxa2xx_udc_shutdown, 2364 .shutdown = pxa25x_udc_shutdown,
2358 .remove = __exit_p(pxa2xx_udc_remove), 2365 .remove = __exit_p(pxa25x_udc_remove),
2359 .suspend = pxa2xx_udc_suspend, 2366 .suspend = pxa25x_udc_suspend,
2360 .resume = pxa2xx_udc_resume, 2367 .resume = pxa25x_udc_resume,
2361 .driver = { 2368 .driver = {
2362 .owner = THIS_MODULE, 2369 .owner = THIS_MODULE,
2363 .name = "pxa2xx-udc", 2370 .name = "pxa25x-udc",
2364 }, 2371 },
2365}; 2372};
2366 2373
2367static int __init udc_init(void) 2374static int __init udc_init(void)
2368{ 2375{
2369 pr_info("%s: version %s\n", driver_name, DRIVER_VERSION); 2376 pr_info("%s: version %s\n", driver_name, DRIVER_VERSION);
2370 return platform_driver_probe(&udc_driver, pxa2xx_udc_probe); 2377 return platform_driver_probe(&udc_driver, pxa25x_udc_probe);
2371} 2378}
2372module_init(udc_init); 2379module_init(udc_init);
2373 2380
@@ -2380,4 +2387,4 @@ module_exit(udc_exit);
2380MODULE_DESCRIPTION(DRIVER_DESC); 2387MODULE_DESCRIPTION(DRIVER_DESC);
2381MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); 2388MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");
2382MODULE_LICENSE("GPL"); 2389MODULE_LICENSE("GPL");
2383MODULE_ALIAS("platform:pxa2xx-udc"); 2390MODULE_ALIAS("platform:pxa25x-udc");
diff --git a/drivers/usb/gadget/pxa2xx_udc.h b/drivers/usb/gadget/pxa25x_udc.h
index e2c19e88c875..4d11ece7c95f 100644
--- a/drivers/usb/gadget/pxa2xx_udc.h
+++ b/drivers/usb/gadget/pxa25x_udc.h
@@ -1,6 +1,5 @@
1/* 1/*
2 * linux/drivers/usb/gadget/pxa2xx_udc.h 2 * Intel PXA25x on-chip full speed USB device controller
3 * Intel PXA2xx on-chip full speed USB device controller
4 * 3 *
5 * Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix 4 * Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
6 * Copyright (C) 2003 David Brownell 5 * Copyright (C) 2003 David Brownell
@@ -21,14 +20,14 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 21 */
23 22
24#ifndef __LINUX_USB_GADGET_PXA2XX_H 23#ifndef __LINUX_USB_GADGET_PXA25X_H
25#define __LINUX_USB_GADGET_PXA2XX_H 24#define __LINUX_USB_GADGET_PXA25X_H
26 25
27#include <linux/types.h> 26#include <linux/types.h>
28 27
29/*-------------------------------------------------------------------------*/ 28/*-------------------------------------------------------------------------*/
30 29
31/* pxa2xx has this (move to include/asm-arm/arch-pxa/pxa-regs.h) */ 30/* pxa25x has this (move to include/asm-arm/arch-pxa/pxa-regs.h) */
32#define UFNRH_SIR (1 << 7) /* SOF interrupt request */ 31#define UFNRH_SIR (1 << 7) /* SOF interrupt request */
33#define UFNRH_SIM (1 << 6) /* SOF interrupt mask */ 32#define UFNRH_SIM (1 << 6) /* SOF interrupt mask */
34#define UFNRH_IPE14 (1 << 5) /* ISO packet error, ep14 */ 33#define UFNRH_IPE14 (1 << 5) /* ISO packet error, ep14 */
@@ -45,11 +44,11 @@
45 44
46/*-------------------------------------------------------------------------*/ 45/*-------------------------------------------------------------------------*/
47 46
48struct pxa2xx_udc; 47struct pxa25x_udc;
49 48
50struct pxa2xx_ep { 49struct pxa25x_ep {
51 struct usb_ep ep; 50 struct usb_ep ep;
52 struct pxa2xx_udc *dev; 51 struct pxa25x_udc *dev;
53 52
54 const struct usb_endpoint_descriptor *desc; 53 const struct usb_endpoint_descriptor *desc;
55 struct list_head queue; 54 struct list_head queue;
@@ -72,7 +71,7 @@ struct pxa2xx_ep {
72 volatile u32 *reg_uddr; 71 volatile u32 *reg_uddr;
73}; 72};
74 73
75struct pxa2xx_request { 74struct pxa25x_request {
76 struct usb_request req; 75 struct usb_request req;
77 struct list_head queue; 76 struct list_head queue;
78}; 77};
@@ -98,7 +97,7 @@ struct udc_stats {
98 unsigned long irqs; 97 unsigned long irqs;
99}; 98};
100 99
101#ifdef CONFIG_USB_PXA2XX_SMALL 100#ifdef CONFIG_USB_PXA25X_SMALL
102/* when memory's tight, SMALL config saves code+data. */ 101/* when memory's tight, SMALL config saves code+data. */
103#define PXA_UDC_NUM_ENDPOINTS 3 102#define PXA_UDC_NUM_ENDPOINTS 3
104#endif 103#endif
@@ -107,7 +106,7 @@ struct udc_stats {
107#define PXA_UDC_NUM_ENDPOINTS 16 106#define PXA_UDC_NUM_ENDPOINTS 16
108#endif 107#endif
109 108
110struct pxa2xx_udc { 109struct pxa25x_udc {
111 struct usb_gadget gadget; 110 struct usb_gadget gadget;
112 struct usb_gadget_driver *driver; 111 struct usb_gadget_driver *driver;
113 112
@@ -130,7 +129,7 @@ struct pxa2xx_udc {
130 struct clk *clk; 129 struct clk *clk;
131 struct pxa2xx_udc_mach_info *mach; 130 struct pxa2xx_udc_mach_info *mach;
132 u64 dma_mask; 131 u64 dma_mask;
133 struct pxa2xx_ep ep [PXA_UDC_NUM_ENDPOINTS]; 132 struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS];
134 133
135#ifdef CONFIG_USB_GADGET_DEBUG_FS 134#ifdef CONFIG_USB_GADGET_DEBUG_FS
136 struct dentry *debugfs_udc; 135 struct dentry *debugfs_udc;
@@ -144,7 +143,7 @@ struct pxa2xx_udc {
144/* lubbock can also report usb connect/disconnect irqs */ 143/* lubbock can also report usb connect/disconnect irqs */
145#endif 144#endif
146 145
147static struct pxa2xx_udc *the_controller; 146static struct pxa25x_udc *the_controller;
148 147
149/*-------------------------------------------------------------------------*/ 148/*-------------------------------------------------------------------------*/
150 149
@@ -209,7 +208,7 @@ dump_udccs0(const char *label)
209} 208}
210 209
211static void __maybe_unused 210static void __maybe_unused
212dump_state(struct pxa2xx_udc *dev) 211dump_state(struct pxa25x_udc *dev)
213{ 212{
214 u32 tmp; 213 u32 tmp;
215 unsigned i; 214 unsigned i;
@@ -264,4 +263,4 @@ dump_state(struct pxa2xx_udc *dev)
264#define INFO(stuff...) pr_info("udc: " stuff) 263#define INFO(stuff...) pr_info("udc: " stuff)
265 264
266 265
267#endif /* __LINUX_USB_GADGET_PXA2XX_H */ 266#endif /* __LINUX_USB_GADGET_PXA25X_H */
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index e02bfd4df3a6..9c0e82ec5c43 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -38,7 +38,7 @@
38#include <linux/usb.h> 38#include <linux/usb.h>
39#include <linux/usb/ch9.h> 39#include <linux/usb/ch9.h>
40#include <linux/usb/gadget.h> 40#include <linux/usb/gadget.h>
41 41#include <asm/arch/pxa2xx-regs.h> /* FIXME: for PSSR */
42#include <asm/arch/udc.h> 42#include <asm/arch/udc.h>
43 43
44#include "pxa27x_udc.h" 44#include "pxa27x_udc.h"
@@ -2360,18 +2360,19 @@ static int pxa_udc_resume(struct platform_device *_dev)
2360 * Software must configure the USB OTG pad, UDC, and UHC 2360 * Software must configure the USB OTG pad, UDC, and UHC
2361 * to the state they were in before entering sleep mode. 2361 * to the state they were in before entering sleep mode.
2362 */ 2362 */
2363 PSSR |= PSSR_OTGPH; 2363 if (cpu_is_pxa27x())
2364 PSSR |= PSSR_OTGPH;
2364 2365
2365 return 0; 2366 return 0;
2366} 2367}
2367#endif 2368#endif
2368 2369
2369/* work with hotplug and coldplug */ 2370/* work with hotplug and coldplug */
2370MODULE_ALIAS("platform:pxa2xx-udc"); 2371MODULE_ALIAS("platform:pxa27x-udc");
2371 2372
2372static struct platform_driver udc_driver = { 2373static struct platform_driver udc_driver = {
2373 .driver = { 2374 .driver = {
2374 .name = "pxa2xx-udc", 2375 .name = "pxa27x-udc",
2375 .owner = THIS_MODULE, 2376 .owner = THIS_MODULE,
2376 }, 2377 },
2377 .remove = __exit_p(pxa_udc_remove), 2378 .remove = __exit_p(pxa_udc_remove),
diff --git a/drivers/usb/gadget/pxa27x_udc.h b/drivers/usb/gadget/pxa27x_udc.h
index 97453db924ff..1d1b7936ee11 100644
--- a/drivers/usb/gadget/pxa27x_udc.h
+++ b/drivers/usb/gadget/pxa27x_udc.h
@@ -484,12 +484,4 @@ static inline struct pxa_udc *to_gadget_udc(struct usb_gadget *gadget)
484#define ep_warn(ep, fmt, arg...) \ 484#define ep_warn(ep, fmt, arg...) \
485 dev_warn(ep->dev->dev, "%s:%s:" fmt, EPNAME(ep), __func__, ## arg) 485 dev_warn(ep->dev->dev, "%s:%s:" fmt, EPNAME(ep), __func__, ## arg)
486 486
487/*
488 * Cannot include pxa-regs.h, as register names are similar.
489 * So PSSR is redefined here. This should be removed once UDC registers will
490 * be gone from pxa-regs.h.
491 */
492#define PSSR __REG(0x40F00004) /* Power Manager Sleep Status */
493#define PSSR_OTGPH (1 << 6) /* OTG Peripheral Hold */
494
495#endif /* __LINUX_USB_GADGET_PXA27X_H */ 487#endif /* __LINUX_USB_GADGET_PXA27X_H */
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 70b0d4b459e7..08b27d6bbd43 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -27,6 +27,7 @@
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <asm/hardware.h> 28#include <asm/hardware.h>
29#include <asm/arch/pxa-regs.h> 29#include <asm/arch/pxa-regs.h>
30#include <asm/arch/pxa2xx-regs.h> /* FIXME: for PSSR */
30#include <asm/arch/ohci.h> 31#include <asm/arch/ohci.h>
31 32
32#define PXA_UHC_MAX_PORTNUM 3 33#define PXA_UHC_MAX_PORTNUM 3
@@ -104,7 +105,7 @@ static int pxa27x_start_hc(struct device *dev)
104 UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE); 105 UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE);
105 106
106 /* Clear any OTG Pin Hold */ 107 /* Clear any OTG Pin Hold */
107 if (PSSR & PSSR_OTGPH) 108 if (cpu_is_pxa27x() && (PSSR & PSSR_OTGPH))
108 PSSR |= PSSR_OTGPH; 109 PSSR |= PSSR_OTGPH;
109 110
110 return 0; 111 return 0;