i8042-ip22io.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef _I8042_IP22_H
  3. #define _I8042_IP22_H
  4. #include <asm/sgi/ioc.h>
  5. #include <asm/sgi/ip22.h>
  6. /*
  7. * Names.
  8. */
  9. #define I8042_KBD_PHYS_DESC "hpc3ps2/serio0"
  10. #define I8042_AUX_PHYS_DESC "hpc3ps2/serio1"
  11. #define I8042_MUX_PHYS_DESC "hpc3ps2/serio%d"
  12. /*
  13. * IRQs.
  14. */
  15. #define I8042_KBD_IRQ SGI_KEYBD_IRQ
  16. #define I8042_AUX_IRQ SGI_KEYBD_IRQ
  17. /*
  18. * Register numbers.
  19. */
  20. #define I8042_COMMAND_REG ((unsigned long)&sgioc->kbdmouse.command)
  21. #define I8042_STATUS_REG ((unsigned long)&sgioc->kbdmouse.command)
  22. #define I8042_DATA_REG ((unsigned long)&sgioc->kbdmouse.data)
  23. static inline int i8042_read_data(void)
  24. {
  25. return sgioc->kbdmouse.data;
  26. }
  27. static inline int i8042_read_status(void)
  28. {
  29. return sgioc->kbdmouse.command;
  30. }
  31. static inline void i8042_write_data(int val)
  32. {
  33. sgioc->kbdmouse.data = val;
  34. }
  35. static inline void i8042_write_command(int val)
  36. {
  37. sgioc->kbdmouse.command = val;
  38. }
  39. static inline int i8042_platform_init(void)
  40. {
  41. #if 0
  42. /* XXX sgi_kh is a virtual address */
  43. if (!request_mem_region(sgi_kh, sizeof(struct hpc_keyb), "i8042"))
  44. return -EBUSY;
  45. #endif
  46. i8042_reset = I8042_RESET_ALWAYS;
  47. return 0;
  48. }
  49. static inline void i8042_platform_exit(void)
  50. {
  51. #if 0
  52. release_mem_region(JAZZ_KEYBOARD_ADDRESS, sizeof(struct hpc_keyb));
  53. #endif
  54. }
  55. #endif /* _I8042_IP22_H */