aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-spear
diff options
context:
space:
mode:
authorRajeev Kumar <rajeev-dlh.kumar@st.com>2010-11-19 15:41:19 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-11-19 15:43:25 -0500
commitbc95df78c4566327086d44f1bfab984a70dc4d6b (patch)
treecc69e42f096699db771cd9cfb2b04a2ea2d85c45 /arch/arm/plat-spear
parentc44f242064093e640a068741b05ee6acdd49bc22 (diff)
Input: add support for keyboards on ST SPEAr platform
Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'arch/arm/plat-spear')
-rw-r--r--arch/arm/plat-spear/include/plat/keyboard.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h
new file mode 100644
index 000000000000..68b5394fc583
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/keyboard.h
@@ -0,0 +1,141 @@
1/*
2 * Copyright (C) 2010 ST Microelectronics
3 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10#ifndef __PLAT_KEYBOARD_H
11#define __PLAT_KEYBOARD_H
12
13#include <linux/bitops.h>
14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h>
16#include <linux/types.h>
17
18#define DECLARE_KEYMAP(_name) \
19int _name[] = { \
20 KEY(0, 0, KEY_ESC), \
21 KEY(0, 1, KEY_1), \
22 KEY(0, 2, KEY_2), \
23 KEY(0, 3, KEY_3), \
24 KEY(0, 4, KEY_4), \
25 KEY(0, 5, KEY_5), \
26 KEY(0, 6, KEY_6), \
27 KEY(0, 7, KEY_7), \
28 KEY(0, 8, KEY_8), \
29 KEY(1, 0, KEY_9), \
30 KEY(1, 1, KEY_MINUS), \
31 KEY(1, 2, KEY_EQUAL), \
32 KEY(1, 3, KEY_BACKSPACE), \
33 KEY(1, 4, KEY_TAB), \
34 KEY(1, 5, KEY_Q), \
35 KEY(1, 6, KEY_W), \
36 KEY(1, 7, KEY_E), \
37 KEY(1, 8, KEY_R), \
38 KEY(2, 0, KEY_T), \
39 KEY(2, 1, KEY_Y), \
40 KEY(2, 2, KEY_U), \
41 KEY(2, 3, KEY_I), \
42 KEY(2, 4, KEY_O), \
43 KEY(2, 5, KEY_P), \
44 KEY(2, 6, KEY_LEFTBRACE), \
45 KEY(2, 7, KEY_RIGHTBRACE), \
46 KEY(2, 8, KEY_ENTER), \
47 KEY(3, 0, KEY_LEFTCTRL), \
48 KEY(3, 1, KEY_A), \
49 KEY(3, 2, KEY_S), \
50 KEY(3, 3, KEY_D), \
51 KEY(3, 4, KEY_F), \
52 KEY(3, 5, KEY_G), \
53 KEY(3, 6, KEY_H), \
54 KEY(3, 7, KEY_J), \
55 KEY(3, 8, KEY_K), \
56 KEY(4, 0, KEY_L), \
57 KEY(4, 1, KEY_SEMICOLON), \
58 KEY(4, 2, KEY_APOSTROPHE), \
59 KEY(4, 3, KEY_GRAVE), \
60 KEY(4, 4, KEY_LEFTSHIFT), \
61 KEY(4, 5, KEY_BACKSLASH), \
62 KEY(4, 6, KEY_Z), \
63 KEY(4, 7, KEY_X), \
64 KEY(4, 8, KEY_C), \
65 KEY(4, 0, KEY_L), \
66 KEY(4, 1, KEY_SEMICOLON), \
67 KEY(4, 2, KEY_APOSTROPHE), \
68 KEY(4, 3, KEY_GRAVE), \
69 KEY(4, 4, KEY_LEFTSHIFT), \
70 KEY(4, 5, KEY_BACKSLASH), \
71 KEY(4, 6, KEY_Z), \
72 KEY(4, 7, KEY_X), \
73 KEY(4, 8, KEY_C), \
74 KEY(4, 0, KEY_L), \
75 KEY(4, 1, KEY_SEMICOLON), \
76 KEY(4, 2, KEY_APOSTROPHE), \
77 KEY(4, 3, KEY_GRAVE), \
78 KEY(4, 4, KEY_LEFTSHIFT), \
79 KEY(4, 5, KEY_BACKSLASH), \
80 KEY(4, 6, KEY_Z), \
81 KEY(4, 7, KEY_X), \
82 KEY(4, 8, KEY_C), \
83 KEY(5, 0, KEY_V), \
84 KEY(5, 1, KEY_B), \
85 KEY(5, 2, KEY_N), \
86 KEY(5, 3, KEY_M), \
87 KEY(5, 4, KEY_COMMA), \
88 KEY(5, 5, KEY_DOT), \
89 KEY(5, 6, KEY_SLASH), \
90 KEY(5, 7, KEY_RIGHTSHIFT), \
91 KEY(5, 8, KEY_KPASTERISK), \
92 KEY(6, 0, KEY_LEFTALT), \
93 KEY(6, 1, KEY_SPACE), \
94 KEY(6, 2, KEY_CAPSLOCK), \
95 KEY(6, 3, KEY_F1), \
96 KEY(6, 4, KEY_F2), \
97 KEY(6, 5, KEY_F3), \
98 KEY(6, 6, KEY_F4), \
99 KEY(6, 7, KEY_F5), \
100 KEY(6, 8, KEY_F6), \
101 KEY(7, 0, KEY_F7), \
102 KEY(7, 1, KEY_F8), \
103 KEY(7, 2, KEY_F9), \
104 KEY(7, 3, KEY_F10), \
105 KEY(7, 4, KEY_NUMLOCK), \
106 KEY(7, 5, KEY_SCROLLLOCK), \
107 KEY(7, 6, KEY_KP7), \
108 KEY(7, 7, KEY_KP8), \
109 KEY(7, 8, KEY_KP9), \
110 KEY(8, 0, KEY_KPMINUS), \
111 KEY(8, 1, KEY_KP4), \
112 KEY(8, 2, KEY_KP5), \
113 KEY(8, 3, KEY_KP6), \
114 KEY(8, 4, KEY_KPPLUS), \
115 KEY(8, 5, KEY_KP1), \
116 KEY(8, 6, KEY_KP2), \
117 KEY(8, 7, KEY_KP3), \
118 KEY(8, 8, KEY_KP0), \
119}
120
121/**
122 * struct kbd_platform_data - spear keyboard platform data
123 * keymap: pointer to keymap data (table and size)
124 * rep: enables key autorepeat
125 *
126 * This structure is supposed to be used by platform code to supply
127 * keymaps to drivers that implement keyboards.
128 */
129struct kbd_platform_data {
130 const struct matrix_keymap_data *keymap;
131 bool rep;
132};
133
134/* This function is used to set platform data field of pdev->dev */
135static inline void
136kbd_set_plat_data(struct platform_device *pdev, struct kbd_platform_data *data)
137{
138 pdev->dev.platform_data = data;
139}
140
141#endif /* __PLAT_KEYBOARD_H */