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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/include/asm-arm/keyboard.h
  3.  *
  4.  *  Copyright (C) 1998 Russell King
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License version 2 as
  8.  * published by the Free Software Foundation.
  9.  *
  10.  *  Keyboard driver definitions for ARM
  11.  */
  12. #ifndef __ASM_ARM_KEYBOARD_H
  13. #define __ASM_ARM_KEYBOARD_H
  14. #include <linux/kd.h>
  15. #include <linux/pm.h>
  16. /*
  17.  * We provide a unified keyboard interface when in VC_MEDIUMRAW
  18.  * mode.  This means that all keycodes must be common between
  19.  * all supported keyboards.  This unfortunately puts us at odds
  20.  * with the PC keyboard interface chip... but we can't do anything
  21.  * about that now.
  22.  */
  23. #ifdef __KERNEL__
  24. extern int  (*k_setkeycode)(unsigned int, unsigned int);
  25. extern int  (*k_getkeycode)(unsigned int);
  26. extern int  (*k_translate)(unsigned char, unsigned char *, char);
  27. extern char (*k_unexpected_up)(unsigned char);
  28. extern void (*k_leds)(unsigned char);
  29. static inline int kbd_setkeycode(unsigned int sc, unsigned int kc)
  30. {
  31. int ret = -EINVAL;
  32. if (k_setkeycode)
  33. ret = k_setkeycode(sc, kc);
  34. return ret;
  35. }
  36. static inline int kbd_getkeycode(unsigned int sc)
  37. {
  38. int ret = -EINVAL;
  39. if (k_getkeycode)
  40. ret = k_getkeycode(sc);
  41. return ret;
  42. }
  43. static inline void kbd_leds(unsigned char leds)
  44. {
  45. if (k_leds)
  46. k_leds(leds);
  47. }
  48. extern int k_sysrq_key;
  49. extern unsigned char *k_sysrq_xlate;
  50. #define SYSRQ_KEY k_sysrq_key
  51. #define kbd_sysrq_xlate k_sysrq_xlate
  52. #define kbd_translate k_translate
  53. #define kbd_unexpected_up k_unexpected_up
  54. #include <asm/arch/keyboard.h>
  55. #endif /* __KERNEL__ */
  56. #endif /* __ASM_ARM_KEYBOARD_H */