summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx-2.6.21/patches/e6-eoc.patch
blob: f6e152c735347378eec7067120af34e2d5e5b1ed (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
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-21 21:38:52.000000000 -0300
+++ linux-2.6.21/arch/arm/mach-pxa/ezx-e6.c	2007-09-21 21:49:42.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);
@@ -203,8 +204,65 @@
 	},
 };
 
+
+/* 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,
+	&e6_eoc_device,
 };
 
 static void __init e6_init(void)