summaryrefslogtreecommitdiff
path: root/target/linux/pxa/patches/002-usb_gadget.patch
blob: b6766d9b3b50806ebdb823b0e742e9859609f82a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff -NurbwB linux-2.6.17/drivers/usb/gadget/pxa2xx_udc.c linux-2.6.17-patched/drivers/usb/gadget/pxa2xx_udc.c
--- linux-2.6.17/drivers/usb/gadget/pxa2xx_udc.c	2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-patched/drivers/usb/gadget/pxa2xx_udc.c	2006-09-11 13:02:39.000000000 -0700
@@ -87,8 +87,8 @@
 static const char ep0name [] = "ep0";
 
 
-// #define	USE_DMA
-// #define	USE_OUT_DMA
+#define	USE_DMA
+#define	USE_OUT_DMA
 // #define	DISABLE_TEST_MODE
 
 #ifdef CONFIG_ARCH_IXP4XX
@@ -1513,7 +1513,7 @@
 #endif
 
 	/* try to clear these bits before we enable the udc */
-	udc_ack_int_UDCCR(UDCCR_SUSIR|/*UDCCR_RSTIR|*/UDCCR_RESIR);
+	udc_ack_int_UDCCR(UDCCR_SUSIR|UDCCR_RSTIR|UDCCR_RESIR);
 
 	ep0_idle(dev);
 	dev->gadget.speed = USB_SPEED_UNKNOWN;
@@ -2043,6 +2043,9 @@
 	struct pxa2xx_udc	*dev = _dev;
 	int			handled;
 
+
+	udc_set_mask_UDCCR( UDCCR_REM | UDCCR_SRM);
+
 	dev->stats.irqs++;
 	HEX_DISPLAY(dev->stats.irqs);
 	do {
@@ -2137,6 +2139,8 @@
 		/* we could also ask for 1 msec SOF (SIR) interrupts */
 
 	} while (handled);
+
+	udc_clear_mask_UDCCR( UDCCR_SRM | UDCCR_REM);
 	return IRQ_HANDLED;
 }
 
@@ -2437,6 +2441,7 @@
 	int retval, out_dma = 1;
 	u32 chiprev;
 
+	local_irq_disable();
 	/* insist on Intel/ARM/XScale */
 	asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
 	if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
@@ -2553,6 +2558,7 @@
 #endif
 	}
 #endif
+	local_irq_enable();
 	create_proc_files();
 
 	return 0;