i8042-snirm.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _I8042_SNIRM_H
  2. #define _I8042_SNIRM_H
  3. #include <asm/sni.h>
  4. /*
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published by
  7. * the Free Software Foundation.
  8. */
  9. /*
  10. * Names.
  11. */
  12. #define I8042_KBD_PHYS_DESC "onboard/serio0"
  13. #define I8042_AUX_PHYS_DESC "onboard/serio1"
  14. #define I8042_MUX_PHYS_DESC "onboard/serio%d"
  15. /*
  16. * IRQs.
  17. */
  18. static int i8042_kbd_irq;
  19. static int i8042_aux_irq;
  20. #define I8042_KBD_IRQ i8042_kbd_irq
  21. #define I8042_AUX_IRQ i8042_aux_irq
  22. static void __iomem *kbd_iobase;
  23. #define I8042_COMMAND_REG (kbd_iobase + 0x64UL)
  24. #define I8042_DATA_REG (kbd_iobase + 0x60UL)
  25. static inline int i8042_read_data(void)
  26. {
  27. return readb(kbd_iobase + 0x60UL);
  28. }
  29. static inline int i8042_read_status(void)
  30. {
  31. return readb(kbd_iobase + 0x64UL);
  32. }
  33. static inline void i8042_write_data(int val)
  34. {
  35. writeb(val, kbd_iobase + 0x60UL);
  36. }
  37. static inline void i8042_write_command(int val)
  38. {
  39. writeb(val, kbd_iobase + 0x64UL);
  40. }
  41. static inline int i8042_platform_init(void)
  42. {
  43. /* RM200 is strange ... */
  44. if (sni_brd_type == SNI_BRD_RM200) {
  45. kbd_iobase = ioremap(0x16000000, 4);
  46. i8042_kbd_irq = 33;
  47. i8042_aux_irq = 44;
  48. } else {
  49. kbd_iobase = ioremap(0x14000000, 4);
  50. i8042_kbd_irq = 1;
  51. i8042_aux_irq = 12;
  52. }
  53. if (!kbd_iobase)
  54. return -ENOMEM;
  55. return 0;
  56. }
  57. static inline void i8042_platform_exit(void)
  58. {
  59. }
  60. #endif /* _I8042_SNIRM_H */