ps2mult.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #ifndef __LINUX_PS2MULT_H
  2. #define __LINUX_PS2MULT_H
  3. #define kbd_request_region() ps2mult_init()
  4. #define kbd_request_irq(handler) ps2mult_request_irq(handler)
  5. #define kbd_read_input() ps2mult_read_input()
  6. #define kbd_read_status() ps2mult_read_status()
  7. #define kbd_write_output(val) ps2mult_write_output(val)
  8. #define kbd_write_command(val) ps2mult_write_command(val)
  9. #define aux_request_irq(hand, dev_id) 0
  10. #define aux_free_irq(dev_id)
  11. #define PS2MULT_KB_SELECTOR 0xA0
  12. #define PS2MULT_MS_SELECTOR 0xA1
  13. #define PS2MULT_ESCAPE 0x7D
  14. #define PS2MULT_BSYNC 0x7E
  15. #define PS2MULT_SESSION_START 0x55
  16. #define PS2MULT_SESSION_END 0x56
  17. #define PS2BUF_SIZE 512 /* power of 2, please */
  18. #ifndef CONFIG_PS2MULT_DELAY
  19. #define CONFIG_PS2MULT_DELAY (CFG_HZ/2) /* Initial delay */
  20. #endif
  21. /* PS/2 controller interface (include/asm/keyboard.h)
  22. */
  23. extern int ps2mult_init (void);
  24. extern int ps2mult_request_irq(void (*handler)(void *));
  25. extern u_char ps2mult_read_input(void);
  26. extern u_char ps2mult_read_status(void);
  27. extern void ps2mult_write_output(u_char val);
  28. extern void ps2mult_write_command(u_char val);
  29. extern void ps2mult_early_init (void);
  30. extern void ps2mult_callback (int in_cnt);
  31. /* Simple serial interface
  32. */
  33. extern int ps2ser_init(void);
  34. extern void ps2ser_putc(int chr);
  35. extern int ps2ser_getc(void);
  36. extern int ps2ser_check(void);
  37. /* Serial related stuff
  38. */
  39. struct serial_state {
  40. int baud_base;
  41. int irq;
  42. u8 *iomem_base;
  43. };
  44. #define UART_RX 0 /* In: Receive buffer (DLAB=0) */
  45. #define UART_TX 0 /* Out: Transmit buffer (DLAB=0) */
  46. #define UART_DLL 0 /* Out: Divisor Latch Low (DLAB=1) */
  47. #define UART_DLM 1 /* Out: Divisor Latch High (DLAB=1) */
  48. #define UART_IER 1 /* Out: Interrupt Enable Register */
  49. #define UART_IIR 2 /* In: Interrupt ID Register */
  50. #define UART_FCR 2 /* Out: FIFO Control Register */
  51. #define UART_LCR 3 /* Out: Line Control Register */
  52. #define UART_MCR 4 /* Out: Modem Control Register */
  53. #define UART_LSR 5 /* In: Line Status Register */
  54. #define UART_MSR 6 /* In: Modem Status Register */
  55. #define UART_SCR 7 /* I/O: Scratch Register */
  56. /*
  57. * These are the definitions for the FIFO Control Register
  58. * (16650 only)
  59. */
  60. #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
  61. #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
  62. #define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
  63. #define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
  64. #define UART_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range */
  65. #define UART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
  66. #define UART_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */
  67. #define UART_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */
  68. #define UART_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */
  69. /*
  70. * These are the definitions for the Line Control Register
  71. *
  72. * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting
  73. * UART_LCR_STOP will select 1.5 stop bits, not 2 stop bits.
  74. */
  75. #define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
  76. #define UART_LCR_SBC 0x40 /* Set break control */
  77. #define UART_LCR_SPAR 0x20 /* Stick parity (?) */
  78. #define UART_LCR_EPAR 0x10 /* Even parity select */
  79. #define UART_LCR_PARITY 0x08 /* Parity Enable */
  80. #define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
  81. #define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
  82. #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
  83. #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
  84. #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
  85. /*
  86. * These are the definitions for the Line Status Register
  87. */
  88. #define UART_LSR_TEMT 0x40 /* Transmitter empty */
  89. #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
  90. #define UART_LSR_BI 0x10 /* Break interrupt indicator */
  91. #define UART_LSR_FE 0x08 /* Frame error indicator */
  92. #define UART_LSR_PE 0x04 /* Parity error indicator */
  93. #define UART_LSR_OE 0x02 /* Overrun error indicator */
  94. #define UART_LSR_DR 0x01 /* Receiver data ready */
  95. /*
  96. * These are the definitions for the Interrupt Identification Register
  97. */
  98. #define UART_IIR_NO_INT 0x01 /* No interrupts pending */
  99. #define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
  100. #define UART_IIR_MSI 0x00 /* Modem status interrupt */
  101. #define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
  102. #define UART_IIR_RDI 0x04 /* Receiver data interrupt */
  103. #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
  104. /*
  105. * These are the definitions for the Interrupt Enable Register
  106. */
  107. #define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
  108. #define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
  109. #define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
  110. #define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
  111. /*
  112. * These are the definitions for the Modem Control Register
  113. */
  114. #define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
  115. #define UART_MCR_OUT2 0x08 /* Out2 complement */
  116. #define UART_MCR_OUT1 0x04 /* Out1 complement */
  117. #define UART_MCR_RTS 0x02 /* RTS complement */
  118. #define UART_MCR_DTR 0x01 /* DTR complement */
  119. /*
  120. * These are the definitions for the Modem Status Register
  121. */
  122. #define UART_MSR_DCD 0x80 /* Data Carrier Detect */
  123. #define UART_MSR_RI 0x40 /* Ring Indicator */
  124. #define UART_MSR_DSR 0x20 /* Data Set Ready */
  125. #define UART_MSR_CTS 0x10 /* Clear to Send */
  126. #define UART_MSR_DDCD 0x08 /* Delta DCD */
  127. #define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
  128. #define UART_MSR_DDSR 0x02 /* Delta DSR */
  129. #define UART_MSR_DCTS 0x01 /* Delta CTS */
  130. #define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
  131. #endif /* __LINUX_PS2MULT_H */