diff options
Diffstat (limited to 'arch/arm/plat-spear/include/plat/keyboard.h')
-rw-r--r-- | arch/arm/plat-spear/include/plat/keyboard.h | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h index 68b5394fc583..c16cc31ecbed 100644 --- a/arch/arm/plat-spear/include/plat/keyboard.h +++ b/arch/arm/plat-spear/include/plat/keyboard.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/input/matrix_keypad.h> | 15 | #include <linux/input/matrix_keypad.h> |
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | 17 | ||
18 | #define DECLARE_KEYMAP(_name) \ | 18 | #define DECLARE_9x9_KEYMAP(_name) \ |
19 | int _name[] = { \ | 19 | int _name[] = { \ |
20 | KEY(0, 0, KEY_ESC), \ | 20 | KEY(0, 0, KEY_ESC), \ |
21 | KEY(0, 1, KEY_1), \ | 21 | KEY(0, 1, KEY_1), \ |
@@ -62,24 +62,6 @@ int _name[] = { \ | |||
62 | KEY(4, 6, KEY_Z), \ | 62 | KEY(4, 6, KEY_Z), \ |
63 | KEY(4, 7, KEY_X), \ | 63 | KEY(4, 7, KEY_X), \ |
64 | KEY(4, 8, KEY_C), \ | 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), \ | 65 | KEY(5, 0, KEY_V), \ |
84 | KEY(5, 1, KEY_B), \ | 66 | KEY(5, 1, KEY_B), \ |
85 | KEY(5, 2, KEY_N), \ | 67 | KEY(5, 2, KEY_N), \ |
@@ -118,10 +100,55 @@ int _name[] = { \ | |||
118 | KEY(8, 8, KEY_KP0), \ | 100 | KEY(8, 8, KEY_KP0), \ |
119 | } | 101 | } |
120 | 102 | ||
103 | #define DECLARE_6x6_KEYMAP(_name) \ | ||
104 | int _name[] = { \ | ||
105 | KEY(0, 0, KEY_RESERVED), \ | ||
106 | KEY(0, 1, KEY_1), \ | ||
107 | KEY(0, 2, KEY_2), \ | ||
108 | KEY(0, 3, KEY_3), \ | ||
109 | KEY(0, 4, KEY_4), \ | ||
110 | KEY(0, 5, KEY_5), \ | ||
111 | KEY(1, 0, KEY_Q), \ | ||
112 | KEY(1, 1, KEY_W), \ | ||
113 | KEY(1, 2, KEY_E), \ | ||
114 | KEY(1, 3, KEY_R), \ | ||
115 | KEY(1, 4, KEY_T), \ | ||
116 | KEY(1, 5, KEY_Y), \ | ||
117 | KEY(2, 0, KEY_D), \ | ||
118 | KEY(2, 1, KEY_F), \ | ||
119 | KEY(2, 2, KEY_G), \ | ||
120 | KEY(2, 3, KEY_H), \ | ||
121 | KEY(2, 4, KEY_J), \ | ||
122 | KEY(2, 5, KEY_K), \ | ||
123 | KEY(3, 0, KEY_B), \ | ||
124 | KEY(3, 1, KEY_N), \ | ||
125 | KEY(3, 2, KEY_M), \ | ||
126 | KEY(3, 3, KEY_COMMA), \ | ||
127 | KEY(3, 4, KEY_DOT), \ | ||
128 | KEY(3, 5, KEY_SLASH), \ | ||
129 | KEY(4, 0, KEY_F6), \ | ||
130 | KEY(4, 1, KEY_F7), \ | ||
131 | KEY(4, 2, KEY_F8), \ | ||
132 | KEY(4, 3, KEY_F9), \ | ||
133 | KEY(4, 4, KEY_F10), \ | ||
134 | KEY(4, 5, KEY_NUMLOCK), \ | ||
135 | KEY(5, 0, KEY_KP2), \ | ||
136 | KEY(5, 1, KEY_KP3), \ | ||
137 | KEY(5, 2, KEY_KP0), \ | ||
138 | KEY(5, 3, KEY_KPDOT), \ | ||
139 | KEY(5, 4, KEY_RO), \ | ||
140 | KEY(5, 5, KEY_ZENKAKUHANKAKU), \ | ||
141 | } | ||
142 | |||
143 | #define KEYPAD_9x9 0 | ||
144 | #define KEYPAD_6x6 1 | ||
145 | #define KEYPAD_2x2 2 | ||
146 | |||
121 | /** | 147 | /** |
122 | * struct kbd_platform_data - spear keyboard platform data | 148 | * struct kbd_platform_data - spear keyboard platform data |
123 | * keymap: pointer to keymap data (table and size) | 149 | * keymap: pointer to keymap data (table and size) |
124 | * rep: enables key autorepeat | 150 | * rep: enables key autorepeat |
151 | * mode: choose keyboard support(9x9, 6x6, 2x2) | ||
125 | * | 152 | * |
126 | * This structure is supposed to be used by platform code to supply | 153 | * This structure is supposed to be used by platform code to supply |
127 | * keymaps to drivers that implement keyboards. | 154 | * keymaps to drivers that implement keyboards. |
@@ -129,6 +156,7 @@ int _name[] = { \ | |||
129 | struct kbd_platform_data { | 156 | struct kbd_platform_data { |
130 | const struct matrix_keymap_data *keymap; | 157 | const struct matrix_keymap_data *keymap; |
131 | bool rep; | 158 | bool rep; |
159 | unsigned int mode; | ||
132 | }; | 160 | }; |
133 | 161 | ||
134 | /* This function is used to set platform data field of pdev->dev */ | 162 | /* This function is used to set platform data field of pdev->dev */ |