i8042.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef _I8042_H
  2. #define _I8042_H
  3. /*
  4. * Copyright (c) 1999-2002 Vojtech Pavlik
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. */
  10. /*
  11. * Arch-dependent inline functions and defines.
  12. */
  13. #if defined(CONFIG_MACH_JAZZ)
  14. #include "i8042-jazzio.h"
  15. #elif defined(CONFIG_SGI_HAS_I8042)
  16. #include "i8042-ip22io.h"
  17. #elif defined(CONFIG_SNI_RM)
  18. #include "i8042-snirm.h"
  19. #elif defined(CONFIG_PPC)
  20. #include "i8042-ppcio.h"
  21. #elif defined(CONFIG_SPARC)
  22. #include "i8042-sparcio.h"
  23. #elif defined(CONFIG_X86) || defined(CONFIG_IA64)
  24. #include "i8042-x86ia64io.h"
  25. #elif defined(CONFIG_UNICORE32)
  26. #include "i8042-unicore32io.h"
  27. #else
  28. #include "i8042-io.h"
  29. #endif
  30. /*
  31. * This is in 50us units, the time we wait for the i8042 to react. This
  32. * has to be long enough for the i8042 itself to timeout on sending a byte
  33. * to a non-existent mouse.
  34. */
  35. #define I8042_CTL_TIMEOUT 10000
  36. /*
  37. * Status register bits.
  38. */
  39. #define I8042_STR_PARITY 0x80
  40. #define I8042_STR_TIMEOUT 0x40
  41. #define I8042_STR_AUXDATA 0x20
  42. #define I8042_STR_KEYLOCK 0x10
  43. #define I8042_STR_CMDDAT 0x08
  44. #define I8042_STR_MUXERR 0x04
  45. #define I8042_STR_IBF 0x02
  46. #define I8042_STR_OBF 0x01
  47. /*
  48. * Control register bits.
  49. */
  50. #define I8042_CTR_KBDINT 0x01
  51. #define I8042_CTR_AUXINT 0x02
  52. #define I8042_CTR_IGNKEYLOCK 0x08
  53. #define I8042_CTR_KBDDIS 0x10
  54. #define I8042_CTR_AUXDIS 0x20
  55. #define I8042_CTR_XLATE 0x40
  56. /*
  57. * Return codes.
  58. */
  59. #define I8042_RET_CTL_TEST 0x55
  60. /*
  61. * Expected maximum internal i8042 buffer size. This is used for flushing
  62. * the i8042 buffers.
  63. */
  64. #define I8042_BUFFER_SIZE 16
  65. /*
  66. * Number of AUX ports on controllers supporting active multiplexing
  67. * specification
  68. */
  69. #define I8042_NUM_MUX_PORTS 4
  70. /*
  71. * Debug.
  72. */
  73. #ifdef DEBUG
  74. static unsigned long i8042_start_time;
  75. #define dbg_init() do { i8042_start_time = jiffies; } while (0)
  76. #define dbg(format, arg...) \
  77. do { \
  78. if (i8042_debug) \
  79. printk(KERN_DEBUG KBUILD_MODNAME ": [%d] " format, \
  80. (int) (jiffies - i8042_start_time), ##arg); \
  81. } while (0)
  82. #else
  83. #define dbg_init() do { } while (0)
  84. #define dbg(format, arg...) \
  85. do { \
  86. if (0) \
  87. printk(KERN_DEBUG pr_fmt(format), ##arg); \
  88. } while (0)
  89. #endif
  90. #endif /* _I8042_H */