diff options
author | Chao Xie <chao.xie@marvell.com> | 2013-05-05 23:24:58 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-06-19 01:56:51 -0400 |
commit | 0a085a9482fa51efb58c9d351ea98e83c5df93fc (patch) | |
tree | 411592ae841ea8b18dce07a7e4bce3fce30fcadc /arch/arm/mach-pxa/palmtreo.c | |
parent | 483180281f0ac60d1138710eb21f4b9961901294 (diff) |
Input: pxa27x-keypad - use matrix_keymap for matrix keys
pxa27x-keypad includes matrix keys. Make use of matrix_keymap
for the matrix keys.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/palmtreo.c')
-rw-r--r-- | arch/arm/mach-pxa/palmtreo.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index d82a50b4a803..d8b937c870de 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -168,7 +168,7 @@ static unsigned long centro685_pin_config[] __initdata = { | |||
168 | * GPIO keyboard | 168 | * GPIO keyboard |
169 | ******************************************************************************/ | 169 | ******************************************************************************/ |
170 | #if IS_ENABLED(CONFIG_KEYBOARD_PXA27x) | 170 | #if IS_ENABLED(CONFIG_KEYBOARD_PXA27x) |
171 | static unsigned int treo680_matrix_keys[] = { | 171 | static const unsigned int treo680_matrix_keys[] = { |
172 | KEY(0, 0, KEY_F8), /* Red/Off/Power */ | 172 | KEY(0, 0, KEY_F8), /* Red/Off/Power */ |
173 | KEY(0, 1, KEY_LEFT), | 173 | KEY(0, 1, KEY_LEFT), |
174 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ | 174 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ |
@@ -227,7 +227,7 @@ static unsigned int treo680_matrix_keys[] = { | |||
227 | KEY(7, 5, KEY_I), | 227 | KEY(7, 5, KEY_I), |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static unsigned int centro_matrix_keys[] = { | 230 | static const unsigned int centro_matrix_keys[] = { |
231 | KEY(0, 0, KEY_F9), /* Home */ | 231 | KEY(0, 0, KEY_F9), /* Home */ |
232 | KEY(0, 1, KEY_LEFT), | 232 | KEY(0, 1, KEY_LEFT), |
233 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ | 233 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ |
@@ -286,11 +286,20 @@ static unsigned int centro_matrix_keys[] = { | |||
286 | KEY(7, 5, KEY_I), | 286 | KEY(7, 5, KEY_I), |
287 | }; | 287 | }; |
288 | 288 | ||
289 | static struct matrix_keymap_data treo680_matrix_keymap_data = { | ||
290 | .keymap = treo680_matrix_keys, | ||
291 | .keymap_size = ARRAY_SIZE(treo680_matrix_keys), | ||
292 | }; | ||
293 | |||
294 | static struct matrix_keymap_data centro_matrix_keymap_data = { | ||
295 | .keymap = centro_matrix_keys, | ||
296 | .keymap_size = ARRAY_SIZE(centro_matrix_keys), | ||
297 | }; | ||
298 | |||
289 | static struct pxa27x_keypad_platform_data treo680_keypad_pdata = { | 299 | static struct pxa27x_keypad_platform_data treo680_keypad_pdata = { |
290 | .matrix_key_rows = 8, | 300 | .matrix_key_rows = 8, |
291 | .matrix_key_cols = 7, | 301 | .matrix_key_cols = 7, |
292 | .matrix_key_map = treo680_matrix_keys, | 302 | .matrix_keymap_data = &treo680_matrix_keymap_data, |
293 | .matrix_key_map_size = ARRAY_SIZE(treo680_matrix_keys), | ||
294 | .direct_key_map = { KEY_CONNECT }, | 303 | .direct_key_map = { KEY_CONNECT }, |
295 | .direct_key_num = 1, | 304 | .direct_key_num = 1, |
296 | 305 | ||
@@ -301,10 +310,8 @@ static void __init palmtreo_kpc_init(void) | |||
301 | { | 310 | { |
302 | static struct pxa27x_keypad_platform_data *data = &treo680_keypad_pdata; | 311 | static struct pxa27x_keypad_platform_data *data = &treo680_keypad_pdata; |
303 | 312 | ||
304 | if (machine_is_centro()) { | 313 | if (machine_is_centro()) |
305 | data->matrix_key_map = centro_matrix_keys; | 314 | data->matrix_keymap_data = ¢ro_matrix_keymap_data; |
306 | data->matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys); | ||
307 | } | ||
308 | 315 | ||
309 | pxa_set_keypad_info(&treo680_keypad_pdata); | 316 | pxa_set_keypad_info(&treo680_keypad_pdata); |
310 | } | 317 | } |