summaryrefslogtreecommitdiff
path: root/packages/linux/linux-2.6.21/pxa2xx_udc.patch
blob: 4489e701bfd57907e6ad63b91686254306e50379 (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
59
60
61
62
63
64
65
Index: linux-2.6.21gum/drivers/usb/gadget/pxa2xx_udc.c
===================================================================
--- linux-2.6.21gum.orig/drivers/usb/gadget/pxa2xx_udc.c
+++ linux-2.6.21gum/drivers/usb/gadget/pxa2xx_udc.c
@@ -51,6 +51,7 @@
 #include <asm/mach-types.h>
 #include <asm/unaligned.h>
 #include <asm/hardware.h>
+#include <asm/mach/irq.h>
 #ifdef CONFIG_ARCH_PXA
 #include <asm/arch/pxa-regs.h>
 #endif
@@ -101,6 +102,10 @@ static const char ep0name [] = "ep0";
 
 #endif
 
+#ifdef CONFIG_ARCH_GUMSTIX
+#undef CONFIG_USB_PXA2XX_SMALL
+#endif
+
 #include "pxa2xx_udc.h"
 
 
@@ -2541,6 +2546,41 @@ static int __init pxa2xx_udc_probe(struc
 	}
 #endif
 
+	/* Reset UDCCS register to be able to recover from whatever
+	 * state UDC was previously in. */
+	*dev->ep[ 2].reg_udccs = UDCCS_BO_RPC | UDCCS_BO_SST;
+#ifndef CONFIG_USB_PXA2XX_SMALL
+	*dev->ep[ 7].reg_udccs = UDCCS_BO_RPC | UDCCS_BO_SST;
+        *dev->ep[12].reg_udccs = UDCCS_BO_RPC | UDCCS_BO_SST;
+#endif
+
+	*dev->ep[ 1].reg_udccs = UDCCS_BI_TPC | UDCCS_BI_FTF |
+		UDCCS_BI_TUR | UDCCS_BI_SST | UDCCS_BI_TSP;
+#ifndef CONFIG_USB_PXA2XX_SMALL
+	*dev->ep[ 6].reg_udccs = UDCCS_BI_TPC | UDCCS_BI_FTF |
+		UDCCS_BI_TUR | UDCCS_BI_SST | UDCCS_BI_TSP;
+	*dev->ep[11].reg_udccs = UDCCS_BI_TPC | UDCCS_BI_FTF |
+		UDCCS_BI_TUR | UDCCS_BI_SST | UDCCS_BI_TSP;
+
+	*dev->ep[ 3].reg_udccs = UDCCS_II_TPC | UDCCS_II_FTF |
+		UDCCS_II_TUR | UDCCS_II_TSP;
+	*dev->ep[ 8].reg_udccs = UDCCS_II_TPC | UDCCS_II_FTF |
+		UDCCS_II_TUR | UDCCS_II_TSP;
+	*dev->ep[13].reg_udccs = UDCCS_II_TPC | UDCCS_II_FTF |
+		UDCCS_II_TUR | UDCCS_II_TSP;
+
+	*dev->ep[ 4].reg_udccs = UDCCS_IO_RPC | UDCCS_IO_ROF;
+	*dev->ep[ 9].reg_udccs = UDCCS_IO_RPC | UDCCS_IO_ROF;
+	*dev->ep[11].reg_udccs = UDCCS_IO_RPC | UDCCS_IO_ROF;
+
+	*dev->ep[ 5].reg_udccs = UDCCS_INT_TPC | UDCCS_INT_FTF |
+		UDCCS_INT_TUR | UDCCS_INT_SST;
+	*dev->ep[10].reg_udccs = UDCCS_INT_TPC | UDCCS_INT_FTF |
+		UDCCS_INT_TUR | UDCCS_INT_SST;
+	*dev->ep[15].reg_udccs = UDCCS_INT_TPC | UDCCS_INT_FTF |
+		UDCCS_INT_TUR | UDCCS_INT_SST;
+#endif
+
 	/* other non-static parts of init */
 	dev->dev = &pdev->dev;
 	dev->mach = pdev->dev.platform_data;