i8042.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. struct serio;
  27. #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
  28. void i8042_lock_chip(void);
  29. void i8042_unlock_chip(void);
  30. int i8042_command(unsigned char *param, int command);
  31. bool i8042_check_port_owner(const struct serio *);
  32. int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
  33. struct serio *serio));
  34. int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
  35. struct serio *serio));
  36. #else
  37. static inline void i8042_lock_chip(void)
  38. {
  39. }
  40. static inline void i8042_unlock_chip(void)
  41. {
  42. }
  43. static inline int i8042_command(unsigned char *param, int command)
  44. {
  45. return -ENODEV;
  46. }
  47. static inline bool i8042_check_port_owner(const struct serio *serio)
  48. {
  49. return false;
  50. }
  51. static inline int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
  52. struct serio *serio))
  53. {
  54. return -ENODEV;
  55. }
  56. static inline int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
  57. struct serio *serio))
  58. {
  59. return -ENODEV;
  60. }
  61. #endif
  62. #endif