aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-12-22 14:30:12 -0500
committerTony Lindgren <tony@atomide.com>2010-12-22 14:30:12 -0500
commitc10abbb26513f4ccff89c4d80912cb4d36fcd3e8 (patch)
treeb2a44e08e9e683078e9d20d6072a513798788314 /arch/arm/mach-omap1
parent4931445b94f49672028b81ace9d4eee8ddf19ab2 (diff)
parentda1f026b532ce944d74461497dc6d8c16456466e (diff)
Merge branches 'devel-gpmc' and 'devel-misc' into omap-for-linus
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/Makefile2
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c128
-rw-r--r--arch/arm/mach-omap1/board-fsample.c67
-rw-r--r--arch/arm/mach-omap1/board-h2.c75
-rw-r--r--arch/arm/mach-omap1/board-h3.c75
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c98
-rw-r--r--arch/arm/mach-omap1/board-innovator.c21
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c29
-rw-r--r--arch/arm/mach-omap1/board-osk.c21
-rw-r--r--arch/arm/mach-omap1/board-palmte.c28
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c28
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c30
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c69
-rw-r--r--arch/arm/mach-omap1/board-sx1.c57
-rw-r--r--arch/arm/mach-omap1/dma.c390
15 files changed, 775 insertions, 343 deletions
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 0b1c07ffa2f1..6ee19504845f 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o 6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o 7obj-y += clock.o clock_data.o opp_data.o
8 8
9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index e1439506eba9..bd0495a9ac3b 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -43,84 +43,82 @@
43static u8 ams_delta_latch1_reg; 43static u8 ams_delta_latch1_reg;
44static u16 ams_delta_latch2_reg; 44static u16 ams_delta_latch2_reg;
45 45
46static int ams_delta_keymap[] = { 46static const unsigned int ams_delta_keymap[] = {
47 KEY(0, 0, KEY_F1), /* Advert */ 47 KEY(0, 0, KEY_F1), /* Advert */
48 48
49 KEY(3, 0, KEY_COFFEE), /* Games */ 49 KEY(0, 3, KEY_COFFEE), /* Games */
50 KEY(2, 0, KEY_QUESTION), /* Directory */ 50 KEY(0, 2, KEY_QUESTION), /* Directory */
51 KEY(3, 2, KEY_CONNECT), /* Internet */ 51 KEY(2, 3, KEY_CONNECT), /* Internet */
52 KEY(2, 1, KEY_SHOP), /* Services */ 52 KEY(1, 2, KEY_SHOP), /* Services */
53 KEY(1, 1, KEY_PHONE), /* VoiceMail */ 53 KEY(1, 1, KEY_PHONE), /* VoiceMail */
54 54
55 KEY(1, 0, KEY_DELETE), /* Delete */ 55 KEY(0, 1, KEY_DELETE), /* Delete */
56 KEY(2, 2, KEY_PLAY), /* Play */ 56 KEY(2, 2, KEY_PLAY), /* Play */
57 KEY(0, 1, KEY_PAGEUP), /* Up */ 57 KEY(1, 0, KEY_PAGEUP), /* Up */
58 KEY(3, 1, KEY_PAGEDOWN), /* Down */ 58 KEY(1, 3, KEY_PAGEDOWN), /* Down */
59 KEY(0, 2, KEY_EMAIL), /* ReadEmail */ 59 KEY(2, 0, KEY_EMAIL), /* ReadEmail */
60 KEY(1, 2, KEY_STOP), /* Stop */ 60 KEY(2, 1, KEY_STOP), /* Stop */
61 61
62 /* Numeric keypad portion */ 62 /* Numeric keypad portion */
63 KEY(7, 0, KEY_KP1), 63 KEY(0, 7, KEY_KP1),
64 KEY(6, 0, KEY_KP2), 64 KEY(0, 6, KEY_KP2),
65 KEY(5, 0, KEY_KP3), 65 KEY(0, 5, KEY_KP3),
66 KEY(7, 1, KEY_KP4), 66 KEY(1, 7, KEY_KP4),
67 KEY(6, 1, KEY_KP5), 67 KEY(1, 6, KEY_KP5),
68 KEY(5, 1, KEY_KP6), 68 KEY(1, 5, KEY_KP6),
69 KEY(7, 2, KEY_KP7), 69 KEY(2, 7, KEY_KP7),
70 KEY(6, 2, KEY_KP8), 70 KEY(2, 6, KEY_KP8),
71 KEY(5, 2, KEY_KP9), 71 KEY(2, 5, KEY_KP9),
72 KEY(6, 3, KEY_KP0), 72 KEY(3, 6, KEY_KP0),
73 KEY(7, 3, KEY_KPASTERISK), 73 KEY(3, 7, KEY_KPASTERISK),
74 KEY(5, 3, KEY_KPDOT), /* # key */ 74 KEY(3, 5, KEY_KPDOT), /* # key */
75 KEY(2, 7, KEY_NUMLOCK), /* Mute */ 75 KEY(7, 2, KEY_NUMLOCK), /* Mute */
76 KEY(1, 7, KEY_KPMINUS), /* Recall */ 76 KEY(7, 1, KEY_KPMINUS), /* Recall */
77 KEY(1, 6, KEY_KPPLUS), /* Redial */ 77 KEY(6, 1, KEY_KPPLUS), /* Redial */
78 KEY(6, 7, KEY_KPSLASH), /* Handsfree */ 78 KEY(7, 6, KEY_KPSLASH), /* Handsfree */
79 KEY(0, 6, KEY_ENTER), /* Video */ 79 KEY(6, 0, KEY_ENTER), /* Video */
80 80
81 KEY(4, 7, KEY_CAMERA), /* Photo */ 81 KEY(7, 4, KEY_CAMERA), /* Photo */
82 82
83 KEY(4, 0, KEY_F2), /* Home */ 83 KEY(0, 4, KEY_F2), /* Home */
84 KEY(4, 1, KEY_F3), /* Office */ 84 KEY(1, 4, KEY_F3), /* Office */
85 KEY(4, 2, KEY_F4), /* Mobile */ 85 KEY(2, 4, KEY_F4), /* Mobile */
86 KEY(7, 7, KEY_F5), /* SMS */ 86 KEY(7, 7, KEY_F5), /* SMS */
87 KEY(5, 7, KEY_F6), /* Email */ 87 KEY(7, 5, KEY_F6), /* Email */
88 88
89 /* QWERTY portion of keypad */ 89 /* QWERTY portion of keypad */
90 KEY(4, 3, KEY_Q), 90 KEY(3, 4, KEY_Q),
91 KEY(3, 3, KEY_W), 91 KEY(3, 3, KEY_W),
92 KEY(2, 3, KEY_E), 92 KEY(3, 2, KEY_E),
93 KEY(1, 3, KEY_R), 93 KEY(3, 1, KEY_R),
94 KEY(0, 3, KEY_T), 94 KEY(3, 0, KEY_T),
95 KEY(7, 4, KEY_Y), 95 KEY(4, 7, KEY_Y),
96 KEY(6, 4, KEY_U), 96 KEY(4, 6, KEY_U),
97 KEY(5, 4, KEY_I), 97 KEY(4, 5, KEY_I),
98 KEY(4, 4, KEY_O), 98 KEY(4, 4, KEY_O),
99 KEY(3, 4, KEY_P), 99 KEY(4, 3, KEY_P),
100 100
101 KEY(2, 4, KEY_A), 101 KEY(4, 2, KEY_A),
102 KEY(1, 4, KEY_S), 102 KEY(4, 1, KEY_S),
103 KEY(0, 4, KEY_D), 103 KEY(4, 0, KEY_D),
104 KEY(7, 5, KEY_F), 104 KEY(5, 7, KEY_F),
105 KEY(6, 5, KEY_G), 105 KEY(5, 6, KEY_G),
106 KEY(5, 5, KEY_H), 106 KEY(5, 5, KEY_H),
107 KEY(4, 5, KEY_J), 107 KEY(5, 4, KEY_J),
108 KEY(3, 5, KEY_K), 108 KEY(5, 3, KEY_K),
109 KEY(2, 5, KEY_L), 109 KEY(5, 2, KEY_L),
110 110
111 KEY(1, 5, KEY_Z), 111 KEY(5, 1, KEY_Z),
112 KEY(0, 5, KEY_X), 112 KEY(5, 0, KEY_X),
113 KEY(7, 6, KEY_C), 113 KEY(6, 7, KEY_C),
114 KEY(6, 6, KEY_V), 114 KEY(6, 6, KEY_V),
115 KEY(5, 6, KEY_B), 115 KEY(6, 5, KEY_B),
116 KEY(4, 6, KEY_N), 116 KEY(6, 4, KEY_N),
117 KEY(3, 6, KEY_M), 117 KEY(6, 3, KEY_M),
118 KEY(2, 6, KEY_SPACE), 118 KEY(6, 2, KEY_SPACE),
119 119
120 KEY(0, 7, KEY_LEFTSHIFT), /* Vol up */ 120 KEY(7, 0, KEY_LEFTSHIFT), /* Vol up */
121 KEY(3, 7, KEY_LEFTCTRL), /* Vol down */ 121 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
122
123 0
124}; 122};
125 123
126void ams_delta_latch1_write(u8 mask, u8 value) 124void ams_delta_latch1_write(u8 mask, u8 value)
@@ -189,11 +187,15 @@ static struct resource ams_delta_kp_resources[] = {
189 }, 187 },
190}; 188};
191 189
190static const struct matrix_keymap_data ams_delta_keymap_data = {
191 .keymap = ams_delta_keymap,
192 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
193};
194
192static struct omap_kp_platform_data ams_delta_kp_data = { 195static struct omap_kp_platform_data ams_delta_kp_data = {
193 .rows = 8, 196 .rows = 8,
194 .cols = 8, 197 .cols = 8,
195 .keymap = ams_delta_keymap, 198 .keymap_data = &ams_delta_keymap_data,
196 .keymapsize = ARRAY_SIZE(ams_delta_keymap),
197 .delay = 9, 199 .delay = 9,
198}; 200};
199 201
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 0c3f396328bd..0efb9dbae44c 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -69,36 +69,35 @@
69#define fsample_cpld_clear(bit) \ 69#define fsample_cpld_clear(bit) \
70 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) 70 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR)
71 71
72static int fsample_keymap[] = { 72static const unsigned int fsample_keymap[] = {
73 KEY(0,0,KEY_UP), 73 KEY(0, 0, KEY_UP),
74 KEY(0,1,KEY_RIGHT), 74 KEY(1, 0, KEY_RIGHT),
75 KEY(0,2,KEY_LEFT), 75 KEY(2, 0, KEY_LEFT),
76 KEY(0,3,KEY_DOWN), 76 KEY(3, 0, KEY_DOWN),
77 KEY(0,4,KEY_ENTER), 77 KEY(4, 0, KEY_ENTER),
78 KEY(1,0,KEY_F10), 78 KEY(0, 1, KEY_F10),
79 KEY(1,1,KEY_SEND), 79 KEY(1, 1, KEY_SEND),
80 KEY(1,2,KEY_END), 80 KEY(2, 1, KEY_END),
81 KEY(1,3,KEY_VOLUMEDOWN), 81 KEY(3, 1, KEY_VOLUMEDOWN),
82 KEY(1,4,KEY_VOLUMEUP), 82 KEY(4, 1, KEY_VOLUMEUP),
83 KEY(1,5,KEY_RECORD), 83 KEY(5, 1, KEY_RECORD),
84 KEY(2,0,KEY_F9), 84 KEY(0, 2, KEY_F9),
85 KEY(2,1,KEY_3), 85 KEY(1, 2, KEY_3),
86 KEY(2,2,KEY_6), 86 KEY(2, 2, KEY_6),
87 KEY(2,3,KEY_9), 87 KEY(3, 2, KEY_9),
88 KEY(2,4,KEY_KPDOT), 88 KEY(4, 2, KEY_KPDOT),
89 KEY(3,0,KEY_BACK), 89 KEY(0, 3, KEY_BACK),
90 KEY(3,1,KEY_2), 90 KEY(1, 3, KEY_2),
91 KEY(3,2,KEY_5), 91 KEY(2, 3, KEY_5),
92 KEY(3,3,KEY_8), 92 KEY(3, 3, KEY_8),
93 KEY(3,4,KEY_0), 93 KEY(4, 3, KEY_0),
94 KEY(3,5,KEY_KPSLASH), 94 KEY(5, 3, KEY_KPSLASH),
95 KEY(4,0,KEY_HOME), 95 KEY(0, 4, KEY_HOME),
96 KEY(4,1,KEY_1), 96 KEY(1, 4, KEY_1),
97 KEY(4,2,KEY_4), 97 KEY(2, 4, KEY_4),
98 KEY(4,3,KEY_7), 98 KEY(3, 4, KEY_7),
99 KEY(4,4,KEY_KPASTERISK), 99 KEY(4, 4, KEY_KPASTERISK),
100 KEY(4,5,KEY_POWER), 100 KEY(5, 4, KEY_POWER),
101 0
102}; 101};
103 102
104static struct smc91x_platdata smc91x_info = { 103static struct smc91x_platdata smc91x_info = {
@@ -253,11 +252,15 @@ static struct resource kp_resources[] = {
253 }, 252 },
254}; 253};
255 254
255static const struct matrix_keymap_data fsample_keymap_data = {
256 .keymap = fsample_keymap,
257 .keymap_size = ARRAY_SIZE(fsample_keymap),
258};
259
256static struct omap_kp_platform_data kp_data = { 260static struct omap_kp_platform_data kp_data = {
257 .rows = 8, 261 .rows = 8,
258 .cols = 8, 262 .cols = 8,
259 .keymap = fsample_keymap, 263 .keymap_data = &fsample_keymap_data,
260 .keymapsize = ARRAY_SIZE(fsample_keymap),
261 .delay = 4, 264 .delay = 4,
262}; 265};
263 266
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 082a73ca5564..28b84aa9bdba 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -52,43 +52,42 @@
52/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 52/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
53#define OMAP1610_ETHR_START 0x04000300 53#define OMAP1610_ETHR_START 0x04000300
54 54
55static int h2_keymap[] = { 55static const unsigned int h2_keymap[] = {
56 KEY(0, 0, KEY_LEFT), 56 KEY(0, 0, KEY_LEFT),
57 KEY(0, 1, KEY_RIGHT), 57 KEY(1, 0, KEY_RIGHT),
58 KEY(0, 2, KEY_3), 58 KEY(2, 0, KEY_3),
59 KEY(0, 3, KEY_F10), 59 KEY(3, 0, KEY_F10),
60 KEY(0, 4, KEY_F5), 60 KEY(4, 0, KEY_F5),
61 KEY(0, 5, KEY_9), 61 KEY(5, 0, KEY_9),
62 KEY(1, 0, KEY_DOWN), 62 KEY(0, 1, KEY_DOWN),
63 KEY(1, 1, KEY_UP), 63 KEY(1, 1, KEY_UP),
64 KEY(1, 2, KEY_2), 64 KEY(2, 1, KEY_2),
65 KEY(1, 3, KEY_F9), 65 KEY(3, 1, KEY_F9),
66 KEY(1, 4, KEY_F7), 66 KEY(4, 1, KEY_F7),
67 KEY(1, 5, KEY_0), 67 KEY(5, 1, KEY_0),
68 KEY(2, 0, KEY_ENTER), 68 KEY(0, 2, KEY_ENTER),
69 KEY(2, 1, KEY_6), 69 KEY(1, 2, KEY_6),
70 KEY(2, 2, KEY_1), 70 KEY(2, 2, KEY_1),
71 KEY(2, 3, KEY_F2), 71 KEY(3, 2, KEY_F2),
72 KEY(2, 4, KEY_F6), 72 KEY(4, 2, KEY_F6),
73 KEY(2, 5, KEY_HOME), 73 KEY(5, 2, KEY_HOME),
74 KEY(3, 0, KEY_8), 74 KEY(0, 3, KEY_8),
75 KEY(3, 1, KEY_5), 75 KEY(1, 3, KEY_5),
76 KEY(3, 2, KEY_F12), 76 KEY(2, 3, KEY_F12),
77 KEY(3, 3, KEY_F3), 77 KEY(3, 3, KEY_F3),
78 KEY(3, 4, KEY_F8), 78 KEY(4, 3, KEY_F8),
79 KEY(3, 5, KEY_END), 79 KEY(5, 3, KEY_END),
80 KEY(4, 0, KEY_7), 80 KEY(0, 4, KEY_7),
81 KEY(4, 1, KEY_4), 81 KEY(1, 4, KEY_4),
82 KEY(4, 2, KEY_F11), 82 KEY(2, 4, KEY_F11),
83 KEY(4, 3, KEY_F1), 83 KEY(3, 4, KEY_F1),
84 KEY(4, 4, KEY_F4), 84 KEY(4, 4, KEY_F4),
85 KEY(4, 5, KEY_ESC), 85 KEY(5, 4, KEY_ESC),
86 KEY(5, 0, KEY_F13), 86 KEY(0, 5, KEY_F13),
87 KEY(5, 1, KEY_F14), 87 KEY(1, 5, KEY_F14),
88 KEY(5, 2, KEY_F15), 88 KEY(2, 5, KEY_F15),
89 KEY(5, 3, KEY_F16), 89 KEY(3, 5, KEY_F16),
90 KEY(5, 4, KEY_SLEEP), 90 KEY(4, 5, KEY_SLEEP),
91 0
92}; 91};
93 92
94static struct mtd_partition h2_nor_partitions[] = { 93static struct mtd_partition h2_nor_partitions[] = {
@@ -270,14 +269,18 @@ static struct resource h2_kp_resources[] = {
270 }, 269 },
271}; 270};
272 271
272static const struct matrix_keymap_data h2_keymap_data = {
273 .keymap = h2_keymap,
274 .keymap_size = ARRAY_SIZE(h2_keymap),
275};
276
273static struct omap_kp_platform_data h2_kp_data = { 277static struct omap_kp_platform_data h2_kp_data = {
274 .rows = 8, 278 .rows = 8,
275 .cols = 8, 279 .cols = 8,
276 .keymap = h2_keymap, 280 .keymap_data = &h2_keymap_data,
277 .keymapsize = ARRAY_SIZE(h2_keymap), 281 .rep = true,
278 .rep = 1,
279 .delay = 9, 282 .delay = 9,
280 .dbounce = 1, 283 .dbounce = true,
281}; 284};
282 285
283static struct platform_device h2_kp_device = { 286static struct platform_device h2_kp_device = {
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index d2cff5022fe5..dbc8b8d882ba 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -56,43 +56,42 @@
56 56
57#define H3_TS_GPIO 48 57#define H3_TS_GPIO 48
58 58
59static int h3_keymap[] = { 59static const unsigned int h3_keymap[] = {
60 KEY(0, 0, KEY_LEFT), 60 KEY(0, 0, KEY_LEFT),
61 KEY(0, 1, KEY_RIGHT), 61 KEY(1, 0, KEY_RIGHT),
62 KEY(0, 2, KEY_3), 62 KEY(2, 0, KEY_3),
63 KEY(0, 3, KEY_F10), 63 KEY(3, 0, KEY_F10),
64 KEY(0, 4, KEY_F5), 64 KEY(4, 0, KEY_F5),
65 KEY(0, 5, KEY_9), 65 KEY(5, 0, KEY_9),
66 KEY(1, 0, KEY_DOWN), 66 KEY(0, 1, KEY_DOWN),
67 KEY(1, 1, KEY_UP), 67 KEY(1, 1, KEY_UP),
68 KEY(1, 2, KEY_2), 68 KEY(2, 1, KEY_2),
69 KEY(1, 3, KEY_F9), 69 KEY(3, 1, KEY_F9),
70 KEY(1, 4, KEY_F7), 70 KEY(4, 1, KEY_F7),
71 KEY(1, 5, KEY_0), 71 KEY(5, 1, KEY_0),
72 KEY(2, 0, KEY_ENTER), 72 KEY(0, 2, KEY_ENTER),
73 KEY(2, 1, KEY_6), 73 KEY(1, 2, KEY_6),
74 KEY(2, 2, KEY_1), 74 KEY(2, 2, KEY_1),
75 KEY(2, 3, KEY_F2), 75 KEY(3, 2, KEY_F2),
76 KEY(2, 4, KEY_F6), 76 KEY(4, 2, KEY_F6),
77 KEY(2, 5, KEY_HOME), 77 KEY(5, 2, KEY_HOME),
78 KEY(3, 0, KEY_8), 78 KEY(0, 3, KEY_8),
79 KEY(3, 1, KEY_5), 79 KEY(1, 3, KEY_5),
80 KEY(3, 2, KEY_F12), 80 KEY(2, 3, KEY_F12),
81 KEY(3, 3, KEY_F3), 81 KEY(3, 3, KEY_F3),
82 KEY(3, 4, KEY_F8), 82 KEY(4, 3, KEY_F8),
83 KEY(3, 5, KEY_END), 83 KEY(5, 3, KEY_END),
84 KEY(4, 0, KEY_7), 84 KEY(0, 4, KEY_7),
85 KEY(4, 1, KEY_4), 85 KEY(1, 4, KEY_4),
86 KEY(4, 2, KEY_F11), 86 KEY(2, 4, KEY_F11),
87 KEY(4, 3, KEY_F1), 87 KEY(3, 4, KEY_F1),
88 KEY(4, 4, KEY_F4), 88 KEY(4, 4, KEY_F4),
89 KEY(4, 5, KEY_ESC), 89 KEY(5, 4, KEY_ESC),
90 KEY(5, 0, KEY_F13), 90 KEY(0, 5, KEY_F13),
91 KEY(5, 1, KEY_F14), 91 KEY(1, 5, KEY_F14),
92 KEY(5, 2, KEY_F15), 92 KEY(2, 5, KEY_F15),
93 KEY(5, 3, KEY_F16), 93 KEY(3, 5, KEY_F16),
94 KEY(5, 4, KEY_SLEEP), 94 KEY(4, 5, KEY_SLEEP),
95 0
96}; 95};
97 96
98 97
@@ -305,14 +304,18 @@ static struct resource h3_kp_resources[] = {
305 }, 304 },
306}; 305};
307 306
307static const struct matrix_keymap_data h3_keymap_data = {
308 .keymap = h3_keymap,
309 .keymap_size = ARRAY_SIZE(h3_keymap),
310};
311
308static struct omap_kp_platform_data h3_kp_data = { 312static struct omap_kp_platform_data h3_kp_data = {
309 .rows = 8, 313 .rows = 8,
310 .cols = 8, 314 .cols = 8,
311 .keymap = h3_keymap, 315 .keymap_data = &h3_keymap_data,
312 .keymapsize = ARRAY_SIZE(h3_keymap), 316 .rep = true,
313 .rep = 1,
314 .delay = 9, 317 .delay = 9,
315 .dbounce = 1, 318 .dbounce = true,
316}; 319};
317 320
318static struct platform_device h3_kp_device = { 321static struct platform_device h3_kp_device = {
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 742c6d107268..f2c5c585bc83 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -180,64 +180,68 @@
180 180
181/* Keyboard definition */ 181/* Keyboard definition */
182 182
183static int htc_herald_keymap[] = { 183static const unsigned int htc_herald_keymap[] = {
184 KEY(0, 0, KEY_RECORD), /* Mail button */ 184 KEY(0, 0, KEY_RECORD), /* Mail button */
185 KEY(0, 1, KEY_CAMERA), /* Camera */ 185 KEY(1, 0, KEY_CAMERA), /* Camera */
186 KEY(0, 2, KEY_PHONE), /* Send key */ 186 KEY(2, 0, KEY_PHONE), /* Send key */
187 KEY(0, 3, KEY_VOLUMEUP), /* Volume up */ 187 KEY(3, 0, KEY_VOLUMEUP), /* Volume up */
188 KEY(0, 4, KEY_F2), /* Right bar (landscape) */ 188 KEY(4, 0, KEY_F2), /* Right bar (landscape) */
189 KEY(0, 5, KEY_MAIL), /* Win key (portrait) */ 189 KEY(5, 0, KEY_MAIL), /* Win key (portrait) */
190 KEY(0, 6, KEY_DIRECTORY), /* Right bar (protrait) */ 190 KEY(6, 0, KEY_DIRECTORY), /* Right bar (protrait) */
191 KEY(1, 0, KEY_LEFTCTRL), /* Windows key */ 191 KEY(0, 1, KEY_LEFTCTRL), /* Windows key */
192 KEY(1, 1, KEY_COMMA), 192 KEY(1, 1, KEY_COMMA),
193 KEY(1, 2, KEY_M), 193 KEY(2, 1, KEY_M),
194 KEY(1, 3, KEY_K), 194 KEY(3, 1, KEY_K),
195 KEY(1, 4, KEY_SLASH), /* OK key */ 195 KEY(4, 1, KEY_SLASH), /* OK key */
196 KEY(1, 5, KEY_I), 196 KEY(5, 1, KEY_I),
197 KEY(1, 6, KEY_U), 197 KEY(6, 1, KEY_U),
198 KEY(2, 0, KEY_LEFTALT), 198 KEY(0, 2, KEY_LEFTALT),
199 KEY(2, 1, KEY_TAB), 199 KEY(1, 2, KEY_TAB),
200 KEY(2, 2, KEY_N), 200 KEY(2, 2, KEY_N),
201 KEY(2, 3, KEY_J), 201 KEY(3, 2, KEY_J),
202 KEY(2, 4, KEY_ENTER), 202 KEY(4, 2, KEY_ENTER),
203 KEY(2, 5, KEY_H), 203 KEY(5, 2, KEY_H),
204 KEY(2, 6, KEY_Y), 204 KEY(6, 2, KEY_Y),
205 KEY(3, 0, KEY_SPACE), 205 KEY(0, 3, KEY_SPACE),
206 KEY(3, 1, KEY_L), 206 KEY(1, 3, KEY_L),
207 KEY(3, 2, KEY_B), 207 KEY(2, 3, KEY_B),
208 KEY(3, 3, KEY_V), 208 KEY(3, 3, KEY_V),
209 KEY(3, 4, KEY_BACKSPACE), 209 KEY(4, 3, KEY_BACKSPACE),
210 KEY(3, 5, KEY_G), 210 KEY(5, 3, KEY_G),
211 KEY(3, 6, KEY_T), 211 KEY(6, 3, KEY_T),
212 KEY(4, 0, KEY_CAPSLOCK), /* Shift */ 212 KEY(0, 4, KEY_CAPSLOCK), /* Shift */
213 KEY(4, 1, KEY_C), 213 KEY(1, 4, KEY_C),
214 KEY(4, 2, KEY_F), 214 KEY(2, 4, KEY_F),
215 KEY(4, 3, KEY_R), 215 KEY(3, 4, KEY_R),
216 KEY(4, 4, KEY_O), 216 KEY(4, 4, KEY_O),
217 KEY(4, 5, KEY_E), 217 KEY(5, 4, KEY_E),
218 KEY(4, 6, KEY_D), 218 KEY(6, 4, KEY_D),
219 KEY(5, 0, KEY_X), 219 KEY(0, 5, KEY_X),
220 KEY(5, 1, KEY_Z), 220 KEY(1, 5, KEY_Z),
221 KEY(5, 2, KEY_S), 221 KEY(2, 5, KEY_S),
222 KEY(5, 3, KEY_W), 222 KEY(3, 5, KEY_W),
223 KEY(5, 4, KEY_P), 223 KEY(4, 5, KEY_P),
224 KEY(5, 5, KEY_Q), 224 KEY(5, 5, KEY_Q),
225 KEY(5, 6, KEY_A), 225 KEY(6, 5, KEY_A),
226 KEY(6, 0, KEY_CONNECT), /* Voice button */ 226 KEY(0, 6, KEY_CONNECT), /* Voice button */
227 KEY(6, 2, KEY_CANCEL), /* End key */ 227 KEY(2, 6, KEY_CANCEL), /* End key */
228 KEY(6, 3, KEY_VOLUMEDOWN), /* Volume down */ 228 KEY(3, 6, KEY_VOLUMEDOWN), /* Volume down */
229 KEY(6, 4, KEY_F1), /* Left bar (landscape) */ 229 KEY(4, 6, KEY_F1), /* Left bar (landscape) */
230 KEY(6, 5, KEY_WWW), /* OK button (portrait) */ 230 KEY(5, 6, KEY_WWW), /* OK button (portrait) */
231 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */ 231 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */
232 0
233}; 232};
234 233
235struct omap_kp_platform_data htcherald_kp_data = { 234static const struct matrix_keymap_data htc_herald_keymap_data = {
235 .keymap = htc_herald_keymap,
236 .keymap_size = ARRAY_SIZE(htc_herald_keymap),
237};
238
239static struct omap_kp_platform_data htcherald_kp_data = {
236 .rows = 7, 240 .rows = 7,
237 .cols = 7, 241 .cols = 7,
238 .delay = 20, 242 .delay = 20,
239 .rep = 1, 243 .rep = true,
240 .keymap = htc_herald_keymap, 244 .keymap_data = &htc_herald_keymap_data,
241}; 245};
242 246
243static struct resource kp_resources[] = { 247static struct resource kp_resources[] = {
@@ -278,7 +282,7 @@ static struct gpio_keys_button herald_gpio_keys_table[] = {
278static struct gpio_keys_platform_data herald_gpio_keys_data = { 282static struct gpio_keys_platform_data herald_gpio_keys_data = {
279 .buttons = herald_gpio_keys_table, 283 .buttons = herald_gpio_keys_table,
280 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table), 284 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table),
281 .rep = 1, 285 .rep = true,
282}; 286};
283 287
284static struct platform_device herald_gpiokeys_device = { 288static struct platform_device herald_gpiokeys_device = {
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 8d59b078fc2c..a36e6742bf9b 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -44,17 +44,16 @@
44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
45#define INNOVATOR1610_ETHR_START 0x04000300 45#define INNOVATOR1610_ETHR_START 0x04000300
46 46
47static int innovator_keymap[] = { 47static const unsigned int innovator_keymap[] = {
48 KEY(0, 0, KEY_F1), 48 KEY(0, 0, KEY_F1),
49 KEY(0, 3, KEY_DOWN), 49 KEY(3, 0, KEY_DOWN),
50 KEY(1, 1, KEY_F2), 50 KEY(1, 1, KEY_F2),
51 KEY(1, 2, KEY_RIGHT), 51 KEY(2, 1, KEY_RIGHT),
52 KEY(2, 0, KEY_F3), 52 KEY(0, 2, KEY_F3),
53 KEY(2, 1, KEY_F4), 53 KEY(1, 2, KEY_F4),
54 KEY(2, 2, KEY_UP), 54 KEY(2, 2, KEY_UP),
55 KEY(3, 2, KEY_ENTER), 55 KEY(2, 3, KEY_ENTER),
56 KEY(3, 3, KEY_LEFT), 56 KEY(3, 3, KEY_LEFT),
57 0
58}; 57};
59 58
60static struct mtd_partition innovator_partitions[] = { 59static struct mtd_partition innovator_partitions[] = {
@@ -126,11 +125,15 @@ static struct resource innovator_kp_resources[] = {
126 }, 125 },
127}; 126};
128 127
128static const struct matrix_keymap_data innovator_keymap_data = {
129 .keymap = innovator_keymap,
130 .keymap_size = ARRAY_SIZE(innovator_keymap),
131};
132
129static struct omap_kp_platform_data innovator_kp_data = { 133static struct omap_kp_platform_data innovator_kp_data = {
130 .rows = 8, 134 .rows = 8,
131 .cols = 8, 135 .cols = 8,
132 .keymap = innovator_keymap, 136 .keymap_data = &innovator_keymap_data,
133 .keymapsize = ARRAY_SIZE(innovator_keymap),
134 .delay = 4, 137 .delay = 4,
135}; 138};
136 139
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 605495bbc583..d21f09dc78f4 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -54,19 +54,18 @@ static void __init omap_nokia770_init_irq(void)
54 omap_init_irq(); 54 omap_init_irq();
55} 55}
56 56
57static int nokia770_keymap[] = { 57static const unsigned int nokia770_keymap[] = {
58 KEY(0, 1, GROUP_0 | KEY_UP), 58 KEY(1, 0, GROUP_0 | KEY_UP),
59 KEY(0, 2, GROUP_1 | KEY_F5), 59 KEY(2, 0, GROUP_1 | KEY_F5),
60 KEY(1, 0, GROUP_0 | KEY_LEFT), 60 KEY(0, 1, GROUP_0 | KEY_LEFT),
61 KEY(1, 1, GROUP_0 | KEY_ENTER), 61 KEY(1, 1, GROUP_0 | KEY_ENTER),
62 KEY(1, 2, GROUP_0 | KEY_RIGHT), 62 KEY(2, 1, GROUP_0 | KEY_RIGHT),
63 KEY(2, 0, GROUP_1 | KEY_ESC), 63 KEY(0, 2, GROUP_1 | KEY_ESC),
64 KEY(2, 1, GROUP_0 | KEY_DOWN), 64 KEY(1, 2, GROUP_0 | KEY_DOWN),
65 KEY(2, 2, GROUP_1 | KEY_F4), 65 KEY(2, 2, GROUP_1 | KEY_F4),
66 KEY(3, 0, GROUP_2 | KEY_F7), 66 KEY(0, 3, GROUP_2 | KEY_F7),
67 KEY(3, 1, GROUP_2 | KEY_F8), 67 KEY(1, 3, GROUP_2 | KEY_F8),
68 KEY(3, 2, GROUP_2 | KEY_F6), 68 KEY(2, 3, GROUP_2 | KEY_F6),
69 0
70}; 69};
71 70
72static struct resource nokia770_kp_resources[] = { 71static struct resource nokia770_kp_resources[] = {
@@ -77,11 +76,15 @@ static struct resource nokia770_kp_resources[] = {
77 }, 76 },
78}; 77};
79 78
79static const struct matrix_keymap_data nokia770_keymap_data = {
80 .keymap = nokia770_keymap,
81 .keymap_size = ARRAY_SIZE(nokia770_keymap),
82};
83
80static struct omap_kp_platform_data nokia770_kp_data = { 84static struct omap_kp_platform_data nokia770_kp_data = {
81 .rows = 8, 85 .rows = 8,
82 .cols = 8, 86 .cols = 8,
83 .keymap = nokia770_keymap, 87 .keymap_data = &nokia770_keymap_data,
84 .keymapsize = ARRAY_SIZE(nokia770_keymap),
85 .delay = 4, 88 .delay = 4,
86}; 89};
87 90
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index d44e7172efc2..7c5e2112c776 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -338,25 +338,28 @@ static struct i2c_board_info __initdata mistral_i2c_board_info[] = {
338 */ 338 */
339}; 339};
340 340
341static const int osk_keymap[] = { 341static const unsigned int osk_keymap[] = {
342 /* KEY(col, row, code) */ 342 /* KEY(col, row, code) */
343 KEY(0, 0, KEY_F1), /* SW4 */ 343 KEY(0, 0, KEY_F1), /* SW4 */
344 KEY(0, 3, KEY_UP), /* (sw2/up) */ 344 KEY(3, 0, KEY_UP), /* (sw2/up) */
345 KEY(1, 1, KEY_LEFTCTRL), /* SW5 */ 345 KEY(1, 1, KEY_LEFTCTRL), /* SW5 */
346 KEY(1, 2, KEY_LEFT), /* (sw2/left) */ 346 KEY(2, 1, KEY_LEFT), /* (sw2/left) */
347 KEY(2, 0, KEY_SPACE), /* SW3 */ 347 KEY(0, 2, KEY_SPACE), /* SW3 */
348 KEY(2, 1, KEY_ESC), /* SW6 */ 348 KEY(1, 2, KEY_ESC), /* SW6 */
349 KEY(2, 2, KEY_DOWN), /* (sw2/down) */ 349 KEY(2, 2, KEY_DOWN), /* (sw2/down) */
350 KEY(3, 2, KEY_ENTER), /* (sw2/select) */ 350 KEY(2, 3, KEY_ENTER), /* (sw2/select) */
351 KEY(3, 3, KEY_RIGHT), /* (sw2/right) */ 351 KEY(3, 3, KEY_RIGHT), /* (sw2/right) */
352 0 352};
353
354static const struct matrix_keymap_data osk_keymap_data = {
355 .keymap = osk_keymap,
356 .keymap_size = ARRAY_SIZE(osk_keymap),
353}; 357};
354 358
355static struct omap_kp_platform_data osk_kp_data = { 359static struct omap_kp_platform_data osk_kp_data = {
356 .rows = 8, 360 .rows = 8,
357 .cols = 8, 361 .cols = 8,
358 .keymap = (int *) osk_keymap, 362 .keymap_data = &osk_keymap_data,
359 .keymapsize = ARRAY_SIZE(osk_keymap),
360 .delay = 9, 363 .delay = 9,
361}; 364};
362 365
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 994dc6f50729..fb51ce6123d8 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -65,25 +65,29 @@ static void __init omap_palmte_init_irq(void)
65 omap_init_irq(); 65 omap_init_irq();
66} 66}
67 67
68static const int palmte_keymap[] = { 68static const unsigned int palmte_keymap[] = {
69 KEY(0, 0, KEY_F1), /* Calendar */ 69 KEY(0, 0, KEY_F1), /* Calendar */
70 KEY(0, 1, KEY_F2), /* Contacts */ 70 KEY(1, 0, KEY_F2), /* Contacts */
71 KEY(0, 2, KEY_F3), /* Tasks List */ 71 KEY(2, 0, KEY_F3), /* Tasks List */
72 KEY(0, 3, KEY_F4), /* Note Pad */ 72 KEY(3, 0, KEY_F4), /* Note Pad */
73 KEY(0, 4, KEY_POWER), 73 KEY(4, 0, KEY_POWER),
74 KEY(1, 0, KEY_LEFT), 74 KEY(0, 1, KEY_LEFT),
75 KEY(1, 1, KEY_DOWN), 75 KEY(1, 1, KEY_DOWN),
76 KEY(1, 2, KEY_UP), 76 KEY(2, 1, KEY_UP),
77 KEY(1, 3, KEY_RIGHT), 77 KEY(3, 1, KEY_RIGHT),
78 KEY(1, 4, KEY_ENTER), 78 KEY(4, 1, KEY_ENTER),
79 0, 79};
80
81static const struct matrix_keymap_data palmte_keymap_data = {
82 .keymap = palmte_keymap,
83 .keymap_size = ARRAY_SIZE(palmte_keymap),
80}; 84};
81 85
82static struct omap_kp_platform_data palmte_kp_data = { 86static struct omap_kp_platform_data palmte_kp_data = {
83 .rows = 8, 87 .rows = 8,
84 .cols = 8, 88 .cols = 8,
85 .keymap = (int *) palmte_keymap, 89 .keymap_data = &palmte_keymap_data,
86 .rep = 1, 90 .rep = true,
87 .delay = 12, 91 .delay = 12,
88}; 92};
89 93
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index ed1400a67f75..f04f2d36e7d3 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -51,19 +51,18 @@
51#define PALMTT_MMC_WP_GPIO 8 51#define PALMTT_MMC_WP_GPIO 8
52#define PALMTT_HDQ_GPIO 11 52#define PALMTT_HDQ_GPIO 11
53 53
54static int palmtt_keymap[] = { 54static const unsigned int palmtt_keymap[] = {
55 KEY(0, 0, KEY_ESC), 55 KEY(0, 0, KEY_ESC),
56 KEY(0, 1, KEY_SPACE), 56 KEY(1, 0, KEY_SPACE),
57 KEY(0, 2, KEY_LEFTCTRL), 57 KEY(2, 0, KEY_LEFTCTRL),
58 KEY(0, 3, KEY_TAB), 58 KEY(3, 0, KEY_TAB),
59 KEY(0, 4, KEY_ENTER), 59 KEY(4, 0, KEY_ENTER),
60 KEY(1, 0, KEY_LEFT), 60 KEY(0, 1, KEY_LEFT),
61 KEY(1, 1, KEY_DOWN), 61 KEY(1, 1, KEY_DOWN),
62 KEY(1, 2, KEY_UP), 62 KEY(2, 1, KEY_UP),
63 KEY(1, 3, KEY_RIGHT), 63 KEY(3, 1, KEY_RIGHT),
64 KEY(2, 0, KEY_SLEEP), 64 KEY(0, 2, KEY_SLEEP),
65 KEY(2, 4, KEY_Y), 65 KEY(4, 2, KEY_Y),
66 0
67}; 66};
68 67
69static struct mtd_partition palmtt_partitions[] = { 68static struct mtd_partition palmtt_partitions[] = {
@@ -136,10 +135,15 @@ static struct resource palmtt_kp_resources[] = {
136 }, 135 },
137}; 136};
138 137
138static const struct matrix_keymap_data palmtt_keymap_data = {
139 .keymap = palmtt_keymap,
140 .keymap_size = ARRAY_SIZE(palmtt_keymap),
141};
142
139static struct omap_kp_platform_data palmtt_kp_data = { 143static struct omap_kp_platform_data palmtt_kp_data = {
140 .rows = 6, 144 .rows = 6,
141 .cols = 3, 145 .cols = 3,
142 .keymap = palmtt_keymap, 146 .keymap_data = &palmtt_keymap_data,
143}; 147};
144 148
145static struct platform_device palmtt_kp_device = { 149static struct platform_device palmtt_kp_device = {
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 2afac598baee..d7bbbe721a75 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -64,26 +64,30 @@ omap_palmz71_init_irq(void)
64 omap_init_irq(); 64 omap_init_irq();
65} 65}
66 66
67static int palmz71_keymap[] = { 67static const unsigned int palmz71_keymap[] = {
68 KEY(0, 0, KEY_F1), 68 KEY(0, 0, KEY_F1),
69 KEY(0, 1, KEY_F2), 69 KEY(1, 0, KEY_F2),
70 KEY(0, 2, KEY_F3), 70 KEY(2, 0, KEY_F3),
71 KEY(0, 3, KEY_F4), 71 KEY(3, 0, KEY_F4),
72 KEY(0, 4, KEY_POWER), 72 KEY(4, 0, KEY_POWER),
73 KEY(1, 0, KEY_LEFT), 73 KEY(0, 1, KEY_LEFT),
74 KEY(1, 1, KEY_DOWN), 74 KEY(1, 1, KEY_DOWN),
75 KEY(1, 2, KEY_UP), 75 KEY(2, 1, KEY_UP),
76 KEY(1, 3, KEY_RIGHT), 76 KEY(3, 1, KEY_RIGHT),
77 KEY(1, 4, KEY_ENTER), 77 KEY(4, 1, KEY_ENTER),
78 KEY(2, 0, KEY_CAMERA), 78 KEY(0, 2, KEY_CAMERA),
79 0, 79};
80
81static const struct matrix_keymap_data palmz71_keymap_data = {
82 .keymap = palmz71_keymap,
83 .keymap_size = ARRAY_SIZE(palmz71_keymap),
80}; 84};
81 85
82static struct omap_kp_platform_data palmz71_kp_data = { 86static struct omap_kp_platform_data palmz71_kp_data = {
83 .rows = 8, 87 .rows = 8,
84 .cols = 8, 88 .cols = 8,
85 .keymap = palmz71_keymap, 89 .keymap_data = &palmz71_keymap_data,
86 .rep = 1, 90 .rep = true,
87 .delay = 80, 91 .delay = 80,
88}; 92};
89 93
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 69fda218fb45..3c8ee8489458 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -36,36 +36,35 @@
36#include <plat/common.h> 36#include <plat/common.h>
37#include <plat/board.h> 37#include <plat/board.h>
38 38
39static int p2_keymap[] = { 39static const unsigned int p2_keymap[] = {
40 KEY(0,0,KEY_UP), 40 KEY(0, 0, KEY_UP),
41 KEY(0,1,KEY_RIGHT), 41 KEY(1, 0, KEY_RIGHT),
42 KEY(0,2,KEY_LEFT), 42 KEY(2, 0, KEY_LEFT),
43 KEY(0,3,KEY_DOWN), 43 KEY(3, 0, KEY_DOWN),
44 KEY(0,4,KEY_ENTER), 44 KEY(4, 0, KEY_ENTER),
45 KEY(1,0,KEY_F10), 45 KEY(0, 1, KEY_F10),
46 KEY(1,1,KEY_SEND), 46 KEY(1, 1, KEY_SEND),
47 KEY(1,2,KEY_END), 47 KEY(2, 1, KEY_END),
48 KEY(1,3,KEY_VOLUMEDOWN), 48 KEY(3, 1, KEY_VOLUMEDOWN),
49 KEY(1,4,KEY_VOLUMEUP), 49 KEY(4, 1, KEY_VOLUMEUP),
50 KEY(1,5,KEY_RECORD), 50 KEY(5, 1, KEY_RECORD),
51 KEY(2,0,KEY_F9), 51 KEY(0, 2, KEY_F9),
52 KEY(2,1,KEY_3), 52 KEY(1, 2, KEY_3),
53 KEY(2,2,KEY_6), 53 KEY(2, 2, KEY_6),
54 KEY(2,3,KEY_9), 54 KEY(3, 2, KEY_9),
55 KEY(2,4,KEY_KPDOT), 55 KEY(4, 2, KEY_KPDOT),
56 KEY(3,0,KEY_BACK), 56 KEY(0, 3, KEY_BACK),
57 KEY(3,1,KEY_2), 57 KEY(1, 3, KEY_2),
58 KEY(3,2,KEY_5), 58 KEY(2, 3, KEY_5),
59 KEY(3,3,KEY_8), 59 KEY(3, 3, KEY_8),
60 KEY(3,4,KEY_0), 60 KEY(4, 3, KEY_0),
61 KEY(3,5,KEY_KPSLASH), 61 KEY(5, 3, KEY_KPSLASH),
62 KEY(4,0,KEY_HOME), 62 KEY(0, 4, KEY_HOME),
63 KEY(4,1,KEY_1), 63 KEY(1, 4, KEY_1),
64 KEY(4,2,KEY_4), 64 KEY(2, 4, KEY_4),
65 KEY(4,3,KEY_7), 65 KEY(3, 4, KEY_7),
66 KEY(4,4,KEY_KPASTERISK), 66 KEY(4, 4, KEY_KPASTERISK),
67 KEY(4,5,KEY_POWER), 67 KEY(5, 4, KEY_POWER),
68 0
69}; 68};
70 69
71static struct smc91x_platdata smc91x_info = { 70static struct smc91x_platdata smc91x_info = {
@@ -211,13 +210,17 @@ static struct resource kp_resources[] = {
211 }, 210 },
212}; 211};
213 212
213static const struct matrix_keymap_data p2_keymap_data = {
214 .keymap = p2_keymap,
215 .keymap_size = ARRAY_SIZE(p2_keymap),
216};
217
214static struct omap_kp_platform_data kp_data = { 218static struct omap_kp_platform_data kp_data = {
215 .rows = 8, 219 .rows = 8,
216 .cols = 8, 220 .cols = 8,
217 .keymap = p2_keymap, 221 .keymap_data = &p2_keymap_data,
218 .keymapsize = ARRAY_SIZE(p2_keymap),
219 .delay = 4, 222 .delay = 4,
220 .dbounce = 1, 223 .dbounce = true,
221}; 224};
222 225
223static struct platform_device kp_device = { 226static struct platform_device kp_device = {
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 463862c67819..d41fe2d0616a 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -164,36 +164,35 @@ EXPORT_SYMBOL(sx1_setusbpower);
164 164
165/*----------- Keypad -------------------------*/ 165/*----------- Keypad -------------------------*/
166 166
167static int sx1_keymap[] = { 167static const unsigned int sx1_keymap[] = {
168 KEY(5, 3, GROUP_0 | 117), /* camera Qt::Key_F17 */ 168 KEY(3, 5, GROUP_0 | 117), /* camera Qt::Key_F17 */
169 KEY(0, 4, GROUP_0 | 114), /* voice memo Qt::Key_F14 */ 169 KEY(4, 0, GROUP_0 | 114), /* voice memo Qt::Key_F14 */
170 KEY(1, 4, GROUP_2 | 114), /* voice memo */ 170 KEY(4, 1, GROUP_2 | 114), /* voice memo */
171 KEY(2, 4, GROUP_3 | 114), /* voice memo */ 171 KEY(4, 2, GROUP_3 | 114), /* voice memo */
172 KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */ 172 KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */
173 KEY(4, 3, GROUP_1 | KEY_LEFT), 173 KEY(3, 4, GROUP_1 | KEY_LEFT),
174 KEY(2, 3, GROUP_1 | KEY_DOWN), 174 KEY(3, 2, GROUP_1 | KEY_DOWN),
175 KEY(1, 3, GROUP_1 | KEY_RIGHT), 175 KEY(3, 1, GROUP_1 | KEY_RIGHT),
176 KEY(0, 3, GROUP_1 | KEY_UP), 176 KEY(3, 0, GROUP_1 | KEY_UP),
177 KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */ 177 KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */
178 KEY(5, 0, GROUP_1 | KEY_1), 178 KEY(0, 5, GROUP_1 | KEY_1),
179 KEY(4, 0, GROUP_1 | KEY_2), 179 KEY(0, 4, GROUP_1 | KEY_2),
180 KEY(3, 0, GROUP_1 | KEY_3), 180 KEY(0, 3, GROUP_1 | KEY_3),
181 KEY(3, 4, GROUP_1 | KEY_4), 181 KEY(4, 3, GROUP_1 | KEY_4),
182 KEY(4, 4, GROUP_1 | KEY_5), 182 KEY(4, 4, GROUP_1 | KEY_5),
183 KEY(5, 4, GROUP_1 | KEY_KPASTERISK),/* "*" */ 183 KEY(4, 5, GROUP_1 | KEY_KPASTERISK),/* "*" */
184 KEY(4, 1, GROUP_1 | KEY_6), 184 KEY(1, 4, GROUP_1 | KEY_6),
185 KEY(5, 1, GROUP_1 | KEY_7), 185 KEY(1, 5, GROUP_1 | KEY_7),
186 KEY(3, 1, GROUP_1 | KEY_8), 186 KEY(1, 3, GROUP_1 | KEY_8),
187 KEY(3, 2, GROUP_1 | KEY_9), 187 KEY(2, 3, GROUP_1 | KEY_9),
188 KEY(5, 2, GROUP_1 | KEY_0), 188 KEY(2, 5, GROUP_1 | KEY_0),
189 KEY(4, 2, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */ 189 KEY(2, 4, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */
190 KEY(0, 1, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */ 190 KEY(1, 0, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */
191 KEY(1, 2, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */ 191 KEY(2, 1, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */
192 KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */ 192 KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */
193 KEY(2, 1, GROUP_1 | KEY_LEFTSHIFT), /* shift */ 193 KEY(1, 2, GROUP_1 | KEY_LEFTSHIFT), /* shift */
194 KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */ 194 KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */
195 KEY(0, 2, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */ 195 KEY(2, 0, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */
196 0
197}; 196};
198 197
199static struct resource sx1_kp_resources[] = { 198static struct resource sx1_kp_resources[] = {
@@ -204,11 +203,15 @@ static struct resource sx1_kp_resources[] = {
204 }, 203 },
205}; 204};
206 205
206static const struct matrix_keymap_data sx1_keymap_data = {
207 .keymap = sx1_keymap,
208 .keymap_size = ARRAY_SIZE(sx1_keymap),
209};
210
207static struct omap_kp_platform_data sx1_kp_data = { 211static struct omap_kp_platform_data sx1_kp_data = {
208 .rows = 6, 212 .rows = 6,
209 .cols = 6, 213 .cols = 6,
210 .keymap = sx1_keymap, 214 .keymap_data = &sx1_keymap_data,
211 .keymapsize = ARRAY_SIZE(sx1_keymap),
212 .delay = 80, 215 .delay = 80,
213}; 216};
214 217
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
new file mode 100644
index 000000000000..d8559344c6e2
--- /dev/null
+++ b/arch/arm/mach-omap1/dma.c
@@ -0,0 +1,390 @@
1/*
2 * OMAP1/OMAP7xx - specific DMA driver
3 *
4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
10 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
11 *
12 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
13 * Converted DMA library into platform driver
14 * - G, Manjunath Kondaiah <manjugk@ti.com>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20
21#include <linux/err.h>
22#include <linux/io.h>
23#include <linux/slab.h>
24#include <linux/module.h>
25#include <linux/init.h>
26#include <linux/device.h>
27
28#include <plat/dma.h>
29#include <plat/tc.h>
30#include <plat/irqs.h>
31
32#define OMAP1_DMA_BASE (0xfffed800)
33#define OMAP1_LOGICAL_DMA_CH_COUNT 17
34#define OMAP1_DMA_STRIDE 0x40
35
36static u32 errata;
37static u32 enable_1510_mode;
38static u8 dma_stride;
39static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end;
40
41static u16 reg_map[] = {
42 [GCR] = 0x400,
43 [GSCR] = 0x404,
44 [GRST1] = 0x408,
45 [HW_ID] = 0x442,
46 [PCH2_ID] = 0x444,
47 [PCH0_ID] = 0x446,
48 [PCH1_ID] = 0x448,
49 [PCHG_ID] = 0x44a,
50 [PCHD_ID] = 0x44c,
51 [CAPS_0] = 0x44e,
52 [CAPS_1] = 0x452,
53 [CAPS_2] = 0x456,
54 [CAPS_3] = 0x458,
55 [CAPS_4] = 0x45a,
56 [PCH2_SR] = 0x460,
57 [PCH0_SR] = 0x480,
58 [PCH1_SR] = 0x482,
59 [PCHD_SR] = 0x4c0,
60
61 /* Common Registers */
62 [CSDP] = 0x00,
63 [CCR] = 0x02,
64 [CICR] = 0x04,
65 [CSR] = 0x06,
66 [CEN] = 0x10,
67 [CFN] = 0x12,
68 [CSFI] = 0x14,
69 [CSEI] = 0x16,
70 [CPC] = 0x18, /* 15xx only */
71 [CSAC] = 0x18,
72 [CDAC] = 0x1a,
73 [CDEI] = 0x1c,
74 [CDFI] = 0x1e,
75 [CLNK_CTRL] = 0x28,
76
77 /* Channel specific register offsets */
78 [CSSA] = 0x08,
79 [CDSA] = 0x0c,
80 [COLOR] = 0x20,
81 [CCR2] = 0x24,
82 [LCH_CTRL] = 0x2a,
83};
84
85static struct resource res[] __initdata = {
86 [0] = {
87 .start = OMAP1_DMA_BASE,
88 .end = OMAP1_DMA_BASE + SZ_2K - 1,
89 .flags = IORESOURCE_MEM,
90 },
91 [1] = {
92 .name = "0",
93 .start = INT_DMA_CH0_6,
94 .flags = IORESOURCE_IRQ,
95 },
96 [2] = {
97 .name = "1",
98 .start = INT_DMA_CH1_7,
99 .flags = IORESOURCE_IRQ,
100 },
101 [3] = {
102 .name = "2",
103 .start = INT_DMA_CH2_8,
104 .flags = IORESOURCE_IRQ,
105 },
106 [4] = {
107 .name = "3",
108 .start = INT_DMA_CH3,
109 .flags = IORESOURCE_IRQ,
110 },
111 [5] = {
112 .name = "4",
113 .start = INT_DMA_CH4,
114 .flags = IORESOURCE_IRQ,
115 },
116 [6] = {
117 .name = "5",
118 .start = INT_DMA_CH5,
119 .flags = IORESOURCE_IRQ,
120 },
121 /* Handled in lcd_dma.c */
122 [7] = {
123 .name = "6",
124 .start = INT_1610_DMA_CH6,
125 .flags = IORESOURCE_IRQ,
126 },
127 /* irq's for omap16xx and omap7xx */
128 [8] = {
129 .name = "7",
130 .start = INT_1610_DMA_CH7,
131 .flags = IORESOURCE_IRQ,
132 },
133 [9] = {
134 .name = "8",
135 .start = INT_1610_DMA_CH8,
136 .flags = IORESOURCE_IRQ,
137 },
138 [10] = {
139 .name = "9",
140 .start = INT_1610_DMA_CH9,
141 .flags = IORESOURCE_IRQ,
142 },
143 [11] = {
144 .name = "10",
145 .start = INT_1610_DMA_CH10,
146 .flags = IORESOURCE_IRQ,
147 },
148 [12] = {
149 .name = "11",
150 .start = INT_1610_DMA_CH11,
151 .flags = IORESOURCE_IRQ,
152 },
153 [13] = {
154 .name = "12",
155 .start = INT_1610_DMA_CH12,
156 .flags = IORESOURCE_IRQ,
157 },
158 [14] = {
159 .name = "13",
160 .start = INT_1610_DMA_CH13,
161 .flags = IORESOURCE_IRQ,
162 },
163 [15] = {
164 .name = "14",
165 .start = INT_1610_DMA_CH14,
166 .flags = IORESOURCE_IRQ,
167 },
168 [16] = {
169 .name = "15",
170 .start = INT_1610_DMA_CH15,
171 .flags = IORESOURCE_IRQ,
172 },
173 [17] = {
174 .name = "16",
175 .start = INT_DMA_LCD,
176 .flags = IORESOURCE_IRQ,
177 },
178};
179
180static void __iomem *dma_base;
181static inline void dma_write(u32 val, int reg, int lch)
182{
183 u8 stride;
184 u32 offset;
185
186 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
187 offset = reg_map[reg] + (stride * lch);
188
189 __raw_writew(val, dma_base + offset);
190 if ((reg > CLNK_CTRL && reg < CCEN) ||
191 (reg > PCHD_ID && reg < CAPS_2)) {
192 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
193 __raw_writew(val >> 16, dma_base + offset2);
194 }
195}
196
197static inline u32 dma_read(int reg, int lch)
198{
199 u8 stride;
200 u32 offset, val;
201
202 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
203 offset = reg_map[reg] + (stride * lch);
204
205 val = __raw_readw(dma_base + offset);
206 if ((reg > CLNK_CTRL && reg < CCEN) ||
207 (reg > PCHD_ID && reg < CAPS_2)) {
208 u16 upper;
209 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
210 upper = __raw_readw(dma_base + offset2);
211 val |= (upper << 16);
212 }
213 return val;
214}
215
216static void omap1_clear_lch_regs(int lch)
217{
218 int i = dma_common_ch_start;
219
220 for (; i <= dma_common_ch_end; i += 1)
221 dma_write(0, i, lch);
222}
223
224static void omap1_clear_dma(int lch)
225{
226 u32 l;
227
228 l = dma_read(CCR, lch);
229 l &= ~OMAP_DMA_CCR_EN;
230 dma_write(l, CCR, lch);
231
232 /* Clear pending interrupts */
233 l = dma_read(CSR, lch);
234}
235
236static void omap1_show_dma_caps(void)
237{
238 if (enable_1510_mode) {
239 printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
240 } else {
241 u16 w;
242 printk(KERN_INFO "OMAP DMA hardware version %d\n",
243 dma_read(HW_ID, 0));
244 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
245 dma_read(CAPS_0, 0), dma_read(CAPS_1, 0),
246 dma_read(CAPS_2, 0), dma_read(CAPS_3, 0),
247 dma_read(CAPS_4, 0));
248
249 /* Disable OMAP 3.0/3.1 compatibility mode. */
250 w = dma_read(GSCR, 0);
251 w |= 1 << 3;
252 dma_write(w, GSCR, 0);
253 }
254 return;
255}
256
257static u32 configure_dma_errata(void)
258{
259
260 /*
261 * Erratum 3.2/3.3: sometimes 0 is returned if CSAC/CDAC is
262 * read before the DMA controller finished disabling the channel.
263 */
264 if (!cpu_is_omap15xx())
265 SET_DMA_ERRATA(DMA_ERRATA_3_3);
266
267 return errata;
268}
269
270static int __init omap1_system_dma_init(void)
271{
272 struct omap_system_dma_plat_info *p;
273 struct omap_dma_dev_attr *d;
274 struct platform_device *pdev;
275 int ret;
276
277 pdev = platform_device_alloc("omap_dma_system", 0);
278 if (!pdev) {
279 pr_err("%s: Unable to device alloc for dma\n",
280 __func__);
281 return -ENOMEM;
282 }
283
284 dma_base = ioremap(res[0].start, resource_size(&res[0]));
285 if (!dma_base) {
286 pr_err("%s: Unable to ioremap\n", __func__);
287 return -ENODEV;
288 }
289
290 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
291 if (ret) {
292 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
293 __func__, pdev->name, pdev->id);
294 goto exit_device_del;
295 }
296
297 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
298 if (!p) {
299 dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
300 __func__, pdev->name);
301 ret = -ENOMEM;
302 goto exit_device_put;
303 }
304
305 d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
306 if (!d) {
307 dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n",
308 __func__, pdev->name);
309 ret = -ENOMEM;
310 goto exit_release_p;
311 }
312
313 d->lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
314
315 /* Valid attributes for omap1 plus processors */
316 if (cpu_is_omap15xx())
317 d->dev_caps = ENABLE_1510_MODE;
318 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
319
320 d->dev_caps |= SRC_PORT;
321 d->dev_caps |= DST_PORT;
322 d->dev_caps |= SRC_INDEX;
323 d->dev_caps |= DST_INDEX;
324 d->dev_caps |= IS_BURST_ONLY4;
325 d->dev_caps |= CLEAR_CSR_ON_READ;
326 d->dev_caps |= IS_WORD_16;
327
328
329 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
330 (d->lch_count), GFP_KERNEL);
331 if (!d->chan) {
332 dev_err(&pdev->dev, "%s: Memory allocation failed"
333 "for d->chan!!!\n", __func__);
334 goto exit_release_d;
335 }
336
337 if (cpu_is_omap15xx())
338 d->chan_count = 9;
339 else if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
340 if (!(d->dev_caps & ENABLE_1510_MODE))
341 d->chan_count = 16;
342 else
343 d->chan_count = 9;
344 }
345
346 p->dma_attr = d;
347
348 p->show_dma_caps = omap1_show_dma_caps;
349 p->clear_lch_regs = omap1_clear_lch_regs;
350 p->clear_dma = omap1_clear_dma;
351 p->dma_write = dma_write;
352 p->dma_read = dma_read;
353 p->disable_irq_lch = NULL;
354
355 p->errata = configure_dma_errata();
356
357 ret = platform_device_add_data(pdev, p, sizeof(*p));
358 if (ret) {
359 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
360 __func__, pdev->name, pdev->id);
361 goto exit_release_chan;
362 }
363
364 ret = platform_device_add(pdev);
365 if (ret) {
366 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
367 __func__, pdev->name, pdev->id);
368 goto exit_release_chan;
369 }
370
371 dma_stride = OMAP1_DMA_STRIDE;
372 dma_common_ch_start = CPC;
373 dma_common_ch_end = COLOR;
374
375 return ret;
376
377exit_release_chan:
378 kfree(d->chan);
379exit_release_d:
380 kfree(d);
381exit_release_p:
382 kfree(p);
383exit_device_put:
384 platform_device_put(pdev);
385exit_device_del:
386 platform_device_del(pdev);
387
388 return ret;
389}
390arch_initcall(omap1_system_dma_init);