Go to the documentation of this file.
40 #include <asm/types.h>
45 #define HIL_CLOCK 8MHZ
46 #define HIL_EK1_CLOCK 30HZ
47 #define HIL_EK2_CLOCK 60HZ
49 #define HIL_TIMEOUT_DEV 5
50 #define HIL_TIMEOUT_DEVS 10
51 #define HIL_TIMEOUT_NORESP 10
52 #define HIL_TIMEOUT_DEVS_DATA 16
53 #define HIL_TIMEOUT_SELFTEST 200
60 #define HIL_WIRE_PACKET_LEN 15
127 #define HIL_DO_ALTER_CTRL 0x40000000
129 #define HIL_CTRL_ONLY 0xc0000000
200 #define HIL_IDD_DID_TYPE_MASK 0xe0
201 #define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0
202 #define HIL_IDD_DID_TYPE_KB_ITF 0xc0
203 #define HIL_IDD_DID_TYPE_KB_RSVD 0xe0
204 #define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f
205 #define HIL_IDD_DID_KBLANG_USE_ESD 0x00
206 #define HIL_IDD_DID_TYPE_ABS 0x80
207 #define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8
208 #define HIL_IDD_DID_ABS_RSVD1 0x98
209 #define HIL_IDD_DID_ABS_TABLET_MASK 0xf8
210 #define HIL_IDD_DID_ABS_TABLET 0x90
211 #define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc
212 #define HIL_IDD_DID_ABS_TSCREEN 0x8c
213 #define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc
214 #define HIL_IDD_DID_ABS_RSVD2 0x88
215 #define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc
216 #define HIL_IDD_DID_ABS_RSVD3 0x80
217 #define HIL_IDD_DID_TYPE_REL 0x60
218 #define HIL_IDD_DID_REL_RSVD1_MASK 0xf0
219 #define HIL_IDD_DID_REL_RSVD1 0x70
220 #define HIL_IDD_DID_REL_RSVD2_MASK 0xfc
221 #define HIL_IDD_DID_REL_RSVD2 0x6c
222 #define HIL_IDD_DID_REL_MOUSE_MASK 0xfc
223 #define HIL_IDD_DID_REL_MOUSE 0x68
224 #define HIL_IDD_DID_REL_QUAD_MASK 0xf8
225 #define HIL_IDD_DID_REL_QUAD 0x60
226 #define HIL_IDD_DID_TYPE_CHAR 0x40
227 #define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc
228 #define HIL_IDD_DID_CHAR_BARCODE 0x5c
229 #define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc
230 #define HIL_IDD_DID_CHAR_RSVD1 0x58
231 #define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8
232 #define HIL_IDD_DID_CHAR_RSVD2 0x50
233 #define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0
234 #define HIL_IDD_DID_CHAR_RSVD3 0x40
235 #define HIL_IDD_DID_TYPE_OTHER 0x20
236 #define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0
237 #define HIL_IDD_DID_OTHER_RSVD1 0x30
238 #define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc
239 #define HIL_IDD_DID_OTHER_BARCODE 0x2c
240 #define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc
241 #define HIL_IDD_DID_OTHER_RSVD2 0x28
242 #define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8
243 #define HIL_IDD_DID_OTHER_RSVD3 0x20
244 #define HIL_IDD_DID_TYPE_KEYPAD 0x00
248 #define HIL_IDD_HEADER_AXSET_MASK 0x03
249 #define HIL_IDD_HEADER_RSC 0x04
250 #define HIL_IDD_HEADER_EXD 0x08
251 #define HIL_IDD_HEADER_IOD 0x10
252 #define HIL_IDD_HEADER_16BIT 0x20
253 #define HIL_IDD_HEADER_ABS 0x40
254 #define HIL_IDD_HEADER_2X_AXIS 0x80
258 #define HIL_IDD_IOD_NBUTTON_MASK 0x07
259 #define HIL_IDD_IOD_PROXIMITY 0x08
260 #define HIL_IDD_IOD_PROMPT_MASK 0x70
261 #define HIL_IDD_IOD_PROMPT_SHIFT 4
262 #define HIL_IDD_IOD_PROMPT 0x80
264 #define HIL_IDD_NUM_AXES_PER_SET(header_packet) \
265 ((header_packet) & HIL_IDD_HEADER_AXSET_MASK)
267 #define HIL_IDD_NUM_AXSETS(header_packet) \
268 (2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS))
270 #define HIL_IDD_LEN(header_packet) \
271 ((4 - !(header_packet & HIL_IDD_HEADER_IOD) - \
272 2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) + \
273 2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) * \
274 !!((header_packet) & HIL_IDD_HEADER_ABS))
281 #define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) \
282 (!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 : \
283 (((*(header_ptr + 1) & HIL_PKT_DATA_MASK) + \
284 ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8) \
285 * ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1)))
287 #define HIL_IDD_AXIS_MAX(header_ptr, __axnum) \
288 ((!(*(header_ptr) & HIL_IDD_HEADER_ABS) || \
289 (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 : \
290 ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) + \
291 ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8)))
293 #define HIL_IDD_IOD(header_ptr) \
294 (*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1))
296 #define HIL_IDD_HAS_GEN_PROMPT(header_ptr) \
297 ((*header_ptr & HIL_IDD_HEADER_IOD) && \
298 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT))
300 #define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) \
301 ((*header_ptr & HIL_IDD_HEADER_IOD) && \
302 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY))
304 #define HIL_IDD_NUM_BUTTONS(header_ptr) \
305 ((*header_ptr & HIL_IDD_HEADER_IOD) ? \
306 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0)
308 #define HIL_IDD_NUM_PROMPTS(header_ptr) \
309 ((*header_ptr & HIL_IDD_HEADER_IOD) ? \
310 ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK) \
311 >> HIL_IDD_IOD_PROMPT_SHIFT) : 0)
314 #define HIL_EXD_HEADER_WRG 0x03
315 #define HIL_EXD_HEADER_WRG_TYPE1 0x01
316 #define HIL_EXD_HEADER_WRG_TYPE2 0x02
317 #define HIL_EXD_HEADER_RRG 0x04
318 #define HIL_EXD_HEADER_RNM 0x10
319 #define HIL_EXD_HEADER_RST 0x20
320 #define HIL_EXD_HEADER_LOCALE 0x40
322 #define HIL_EXD_NUM_RRG(header_ptr) \
323 ((*header_ptr & HIL_EXD_HEADER_RRG) ? \
324 (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0)
326 #define HIL_EXD_NUM_WWG(header_ptr) \
327 ((*header_ptr & HIL_EXD_HEADER_WRG) ? \
328 (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) & \
329 HIL_PKT_DATA_MASK) : 0)
331 #define HIL_EXD_LEN(header_ptr) \
332 (!!(*header_ptr & HIL_EXD_HEADER_RRG) + \
333 !!(*header_ptr & HIL_EXD_HEADER_WRG) + \
334 !!(*header_ptr & HIL_EXD_HEADER_LOCALE) + \
335 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1)
337 #define HIL_EXD_LOCALE(header_ptr) \
338 (!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 : \
339 (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK))
341 #define HIL_EXD_WRG_TYPE2_LEN(header_ptr) \
342 (!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 : \
343 (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 - \
344 !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) + \
345 ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 - \
346 !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8))
353 #define HIL_LOCALE_MAX 0x1f
358 #define HIL_LOCALE_MAP \
366 "english.canadian", \
394 #define HIL_KEYCODES_SET1_TBLSIZE 128
395 #define HIL_KEYCODES_SET1 \
396 KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT, \
397 KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ, \
398 KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9, \
399 KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER, \
400 KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS, \
401 KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS, \
402 KEY_B, KEY_V, KEY_C, KEY_X, \
403 KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC, \
404 KEY_6, KEY_F10, KEY_3, KEY_F11, \
405 KEY_KPDOT, KEY_F9, KEY_TAB , KEY_F12, \
406 KEY_H, KEY_G, KEY_F, KEY_D, \
407 KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK, \
408 KEY_U, KEY_Y, KEY_T, KEY_R, \
409 KEY_E, KEY_W, KEY_Q, KEY_TAB, \
410 KEY_7, KEY_6, KEY_5, KEY_4, \
411 KEY_3, KEY_2, KEY_1, KEY_GRAVE, \
412 KEY_F13, KEY_F14, KEY_F15, KEY_F16, \
413 KEY_F17, KEY_F18, KEY_F19, KEY_F20, \
414 KEY_MENU, KEY_F4, KEY_F3, KEY_F2, \
415 KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE, \
416 KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7, \
417 KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS, \
418 KEY_8, KEY_9, KEY_0, KEY_MINUS, \
419 KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE, \
420 KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, \
421 KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE, \
422 KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \
423 KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP, \
424 KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, \
425 KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN, \
426 KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED, \
427 KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT
430 #define HIL_KEYCODES_SET3_TBLSIZE 128
431 #define HIL_KEYCODES_SET3 \
432 KEY_RESERVED, KEY_ESC, KEY_1, KEY_2, \
433 KEY_3, KEY_4, KEY_5, KEY_6, \
434 KEY_7, KEY_8, KEY_9, KEY_0, \
435 KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB, \
436 KEY_Q, KEY_W, KEY_E, KEY_R, \
437 KEY_T, KEY_Y, KEY_U, KEY_I, \
438 KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, \
439 KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S, \
440 KEY_D, KEY_F, KEY_G, KEY_H, \
441 KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \
442 KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, \
443 KEY_Z, KEY_X, KEY_C, KEY_V, \
444 KEY_B, KEY_N, KEY_M, KEY_COMMA, \
445 KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, \
446 KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, \
447 KEY_F2, KEY_F3, KEY_F4, KEY_F5, \
448 KEY_F6, KEY_F7, KEY_F8, KEY_F9, \
449 KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7, \
450 KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4, \
451 KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1, \
452 KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT, \
453 KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
454 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
455 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
456 KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, \
457 KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN, \
458 KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED, \
459 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
460 KEY_F1, KEY_F2, KEY_F3, KEY_F4, \
461 KEY_F5, KEY_F6, KEY_F7, KEY_F8, \
462 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
463 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
468 #define HIL_POL_NUM_AXES_MASK 0x03
469 #define HIL_POL_CTS 0x04
470 #define HIL_POL_STATUS_PENDING 0x08
471 #define HIL_POL_CHARTYPE_MASK 0x70
472 #define HIL_POL_CHARTYPE_NONE 0x00
473 #define HIL_POL_CHARTYPE_RSVD1 0x10
474 #define HIL_POL_CHARTYPE_ASCII 0x20
475 #define HIL_POL_CHARTYPE_BINARY 0x30
476 #define HIL_POL_CHARTYPE_SET1 0x40
477 #define HIL_POL_CHARTYPE_RSVD2 0x50
478 #define HIL_POL_CHARTYPE_SET2 0x60
479 #define HIL_POL_CHARTYPE_SET3 0x70
480 #define HIL_POL_AXIS_ALT 0x80