summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx-2.6.21/patches/e6-eoc.patch
blob: 79c60c8ca2065951edf9857674ce6eea43bc2243 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Index: linux-2.6.21/arch/arm/mach-pxa/ezx-e6.c
===================================================================
--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx-e6.c	2007-09-07 22:15:52.000000000 -0300
+++ linux-2.6.21/arch/arm/mach-pxa/ezx-e6.c	2007-09-09 13:29:56.000000000 -0300
@@ -25,6 +25,7 @@
 #include <asm/arch/mmc.h>
 
 #include "generic.h"
+#include "ezx-eoc.h"
 
 extern void ezx_lcd_power(int, struct fb_var_screeninfo *);
 extern void ezx_backlight_power(int);
@@ -227,11 +228,69 @@
 	.resource       = pcap_ts_resources,
 };
 
+
+/* EOC */
+static const unsigned int tab_init_eoc_reg[][2] =
+{
+    {POWER_IC_REG_EOC_INT_MASK,        0x00000FEF},
+    {POWER_IC_REG_EOC_POWER_CONTROL_0, 0x00000C00},
+    {POWER_IC_REG_EOC_POWER_CONTROL_1, 0x0000000C},
+    {POWER_IC_REG_EOC_CONN_CONTROL,    0x00021044},
+};
+
+static void dump_eoc_registers(void)
+{
+	int i, val = 0;
+
+	printk("========DUMP EOC=========\n");
+	for (i = 0; i < POWER_IC_REG_EOC_NUM; i++) {
+		eoc_reg_read(i, &val);
+		printk("eoc_registers[%d] = 0x%08X\n", i, val);
+	}
+	printk("========END DUMP=========\n");
+}
+
+/*
+ * FIXME: The same about the PCAP driver applies here.
+ * This is the initial state only.
+ * Which bits does the change to USB/UART/AUDIO mode?
+ * I think that this is causing the crash on pxa27x-udc
+ * you are setting the 'port connected' bit, and thats why
+ * you are getting interrupts early.
+ * --WM
+ */
+
+static int __init e6_eoc_init(void)
+{
+    int i;
+
+    for (i = 0; i < sizeof(tab_init_eoc_reg)/sizeof(unsigned int)/2; i++)
+    {
+		eoc_reg_write(tab_init_eoc_reg[i][0], tab_init_eoc_reg[i][1]);
+    }
+	dump_eoc_registers();
+	return 0;
+}
+
+static struct ezx_eoc_platform_data e6_eoc_platform_data = {
+	.init		= e6_eoc_init,
+};
+
+struct platform_device e6_eoc_device = {
+	.name		= "ezx-eoc",
+	.id		= -1,
+	.dev		= {
+		.platform_data = &e6_eoc_platform_data,
+	},
+};
+
 static struct platform_device *devices[] __initdata = {
 	&e6_pcap_device,
 	&pcap_ts_device,
+	&e6_eoc_device,
 };
 
+
 static void __init e6_init(void)
 {
 	set_pxa_fb_info(&e6_fb_info);