i8042-ppcio.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _I8042_PPCIO_H
  2. #define _I8042_PPCIO_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. #if defined(CONFIG_WALNUT)
  9. #define I8042_KBD_IRQ 25
  10. #define I8042_AUX_IRQ 26
  11. #define I8042_KBD_PHYS_DESC "walnutps2/serio0"
  12. #define I8042_AUX_PHYS_DESC "walnutps2/serio1"
  13. #define I8042_MUX_PHYS_DESC "walnutps2/serio%d"
  14. extern void *kb_cs;
  15. extern void *kb_data;
  16. #define I8042_COMMAND_REG (*(int *)kb_cs)
  17. #define I8042_DATA_REG (*(int *)kb_data)
  18. static inline int i8042_read_data(void)
  19. {
  20. return readb(kb_data);
  21. }
  22. static inline int i8042_read_status(void)
  23. {
  24. return readb(kb_cs);
  25. }
  26. static inline void i8042_write_data(int val)
  27. {
  28. writeb(val, kb_data);
  29. }
  30. static inline void i8042_write_command(int val)
  31. {
  32. writeb(val, kb_cs);
  33. }
  34. static inline int i8042_platform_init(void)
  35. {
  36. i8042_reset = I8042_RESET_ALWAYS;
  37. return 0;
  38. }
  39. static inline void i8042_platform_exit(void)
  40. {
  41. }
  42. #else
  43. #include "i8042-io.h"
  44. #endif
  45. #endif /* _I8042_PPCIO_H */