diff options
author | Max Asbock <masbock@us.ibm.com> | 2005-06-21 20:16:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 22:07:35 -0400 |
commit | 278d72ae8803ffcd16070c95fe1d53f4466dc741 (patch) | |
tree | 6cee233065ff15a42dfa86b7b159c4b06bb01b3f /drivers/misc/ibmasm/remote.h | |
parent | b8acb808468a88a188d7c5aba3681c583a5785f9 (diff) |
[PATCH] ibmasm driver: redesign handling of remote control events
This patch rewrites the handling of remote control events. Rather than making
them available from a special file in the ibmasmfs, now the events from the
RSA card get translated into kernel input events and injected into the input
subsystem. The driver now will generate two /dev/input/eventX nodes -- one
for the keyboard and one for the mouse. The mouse node generates absolute
events more like a touch pad than a mouse.
Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
Signed-off-by: Max Asbock <masbock@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/misc/ibmasm/remote.h')
-rw-r--r-- | drivers/misc/ibmasm/remote.h | 173 |
1 files changed, 162 insertions, 11 deletions
diff --git a/drivers/misc/ibmasm/remote.h b/drivers/misc/ibmasm/remote.h index a8eb19f02d3f..b7076a8442d2 100644 --- a/drivers/misc/ibmasm/remote.h +++ b/drivers/misc/ibmasm/remote.h | |||
@@ -51,11 +51,13 @@ | |||
51 | 51 | ||
52 | 52 | ||
53 | /* mouse button states received from SP */ | 53 | /* mouse button states received from SP */ |
54 | #define REMOTE_MOUSE_DOUBLE_CLICK 0xF0 | 54 | #define REMOTE_DOUBLE_CLICK 0xF0 |
55 | #define REMOTE_MOUSE_BUTTON_LEFT 0x01 | 55 | #define REMOTE_BUTTON_LEFT 0x01 |
56 | #define REMOTE_MOUSE_BUTTON_MIDDLE 0x02 | 56 | #define REMOTE_BUTTON_MIDDLE 0x02 |
57 | #define REMOTE_MOUSE_BUTTON_RIGHT 0x04 | 57 | #define REMOTE_BUTTON_RIGHT 0x04 |
58 | 58 | ||
59 | /* size of keysym/keycode translation matricies */ | ||
60 | #define XLATE_SIZE 256 | ||
59 | 61 | ||
60 | struct mouse_input { | 62 | struct mouse_input { |
61 | unsigned short y; | 63 | unsigned short y; |
@@ -83,11 +85,13 @@ struct remote_input { | |||
83 | unsigned char pad3; | 85 | unsigned char pad3; |
84 | }; | 86 | }; |
85 | 87 | ||
86 | #define mouse_addr(sp) sp->base_address + CONDOR_MOUSE_DATA | 88 | #define mouse_addr(sp) (sp->base_address + CONDOR_MOUSE_DATA) |
87 | #define display_width(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESX | 89 | #define display_width(sp) (mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESX) |
88 | #define display_height(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESY | 90 | #define display_height(sp) (mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESY) |
89 | #define display_depth(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_BITS | 91 | #define display_depth(sp) (mouse_addr(sp) + CONDOR_INPUT_DISPLAY_BITS) |
90 | #define vnc_status(sp) mouse_addr(sp) + CONDOR_OUTPUT_VNC_STATUS | 92 | #define desktop_info(sp) (mouse_addr(sp) + CONDOR_INPUT_DESKTOP_INFO) |
93 | #define vnc_status(sp) (mouse_addr(sp) + CONDOR_OUTPUT_VNC_STATUS) | ||
94 | #define isr_control(sp) (mouse_addr(sp) + CONDOR_MOUSE_ISR_CONTROL) | ||
91 | 95 | ||
92 | #define mouse_interrupt_pending(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS) | 96 | #define mouse_interrupt_pending(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS) |
93 | #define clear_mouse_interrupt(sp) writel(0, mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS) | 97 | #define clear_mouse_interrupt(sp) writel(0, mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS) |
@@ -101,10 +105,10 @@ struct remote_input { | |||
101 | #define get_queue_reader(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_Q_READER) | 105 | #define get_queue_reader(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_Q_READER) |
102 | #define set_queue_reader(sp, reader) writel(reader, mouse_addr(sp) + CONDOR_MOUSE_Q_READER) | 106 | #define set_queue_reader(sp, reader) writel(reader, mouse_addr(sp) + CONDOR_MOUSE_Q_READER) |
103 | 107 | ||
104 | #define queue_begin mouse_addr(sp) + CONDOR_MOUSE_Q_BEGIN | 108 | #define queue_begin (mouse_addr(sp) + CONDOR_MOUSE_Q_BEGIN) |
105 | 109 | ||
106 | #define get_queue_entry(sp, read_index) \ | 110 | #define get_queue_entry(sp, read_index) \ |
107 | queue_begin + read_index * sizeof(struct remote_input) | 111 | ((void*)(queue_begin + read_index * sizeof(struct remote_input))) |
108 | 112 | ||
109 | static inline int advance_queue_reader(struct service_processor *sp, unsigned long reader) | 113 | static inline int advance_queue_reader(struct service_processor *sp, unsigned long reader) |
110 | { | 114 | { |
@@ -116,4 +120,151 @@ static inline int advance_queue_reader(struct service_processor *sp, unsigned lo | |||
116 | return reader; | 120 | return reader; |
117 | } | 121 | } |
118 | 122 | ||
123 | #define NO_KEYCODE 0 | ||
124 | #define KEY_SYM_BK_SPC 0xFF08 | ||
125 | #define KEY_SYM_TAB 0xFF09 | ||
126 | #define KEY_SYM_ENTER 0xFF0D | ||
127 | #define KEY_SYM_SCR_LOCK 0xFF14 | ||
128 | #define KEY_SYM_ESCAPE 0xFF1B | ||
129 | #define KEY_SYM_HOME 0xFF50 | ||
130 | #define KEY_SYM_LARROW 0xFF51 | ||
131 | #define KEY_SYM_UARROW 0xFF52 | ||
132 | #define KEY_SYM_RARROW 0xFF53 | ||
133 | #define KEY_SYM_DARROW 0xFF54 | ||
134 | #define KEY_SYM_PAGEUP 0xFF55 | ||
135 | #define KEY_SYM_PAGEDOWN 0xFF56 | ||
136 | #define KEY_SYM_END 0xFF57 | ||
137 | #define KEY_SYM_INSERT 0xFF63 | ||
138 | #define KEY_SYM_NUM_LOCK 0xFF7F | ||
139 | #define KEY_SYM_KPSTAR 0xFFAA | ||
140 | #define KEY_SYM_KPPLUS 0xFFAB | ||
141 | #define KEY_SYM_KPMINUS 0xFFAD | ||
142 | #define KEY_SYM_KPDOT 0xFFAE | ||
143 | #define KEY_SYM_KPSLASH 0xFFAF | ||
144 | #define KEY_SYM_KPRIGHT 0xFF96 | ||
145 | #define KEY_SYM_KPUP 0xFF97 | ||
146 | #define KEY_SYM_KPLEFT 0xFF98 | ||
147 | #define KEY_SYM_KPDOWN 0xFF99 | ||
148 | #define KEY_SYM_KP0 0xFFB0 | ||
149 | #define KEY_SYM_KP1 0xFFB1 | ||
150 | #define KEY_SYM_KP2 0xFFB2 | ||
151 | #define KEY_SYM_KP3 0xFFB3 | ||
152 | #define KEY_SYM_KP4 0xFFB4 | ||
153 | #define KEY_SYM_KP5 0xFFB5 | ||
154 | #define KEY_SYM_KP6 0xFFB6 | ||
155 | #define KEY_SYM_KP7 0xFFB7 | ||
156 | #define KEY_SYM_KP8 0xFFB8 | ||
157 | #define KEY_SYM_KP9 0xFFB9 | ||
158 | #define KEY_SYM_F1 0xFFBE // 1B 5B 5B 41 | ||
159 | #define KEY_SYM_F2 0xFFBF // 1B 5B 5B 42 | ||
160 | #define KEY_SYM_F3 0xFFC0 // 1B 5B 5B 43 | ||
161 | #define KEY_SYM_F4 0xFFC1 // 1B 5B 5B 44 | ||
162 | #define KEY_SYM_F5 0xFFC2 // 1B 5B 5B 45 | ||
163 | #define KEY_SYM_F6 0xFFC3 // 1B 5B 31 37 7E | ||
164 | #define KEY_SYM_F7 0xFFC4 // 1B 5B 31 38 7E | ||
165 | #define KEY_SYM_F8 0xFFC5 // 1B 5B 31 39 7E | ||
166 | #define KEY_SYM_F9 0xFFC6 // 1B 5B 32 30 7E | ||
167 | #define KEY_SYM_F10 0xFFC7 // 1B 5B 32 31 7E | ||
168 | #define KEY_SYM_F11 0xFFC8 // 1B 5B 32 33 7E | ||
169 | #define KEY_SYM_F12 0xFFC9 // 1B 5B 32 34 7E | ||
170 | #define KEY_SYM_SHIFT 0xFFE1 | ||
171 | #define KEY_SYM_CTRL 0xFFE3 | ||
172 | #define KEY_SYM_ALT 0xFFE9 | ||
173 | #define KEY_SYM_CAP_LOCK 0xFFE5 | ||
174 | #define KEY_SYM_DELETE 0xFFFF | ||
175 | #define KEY_SYM_TILDE 0x60 | ||
176 | #define KEY_SYM_BKTIC 0x7E | ||
177 | #define KEY_SYM_ONE 0x31 | ||
178 | #define KEY_SYM_BANG 0x21 | ||
179 | #define KEY_SYM_TWO 0x32 | ||
180 | #define KEY_SYM_AT 0x40 | ||
181 | #define KEY_SYM_THREE 0x33 | ||
182 | #define KEY_SYM_POUND 0x23 | ||
183 | #define KEY_SYM_FOUR 0x34 | ||
184 | #define KEY_SYM_DOLLAR 0x24 | ||
185 | #define KEY_SYM_FIVE 0x35 | ||
186 | #define KEY_SYM_PERCENT 0x25 | ||
187 | #define KEY_SYM_SIX 0x36 | ||
188 | #define KEY_SYM_CARAT 0x5E | ||
189 | #define KEY_SYM_SEVEN 0x37 | ||
190 | #define KEY_SYM_AMPER 0x26 | ||
191 | #define KEY_SYM_EIGHT 0x38 | ||
192 | #define KEY_SYM_STAR 0x2A | ||
193 | #define KEY_SYM_NINE 0x39 | ||
194 | #define KEY_SYM_LPAREN 0x28 | ||
195 | #define KEY_SYM_ZERO 0x30 | ||
196 | #define KEY_SYM_RPAREN 0x29 | ||
197 | #define KEY_SYM_MINUS 0x2D | ||
198 | #define KEY_SYM_USCORE 0x5F | ||
199 | #define KEY_SYM_EQUAL 0x2B | ||
200 | #define KEY_SYM_PLUS 0x3D | ||
201 | #define KEY_SYM_LBRKT 0x5B | ||
202 | #define KEY_SYM_LCURLY 0x7B | ||
203 | #define KEY_SYM_RBRKT 0x5D | ||
204 | #define KEY_SYM_RCURLY 0x7D | ||
205 | #define KEY_SYM_SLASH 0x5C | ||
206 | #define KEY_SYM_PIPE 0x7C | ||
207 | #define KEY_SYM_TIC 0x27 | ||
208 | #define KEY_SYM_QUOTE 0x22 | ||
209 | #define KEY_SYM_SEMIC 0x3B | ||
210 | #define KEY_SYM_COLON 0x3A | ||
211 | #define KEY_SYM_COMMA 0x2C | ||
212 | #define KEY_SYM_LT 0x3C | ||
213 | #define KEY_SYM_PERIOD 0x2E | ||
214 | #define KEY_SYM_GT 0x3E | ||
215 | #define KEY_SYM_BSLASH 0x2F | ||
216 | #define KEY_SYM_QMARK 0x3F | ||
217 | #define KEY_SYM_A 0x41 | ||
218 | #define KEY_SYM_B 0x42 | ||
219 | #define KEY_SYM_C 0x43 | ||
220 | #define KEY_SYM_D 0x44 | ||
221 | #define KEY_SYM_E 0x45 | ||
222 | #define KEY_SYM_F 0x46 | ||
223 | #define KEY_SYM_G 0x47 | ||
224 | #define KEY_SYM_H 0x48 | ||
225 | #define KEY_SYM_I 0x49 | ||
226 | #define KEY_SYM_J 0x4A | ||
227 | #define KEY_SYM_K 0x4B | ||
228 | #define KEY_SYM_L 0x4C | ||
229 | #define KEY_SYM_M 0x4D | ||
230 | #define KEY_SYM_N 0x4E | ||
231 | #define KEY_SYM_O 0x4F | ||
232 | #define KEY_SYM_P 0x50 | ||
233 | #define KEY_SYM_Q 0x51 | ||
234 | #define KEY_SYM_R 0x52 | ||
235 | #define KEY_SYM_S 0x53 | ||
236 | #define KEY_SYM_T 0x54 | ||
237 | #define KEY_SYM_U 0x55 | ||
238 | #define KEY_SYM_V 0x56 | ||
239 | #define KEY_SYM_W 0x57 | ||
240 | #define KEY_SYM_X 0x58 | ||
241 | #define KEY_SYM_Y 0x59 | ||
242 | #define KEY_SYM_Z 0x5A | ||
243 | #define KEY_SYM_a 0x61 | ||
244 | #define KEY_SYM_b 0x62 | ||
245 | #define KEY_SYM_c 0x63 | ||
246 | #define KEY_SYM_d 0x64 | ||
247 | #define KEY_SYM_e 0x65 | ||
248 | #define KEY_SYM_f 0x66 | ||
249 | #define KEY_SYM_g 0x67 | ||
250 | #define KEY_SYM_h 0x68 | ||
251 | #define KEY_SYM_i 0x69 | ||
252 | #define KEY_SYM_j 0x6A | ||
253 | #define KEY_SYM_k 0x6B | ||
254 | #define KEY_SYM_l 0x6C | ||
255 | #define KEY_SYM_m 0x6D | ||
256 | #define KEY_SYM_n 0x6E | ||
257 | #define KEY_SYM_o 0x6F | ||
258 | #define KEY_SYM_p 0x70 | ||
259 | #define KEY_SYM_q 0x71 | ||
260 | #define KEY_SYM_r 0x72 | ||
261 | #define KEY_SYM_s 0x73 | ||
262 | #define KEY_SYM_t 0x74 | ||
263 | #define KEY_SYM_u 0x75 | ||
264 | #define KEY_SYM_v 0x76 | ||
265 | #define KEY_SYM_w 0x77 | ||
266 | #define KEY_SYM_x 0x78 | ||
267 | #define KEY_SYM_y 0x79 | ||
268 | #define KEY_SYM_z 0x7A | ||
269 | #define KEY_SYM_SPACE 0x20 | ||
119 | #endif /* _IBMASM_REMOTE_H_ */ | 270 | #endif /* _IBMASM_REMOTE_H_ */ |