keyboard.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  3.  *  ---------------------------------------------------------------
  4.  *  This file will be removed as soon as we have converted
  5.  *  hp_psaux.c and hp_keyb.c to the input layer !
  6.  *  
  7.  */
  8. /*
  9.  *  linux/include/asm-parisc/keyboard.h
  10.  *
  11.  *  Original by Geert Uytterhoeven
  12.  *  updates by Alex deVries <adevries@thepuffingroup.com>
  13.  *  portions copyright (1999) The Puffin Group
  14.  *  mostly rewritten by Philipp Rumpf <prumpf@tux.org>,
  15.  *   Copyright 2000 Philipp Rumpf
  16.  */
  17. /*
  18.  *  We try to keep the amount of generic code as low as possible -
  19.  *  we want to support all HIL, PS/2, and untranslated USB keyboards
  20.  */
  21. #ifndef _PARISC_KEYBOARD_H
  22. #define _PARISC_KEYBOARD_H
  23. #include <linux/config.h>
  24. #ifdef __KERNEL__
  25. #ifdef CONFIG_VT
  26. #include <linux/kernel.h>
  27. #include <linux/kd.h>
  28. /*  These are basically the generic functions / variables.  The only
  29.  *  unexpected detail is the initialization sequence for the keyboard
  30.  *  driver is something like this:
  31.  *
  32.  *  detect keyboard port
  33.  *  detect keyboard
  34.  *  call register_kbd_ops 
  35.  *  wait for init_hw
  36.  *
  37.  *  only after init_hw has been called you're allowed to call
  38.  *  handle_scancode.  This means you either have to be extremely
  39.  *  careful or use a global flag or something - I strongly suggest
  40.  *  the latter.    prumpf */
  41. extern struct kbd_ops {
  42. int (*setkeycode)(unsigned int, unsigned int);
  43. int (*getkeycode)(unsigned int);
  44. int (*translate)(unsigned char, unsigned char *, char);
  45. char (*unexpected_up)(unsigned char);
  46. void (*leds)(unsigned char);
  47. void (*init_hw)(void);
  48. unsigned char sysrq_key;
  49. unsigned char *sysrq_xlate;
  50. } *kbd_ops;
  51. #define kbd_setkeycode (*kbd_ops->setkeycode)
  52. #define kbd_getkeycode (*kbd_ops->getkeycode)
  53. #define kbd_translate (*kbd_ops->translate)
  54. #define kbd_unexpected_up (*kbd_ops->unexpected_up)
  55. #define kbd_leds (*kbd_ops->leds)
  56. #define kbd_init_hw (*kbd_ops->init_hw)
  57. #define SYSRQ_KEY (kbd_ops->sysrq_key)
  58. #define kbd_sysrq_xlate (kbd_ops->sysrq_xlate)
  59. extern unsigned char hp_ps2kbd_sysrq_xlate[128];  /* from drivers/char/hp_keyb.c */
  60. extern void unregister_kbd_ops(void);
  61. extern void register_kbd_ops(struct kbd_ops *ops);
  62. #endif /* CONFIG_VT */
  63. #endif /* __KERNEL__ */
  64. #endif /* __ASMPARISC_KEYBOARD_H */