diff options
author | Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> | 2010-12-20 16:09:22 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-12-22 14:11:47 -0500 |
commit | da1f026b532ce944d74461497dc6d8c16456466e (patch) | |
tree | 227cd89307e0094d02e944a29225b19c2fca286b /arch/arm/mach-omap1/board-perseus2.c | |
parent | 4e012e5f246d4da924b14d453452fd0838d4e03b (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-omap1/board-perseus2.c')
-rw-r--r-- | arch/arm/mach-omap1/board-perseus2.c | 69 |
1 files changed, 36 insertions, 33 deletions
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 | ||
39 | static int p2_keymap[] = { | 39 | static 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 | ||
71 | static struct smc91x_platdata smc91x_info = { | 70 | static struct smc91x_platdata smc91x_info = { |
@@ -211,13 +210,17 @@ static struct resource kp_resources[] = { | |||
211 | }, | 210 | }, |
212 | }; | 211 | }; |
213 | 212 | ||
213 | static const struct matrix_keymap_data p2_keymap_data = { | ||
214 | .keymap = p2_keymap, | ||
215 | .keymap_size = ARRAY_SIZE(p2_keymap), | ||
216 | }; | ||
217 | |||
214 | static struct omap_kp_platform_data kp_data = { | 218 | static 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 | ||
223 | static struct platform_device kp_device = { | 226 | static struct platform_device kp_device = { |