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-htcherald.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-htcherald.c')
-rw-r--r-- | arch/arm/mach-omap1/board-htcherald.c | 98 |
1 files changed, 51 insertions, 47 deletions
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 | ||
183 | static int htc_herald_keymap[] = { | 183 | static 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 | ||
235 | struct omap_kp_platform_data htcherald_kp_data = { | 234 | static const struct matrix_keymap_data htc_herald_keymap_data = { |
235 | .keymap = htc_herald_keymap, | ||
236 | .keymap_size = ARRAY_SIZE(htc_herald_keymap), | ||
237 | }; | ||
238 | |||
239 | static 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 | ||
243 | static struct resource kp_resources[] = { | 247 | static struct resource kp_resources[] = { |
@@ -278,7 +282,7 @@ static struct gpio_keys_button herald_gpio_keys_table[] = { | |||
278 | static struct gpio_keys_platform_data herald_gpio_keys_data = { | 282 | static 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 | ||
284 | static struct platform_device herald_gpiokeys_device = { | 288 | static struct platform_device herald_gpiokeys_device = { |