i8042.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef _LINUX_I8042_H
  2. #define _LINUX_I8042_H
  3. /*
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License version 2 as published by
  6. * the Free Software Foundation.
  7. */
  8. #include <linux/types.h>
  9. /*
  10. * Standard commands.
  11. */
  12. #define I8042_CMD_CTL_RCTR 0x0120
  13. #define I8042_CMD_CTL_WCTR 0x1060
  14. #define I8042_CMD_CTL_TEST 0x01aa
  15. #define I8042_CMD_KBD_DISABLE 0x00ad
  16. #define I8042_CMD_KBD_ENABLE 0x00ae
  17. #define I8042_CMD_KBD_TEST 0x01ab
  18. #define I8042_CMD_KBD_LOOP 0x11d2
  19. #define I8042_CMD_AUX_DISABLE 0x00a7
  20. #define I8042_CMD_AUX_ENABLE 0x00a8
  21. #define I8042_CMD_AUX_TEST 0x01a9
  22. #define I8042_CMD_AUX_SEND 0x10d4
  23. #define I8042_CMD_AUX_LOOP 0x11d3
  24. #define I8042_CMD_MUX_PFX 0x0090
  25. #define I8042_CMD_MUX_SEND 0x1090
  26. /*
  27. * Status register bits.
  28. */
  29. #define I8042_STR_PARITY 0x80
  30. #define I8042_STR_TIMEOUT 0x40
  31. #define I8042_STR_AUXDATA 0x20
  32. #define I8042_STR_KEYLOCK 0x10
  33. #define I8042_STR_CMDDAT 0x08
  34. #define I8042_STR_MUXERR 0x04
  35. #define I8042_STR_IBF 0x02
  36. #define I8042_STR_OBF 0x01
  37. /*
  38. * Control register bits.
  39. */
  40. #define I8042_CTR_KBDINT 0x01
  41. #define I8042_CTR_AUXINT 0x02
  42. #define I8042_CTR_IGNKEYLOCK 0x08
  43. #define I8042_CTR_KBDDIS 0x10
  44. #define I8042_CTR_AUXDIS 0x20
  45. #define I8042_CTR_XLATE 0x40
  46. struct serio;
  47. #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
  48. void i8042_lock_chip(void);
  49. void i8042_unlock_chip(void);
  50. int i8042_command(unsigned char *param, int command);
  51. int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
  52. struct serio *serio));
  53. int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
  54. struct serio *serio));
  55. #else
  56. static inline void i8042_lock_chip(void)
  57. {
  58. }
  59. static inline void i8042_unlock_chip(void)
  60. {
  61. }
  62. static inline int i8042_command(unsigned char *param, int command)
  63. {
  64. return -ENODEV;
  65. }
  66. static inline int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
  67. struct serio *serio))
  68. {
  69. return -ENODEV;
  70. }
  71. static inline int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
  72. struct serio *serio))
  73. {
  74. return -ENODEV;
  75. }
  76. #endif
  77. #endif