simpad.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * arch/arm/mach-sa1100/include/mach/simpad.h
  4. *
  5. * based of assabet.h same as HUW_Webpanel
  6. *
  7. * This file contains the hardware specific definitions for SIMpad
  8. *
  9. * 2001/05/14 Juergen Messerer <[email protected]>
  10. */
  11. #ifndef __ASM_ARCH_SIMPAD_H
  12. #define __ASM_ARCH_SIMPAD_H
  13. #define GPIO_UART1_RTS GPIO_GPIO14
  14. #define GPIO_UART1_DTR GPIO_GPIO7
  15. #define GPIO_UART1_CTS GPIO_GPIO8
  16. #define GPIO_UART1_DCD GPIO_GPIO23
  17. #define GPIO_UART1_DSR GPIO_GPIO6
  18. #define GPIO_UART3_RTS GPIO_GPIO12
  19. #define GPIO_UART3_DTR GPIO_GPIO16
  20. #define GPIO_UART3_CTS GPIO_GPIO13
  21. #define GPIO_UART3_DCD GPIO_GPIO18
  22. #define GPIO_UART3_DSR GPIO_GPIO17
  23. #define GPIO_POWER_BUTTON GPIO_GPIO0
  24. #define GPIO_UCB1300_IRQ GPIO_GPIO22 /* UCB GPIO and touchscreen */
  25. #define IRQ_UART1_CTS IRQ_GPIO15
  26. #define IRQ_UART1_DCD GPIO_GPIO23
  27. #define IRQ_UART1_DSR GPIO_GPIO6
  28. #define IRQ_UART3_CTS GPIO_GPIO13
  29. #define IRQ_UART3_DCD GPIO_GPIO18
  30. #define IRQ_UART3_DSR GPIO_GPIO17
  31. #define IRQ_GPIO_UCB1300_IRQ IRQ_GPIO22
  32. #define IRQ_GPIO_POWER_BUTTON IRQ_GPIO0
  33. /*--- PCMCIA ---*/
  34. #define GPIO_CF_CD 24
  35. #define GPIO_CF_IRQ 1
  36. /*--- SmartCard ---*/
  37. #define GPIO_SMART_CARD GPIO_GPIO10
  38. #define IRQ_GPIO_SMARD_CARD IRQ_GPIO10
  39. /*--- ucb1x00 GPIO ---*/
  40. #define SIMPAD_UCB1X00_GPIO_BASE (GPIO_MAX + 1)
  41. #define SIMPAD_UCB1X00_GPIO_PROG1 (SIMPAD_UCB1X00_GPIO_BASE)
  42. #define SIMPAD_UCB1X00_GPIO_PROG2 (SIMPAD_UCB1X00_GPIO_BASE + 1)
  43. #define SIMPAD_UCB1X00_GPIO_UP (SIMPAD_UCB1X00_GPIO_BASE + 2)
  44. #define SIMPAD_UCB1X00_GPIO_DOWN (SIMPAD_UCB1X00_GPIO_BASE + 3)
  45. #define SIMPAD_UCB1X00_GPIO_LEFT (SIMPAD_UCB1X00_GPIO_BASE + 4)
  46. #define SIMPAD_UCB1X00_GPIO_RIGHT (SIMPAD_UCB1X00_GPIO_BASE + 5)
  47. #define SIMPAD_UCB1X00_GPIO_6 (SIMPAD_UCB1X00_GPIO_BASE + 6)
  48. #define SIMPAD_UCB1X00_GPIO_7 (SIMPAD_UCB1X00_GPIO_BASE + 7)
  49. #define SIMPAD_UCB1X00_GPIO_HEADSET (SIMPAD_UCB1X00_GPIO_BASE + 8)
  50. #define SIMPAD_UCB1X00_GPIO_SPEAKER (SIMPAD_UCB1X00_GPIO_BASE + 9)
  51. /*--- CS3 Latch ---*/
  52. #define SIMPAD_CS3_GPIO_BASE (GPIO_MAX + 11)
  53. #define SIMPAD_CS3_VCC_5V_EN (SIMPAD_CS3_GPIO_BASE)
  54. #define SIMPAD_CS3_VCC_3V_EN (SIMPAD_CS3_GPIO_BASE + 1)
  55. #define SIMPAD_CS3_EN1 (SIMPAD_CS3_GPIO_BASE + 2)
  56. #define SIMPAD_CS3_EN0 (SIMPAD_CS3_GPIO_BASE + 3)
  57. #define SIMPAD_CS3_DISPLAY_ON (SIMPAD_CS3_GPIO_BASE + 4)
  58. #define SIMPAD_CS3_PCMCIA_BUFF_DIS (SIMPAD_CS3_GPIO_BASE + 5)
  59. #define SIMPAD_CS3_MQ_RESET (SIMPAD_CS3_GPIO_BASE + 6)
  60. #define SIMPAD_CS3_PCMCIA_RESET (SIMPAD_CS3_GPIO_BASE + 7)
  61. #define SIMPAD_CS3_DECT_POWER_ON (SIMPAD_CS3_GPIO_BASE + 8)
  62. #define SIMPAD_CS3_IRDA_SD (SIMPAD_CS3_GPIO_BASE + 9)
  63. #define SIMPAD_CS3_RS232_ON (SIMPAD_CS3_GPIO_BASE + 10)
  64. #define SIMPAD_CS3_SD_MEDIAQ (SIMPAD_CS3_GPIO_BASE + 11)
  65. #define SIMPAD_CS3_LED2_ON (SIMPAD_CS3_GPIO_BASE + 12)
  66. #define SIMPAD_CS3_IRDA_MODE (SIMPAD_CS3_GPIO_BASE + 13)
  67. #define SIMPAD_CS3_ENABLE_5V (SIMPAD_CS3_GPIO_BASE + 14)
  68. #define SIMPAD_CS3_RESET_SIMCARD (SIMPAD_CS3_GPIO_BASE + 15)
  69. #define SIMPAD_CS3_PCMCIA_BVD1 (SIMPAD_CS3_GPIO_BASE + 16)
  70. #define SIMPAD_CS3_PCMCIA_BVD2 (SIMPAD_CS3_GPIO_BASE + 17)
  71. #define SIMPAD_CS3_PCMCIA_VS1 (SIMPAD_CS3_GPIO_BASE + 18)
  72. #define SIMPAD_CS3_PCMCIA_VS2 (SIMPAD_CS3_GPIO_BASE + 19)
  73. #define SIMPAD_CS3_LOCK_IND (SIMPAD_CS3_GPIO_BASE + 20)
  74. #define SIMPAD_CS3_CHARGING_STATE (SIMPAD_CS3_GPIO_BASE + 21)
  75. #define SIMPAD_CS3_PCMCIA_SHORT (SIMPAD_CS3_GPIO_BASE + 22)
  76. #define SIMPAD_CS3_GPIO_23 (SIMPAD_CS3_GPIO_BASE + 23)
  77. #define CS3_BASE IOMEM(0xf1000000)
  78. long simpad_get_cs3_ro(void);
  79. long simpad_get_cs3_shadow(void);
  80. void simpad_set_cs3_bit(int value);
  81. void simpad_clear_cs3_bit(int value);
  82. #define VCC_5V_EN 0x0001 /* For 5V PCMCIA */
  83. #define VCC_3V_EN 0x0002 /* FOR 3.3V PCMCIA */
  84. #define EN1 0x0004 /* This is only for EPROM's */
  85. #define EN0 0x0008 /* Both should be enable for 3.3V or 5V */
  86. #define DISPLAY_ON 0x0010
  87. #define PCMCIA_BUFF_DIS 0x0020
  88. #define MQ_RESET 0x0040
  89. #define PCMCIA_RESET 0x0080
  90. #define DECT_POWER_ON 0x0100
  91. #define IRDA_SD 0x0200 /* Shutdown for powersave */
  92. #define RS232_ON 0x0400
  93. #define SD_MEDIAQ 0x0800 /* Shutdown for powersave */
  94. #define LED2_ON 0x1000
  95. #define IRDA_MODE 0x2000 /* Fast/Slow IrDA mode */
  96. #define ENABLE_5V 0x4000 /* Enable 5V circuit */
  97. #define RESET_SIMCARD 0x8000
  98. #define PCMCIA_BVD1 0x01
  99. #define PCMCIA_BVD2 0x02
  100. #define PCMCIA_VS1 0x04
  101. #define PCMCIA_VS2 0x08
  102. #define LOCK_IND 0x10
  103. #define CHARGING_STATE 0x20
  104. #define PCMCIA_SHORT 0x40
  105. /*--- Battery ---*/
  106. struct simpad_battery {
  107. unsigned char ac_status; /* line connected yes/no */
  108. unsigned char status; /* battery loading yes/no */
  109. unsigned char percentage; /* percentage loaded */
  110. unsigned short life; /* life till empty */
  111. };
  112. /* These should match the apm_bios.h definitions */
  113. #define SIMPAD_AC_STATUS_AC_OFFLINE 0x00
  114. #define SIMPAD_AC_STATUS_AC_ONLINE 0x01
  115. #define SIMPAD_AC_STATUS_AC_BACKUP 0x02 /* What does this mean? */
  116. #define SIMPAD_AC_STATUS_AC_UNKNOWN 0xff
  117. /* These bitfields are rarely "or'd" together */
  118. #define SIMPAD_BATT_STATUS_HIGH 0x01
  119. #define SIMPAD_BATT_STATUS_LOW 0x02
  120. #define SIMPAD_BATT_STATUS_CRITICAL 0x04
  121. #define SIMPAD_BATT_STATUS_CHARGING 0x08
  122. #define SIMPAD_BATT_STATUS_CHARGE_MAIN 0x10
  123. #define SIMPAD_BATT_STATUS_DEAD 0x20 /* Battery will not charge */
  124. #define SIMPAD_BATT_NOT_INSTALLED 0x20 /* For expansion pack batteries */
  125. #define SIMPAD_BATT_STATUS_FULL 0x40 /* Battery fully charged (and connected to AC) */
  126. #define SIMPAD_BATT_STATUS_NOBATT 0x80
  127. #define SIMPAD_BATT_STATUS_UNKNOWN 0xff
  128. extern int simpad_get_battery(struct simpad_battery* );
  129. #endif // __ASM_ARCH_SIMPAD_H