aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-h4.c
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2010-12-20 16:09:22 -0500
committerTony Lindgren <tony@atomide.com>2010-12-22 14:11:47 -0500
commitda1f026b532ce944d74461497dc6d8c16456466e (patch)
tree227cd89307e0094d02e944a29225b19c2fca286b /arch/arm/mach-omap2/board-h4.c
parent4e012e5f246d4da924b14d453452fd0838d4e03b (diff)
Keyboard: omap-keypad: use matrix_keypad.h
Most keypad drivers make use of the <linux/input/matrix_keypad.h> defined macros, structures and inline functions. Convert omap-keypad driver to use those as well, as suggested by a compile time warning, hardcoded into the OMAP <palt/keypad.h>. Created against linux-2.6.37-rc5. Tested on Amstrad Delta. Compile tested with omap1_defconfig and omap2plus_defconfig shrinked to board-h4. Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-h4.c')
-rw-r--r--arch/arm/mach-omap2/board-h4.c63
1 files changed, 33 insertions, 30 deletions
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 0a2d73cf036f..b386a403c379 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -51,38 +51,37 @@
51static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; 51static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
52static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; 52static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
53 53
54static int h4_keymap[] = { 54static const unsigned int h4_keymap[] = {
55 KEY(0, 0, KEY_LEFT), 55 KEY(0, 0, KEY_LEFT),
56 KEY(0, 1, KEY_RIGHT), 56 KEY(1, 0, KEY_RIGHT),
57 KEY(0, 2, KEY_A), 57 KEY(2, 0, KEY_A),
58 KEY(0, 3, KEY_B), 58 KEY(3, 0, KEY_B),
59 KEY(0, 4, KEY_C), 59 KEY(4, 0, KEY_C),
60 KEY(1, 0, KEY_DOWN), 60 KEY(0, 1, KEY_DOWN),
61 KEY(1, 1, KEY_UP), 61 KEY(1, 1, KEY_UP),
62 KEY(1, 2, KEY_E), 62 KEY(2, 1, KEY_E),
63 KEY(1, 3, KEY_F), 63 KEY(3, 1, KEY_F),
64 KEY(1, 4, KEY_G), 64 KEY(4, 1, KEY_G),
65 KEY(2, 0, KEY_ENTER), 65 KEY(0, 2, KEY_ENTER),
66 KEY(2, 1, KEY_I), 66 KEY(1, 2, KEY_I),
67 KEY(2, 2, KEY_J), 67 KEY(2, 2, KEY_J),
68 KEY(2, 3, KEY_K), 68 KEY(3, 2, KEY_K),
69 KEY(2, 4, KEY_3), 69 KEY(4, 2, KEY_3),
70 KEY(3, 0, KEY_M), 70 KEY(0, 3, KEY_M),
71 KEY(3, 1, KEY_N), 71 KEY(1, 3, KEY_N),
72 KEY(3, 2, KEY_O), 72 KEY(2, 3, KEY_O),
73 KEY(3, 3, KEY_P), 73 KEY(3, 3, KEY_P),
74 KEY(3, 4, KEY_Q), 74 KEY(4, 3, KEY_Q),
75 KEY(4, 0, KEY_R), 75 KEY(0, 4, KEY_R),
76 KEY(4, 1, KEY_4), 76 KEY(1, 4, KEY_4),
77 KEY(4, 2, KEY_T), 77 KEY(2, 4, KEY_T),
78 KEY(4, 3, KEY_U), 78 KEY(3, 4, KEY_U),
79 KEY(4, 4, KEY_ENTER), 79 KEY(4, 4, KEY_ENTER),
80 KEY(5, 0, KEY_V), 80 KEY(0, 5, KEY_V),
81 KEY(5, 1, KEY_W), 81 KEY(1, 5, KEY_W),
82 KEY(5, 2, KEY_L), 82 KEY(2, 5, KEY_L),
83 KEY(5, 3, KEY_S), 83 KEY(3, 5, KEY_S),
84 KEY(5, 4, KEY_ENTER), 84 KEY(4, 5, KEY_ENTER),
85 0
86}; 85};
87 86
88static struct mtd_partition h4_partitions[] = { 87static struct mtd_partition h4_partitions[] = {
@@ -136,12 +135,16 @@ static struct platform_device h4_flash_device = {
136 .resource = &h4_flash_resource, 135 .resource = &h4_flash_resource,
137}; 136};
138 137
138static const struct matrix_keymap_data h4_keymap_data = {
139 .keymap = h4_keymap,
140 .keymap_size = ARRAY_SIZE(h4_keymap),
141};
142
139static struct omap_kp_platform_data h4_kp_data = { 143static struct omap_kp_platform_data h4_kp_data = {
140 .rows = 6, 144 .rows = 6,
141 .cols = 7, 145 .cols = 7,
142 .keymap = h4_keymap, 146 .keymap_data = &h4_keymap_data,
143 .keymapsize = ARRAY_SIZE(h4_keymap), 147 .rep = true,
144 .rep = 1,
145 .row_gpios = row_gpios, 148 .row_gpios = row_gpios,
146 .col_gpios = col_gpios, 149 .col_gpios = col_gpios,
147}; 150};