i8042.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. * Return codes.
  38. */
  39. #define I8042_RET_CTL_TEST 0x55
  40. /*
  41. * Expected maximum internal i8042 buffer size. This is used for flushing
  42. * the i8042 buffers.
  43. */
  44. #define I8042_BUFFER_SIZE 16
  45. /*
  46. * Number of AUX ports on controllers supporting active multiplexing
  47. * specification
  48. */
  49. #define I8042_NUM_MUX_PORTS 4
  50. /*
  51. * Debug.
  52. */
  53. #ifdef DEBUG
  54. static unsigned long i8042_start_time;
  55. #define dbg_init() do { i8042_start_time = jiffies; } while (0)
  56. #define dbg(format, arg...) \
  57. do { \
  58. if (i8042_debug) \
  59. printk(KERN_DEBUG KBUILD_MODNAME ": [%d] " format, \
  60. (int) (jiffies - i8042_start_time), ##arg); \
  61. } while (0)
  62. #define filter_dbg(filter, data, format, args...) \
  63. do { \
  64. if (!i8042_debug) \
  65. break; \
  66. \
  67. if (!filter || i8042_unmask_kbd_data) \
  68. dbg("%02x " format, data, ##args); \
  69. else \
  70. dbg("** " format, ##args); \
  71. } while (0)
  72. #else
  73. #define dbg_init() do { } while (0)
  74. #define dbg(format, arg...) \
  75. do { \
  76. if (0) \
  77. printk(KERN_DEBUG pr_fmt(format), ##arg); \
  78. } while (0)
  79. #define filter_dbg(filter, data, format, args...) do { } while (0)
  80. #endif
  81. #endif /* _I8042_H */