aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/pxa2xx_udc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/pxa2xx_udc.c')
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 63b9521c132..3e715082de3 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -54,7 +54,7 @@
54#include <asm/hardware.h> 54#include <asm/hardware.h>
55 55
56#include <linux/usb/ch9.h> 56#include <linux/usb/ch9.h>
57#include <linux/usb_gadget.h> 57#include <linux/usb/gadget.h>
58 58
59#include <asm/mach/udc_pxa2xx.h> 59#include <asm/mach/udc_pxa2xx.h>
60 60
@@ -93,8 +93,6 @@ static const char driver_name [] = "pxa2xx_udc";
93static const char ep0name [] = "ep0"; 93static const char ep0name [] = "ep0";
94 94
95 95
96// #define DISABLE_TEST_MODE
97
98#ifdef CONFIG_ARCH_IXP4XX 96#ifdef CONFIG_ARCH_IXP4XX
99 97
100/* cpu-specific register addresses are compiled in to this code */ 98/* cpu-specific register addresses are compiled in to this code */
@@ -113,17 +111,6 @@ static const char ep0name [] = "ep0";
113#define SIZE_STR "" 111#define SIZE_STR ""
114#endif 112#endif
115 113
116#ifdef DISABLE_TEST_MODE
117/* (mode == 0) == no undocumented chip tweaks
118 * (mode & 1) == double buffer bulk IN
119 * (mode & 2) == double buffer bulk OUT
120 * ... so mode = 3 (or 7, 15, etc) does it for both
121 */
122static ushort fifo_mode = 0;
123module_param(fifo_mode, ushort, 0);
124MODULE_PARM_DESC (fifo_mode, "pxa2xx udc fifo mode");
125#endif
126
127/* --------------------------------------------------------------------------- 114/* ---------------------------------------------------------------------------
128 * endpoint related parts of the api to the usb controller hardware, 115 * endpoint related parts of the api to the usb controller hardware,
129 * used by gadget driver; and the inner talker-to-hardware core. 116 * used by gadget driver; and the inner talker-to-hardware core.
@@ -980,7 +967,7 @@ static int pxa2xx_udc_pullup(struct usb_gadget *_gadget, int is_active)
980 udc = container_of(_gadget, struct pxa2xx_udc, gadget); 967 udc = container_of(_gadget, struct pxa2xx_udc, gadget);
981 968
982 /* not all boards support pullup control */ 969 /* not all boards support pullup control */
983 if (!udc->mach->udc_command) 970 if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
984 return -EOPNOTSUPP; 971 return -EOPNOTSUPP;
985 972
986 is_active = (is_active != 0); 973 is_active = (is_active != 0);
@@ -1252,23 +1239,6 @@ static void udc_enable (struct pxa2xx_udc *dev)
1252 UDC_RES2 = 0x00; 1239 UDC_RES2 = 0x00;
1253 } 1240 }
1254 1241
1255#ifdef DISABLE_TEST_MODE
1256 /* "test mode" seems to have become the default in later chip
1257 * revs, preventing double buffering (and invalidating docs).
1258 * this EXPERIMENT enables it for bulk endpoints by tweaking
1259 * undefined/reserved register bits (that other drivers clear).
1260 * Belcarra code comments noted this usage.
1261 */
1262 if (fifo_mode & 1) { /* IN endpoints */
1263 UDC_RES1 |= USIR0_IR1|USIR0_IR6;
1264 UDC_RES2 |= USIR1_IR11;
1265 }
1266 if (fifo_mode & 2) { /* OUT endpoints */
1267 UDC_RES1 |= USIR0_IR2|USIR0_IR7;
1268 UDC_RES2 |= USIR1_IR12;
1269 }
1270#endif
1271
1272 /* enable suspend/resume and reset irqs */ 1242 /* enable suspend/resume and reset irqs */
1273 udc_clear_mask_UDCCR(UDCCR_SRM | UDCCR_REM); 1243 udc_clear_mask_UDCCR(UDCCR_SRM | UDCCR_REM);
1274 1244
@@ -2339,7 +2309,7 @@ static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
2339{ 2309{
2340 struct pxa2xx_udc *udc = platform_get_drvdata(dev); 2310 struct pxa2xx_udc *udc = platform_get_drvdata(dev);
2341 2311
2342 if (!udc->mach->udc_command) 2312 if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
2343 WARN("USB host won't detect disconnect!\n"); 2313 WARN("USB host won't detect disconnect!\n");
2344 pullup(udc, 0); 2314 pullup(udc, 0);
2345 2315