i8042.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef _I8042_H
  3. #define _I8042_H
  4. /*
  5. * Copyright (c) 1999-2002 Vojtech Pavlik
  6. */
  7. /*
  8. * Arch-dependent inline functions and defines.
  9. */
  10. #if defined(CONFIG_MACH_JAZZ)
  11. #include "i8042-jazzio.h"
  12. #elif defined(CONFIG_SGI_HAS_I8042)
  13. #include "i8042-ip22io.h"
  14. #elif defined(CONFIG_SNI_RM)
  15. #include "i8042-snirm.h"
  16. #elif defined(CONFIG_SPARC)
  17. #include "i8042-sparcio.h"
  18. #elif defined(CONFIG_X86) || defined(CONFIG_IA64)
  19. #include "i8042-x86ia64io.h"
  20. #else
  21. #include "i8042-io.h"
  22. #endif
  23. /*
  24. * This is in 50us units, the time we wait for the i8042 to react. This
  25. * has to be long enough for the i8042 itself to timeout on sending a byte
  26. * to a non-existent mouse.
  27. */
  28. #define I8042_CTL_TIMEOUT 10000
  29. /*
  30. * Return codes.
  31. */
  32. #define I8042_RET_CTL_TEST 0x55
  33. /*
  34. * Expected maximum internal i8042 buffer size. This is used for flushing
  35. * the i8042 buffers.
  36. */
  37. #define I8042_BUFFER_SIZE 16
  38. /*
  39. * Number of AUX ports on controllers supporting active multiplexing
  40. * specification
  41. */
  42. #define I8042_NUM_MUX_PORTS 4
  43. /*
  44. * Debug.
  45. */
  46. #ifdef DEBUG
  47. static unsigned long i8042_start_time;
  48. #define dbg_init() do { i8042_start_time = jiffies; } while (0)
  49. #define dbg(format, arg...) \
  50. do { \
  51. if (i8042_debug) \
  52. printk(KERN_DEBUG KBUILD_MODNAME ": [%d] " format, \
  53. (int) (jiffies - i8042_start_time), ##arg); \
  54. } while (0)
  55. #define filter_dbg(filter, data, format, args...) \
  56. do { \
  57. if (!i8042_debug) \
  58. break; \
  59. \
  60. if (!filter || i8042_unmask_kbd_data) \
  61. dbg("%02x " format, data, ##args); \
  62. else \
  63. dbg("** " format, ##args); \
  64. } while (0)
  65. #else
  66. #define dbg_init() do { } while (0)
  67. #define dbg(format, arg...) \
  68. do { \
  69. if (0) \
  70. printk(KERN_DEBUG pr_fmt(format), ##arg); \
  71. } while (0)
  72. #define filter_dbg(filter, data, format, args...) do { } while (0)
  73. #endif
  74. #endif /* _I8042_H */