simpad.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * linux/include/asm-arm/arch-sa1100/simpad.h
  3. *
  4. * based of assabet.h same as HUW_Webpanel
  5. *
  6. * This file contains the hardware specific definitions for SIMpad
  7. *
  8. * 2001/05/14 Juergen Messerer <juergen.messerer@freesurf.ch>
  9. */
  10. #ifndef __ASM_ARCH_SIMPAD_H
  11. #define __ASM_ARCH_SIMPAD_H
  12. #define GPIO_UART1_RTS GPIO_GPIO14
  13. #define GPIO_UART1_DTR GPIO_GPIO7
  14. #define GPIO_UART1_CTS GPIO_GPIO8
  15. #define GPIO_UART1_DCD GPIO_GPIO23
  16. #define GPIO_UART1_DSR GPIO_GPIO6
  17. #define GPIO_UART3_RTS GPIO_GPIO12
  18. #define GPIO_UART3_DTR GPIO_GPIO16
  19. #define GPIO_UART3_CTS GPIO_GPIO13
  20. #define GPIO_UART3_DCD GPIO_GPIO18
  21. #define GPIO_UART3_DSR GPIO_GPIO17
  22. #define GPIO_POWER_BUTTON GPIO_GPIO0
  23. #define GPIO_UCB1300_IRQ GPIO_GPIO22 /* UCB GPIO and touchscreen */
  24. #define IRQ_UART1_CTS IRQ_GPIO15
  25. #define IRQ_UART1_DCD GPIO_GPIO23
  26. #define IRQ_UART1_DSR GPIO_GPIO6
  27. #define IRQ_UART3_CTS GPIO_GPIO13
  28. #define IRQ_UART3_DCD GPIO_GPIO18
  29. #define IRQ_UART3_DSR GPIO_GPIO17
  30. #define IRQ_GPIO_UCB1300_IRQ IRQ_GPIO22
  31. #define IRQ_GPIO_POWER_BUTTON IRQ_GPIO0
  32. /*--- PCMCIA ---*/
  33. #define GPIO_CF_CD GPIO_GPIO24
  34. #define GPIO_CF_IRQ GPIO_GPIO1
  35. #define IRQ_GPIO_CF_IRQ IRQ_GPIO1
  36. #define IRQ_GPIO_CF_CD IRQ_GPIO24
  37. /*--- SmartCard ---*/
  38. #define GPIO_SMART_CARD GPIO_GPIO10
  39. #define IRQ_GPIO_SMARD_CARD IRQ_GPIO10
  40. // CS3 Latch is write only, a shadow is necessary
  41. #define CS3BUSTYPE unsigned volatile long
  42. #define CS3_BASE 0xf1000000
  43. #define VCC_5V_EN 0x0001 // For 5V PCMCIA
  44. #define VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA
  45. #define EN1 0x0004 // This is only for EPROM's
  46. #define EN0 0x0008 // Both should be enable for 3.3V or 5V
  47. #define DISPLAY_ON 0x0010
  48. #define PCMCIA_BUFF_DIS 0x0020
  49. #define MQ_RESET 0x0040
  50. #define PCMCIA_RESET 0x0080
  51. #define DECT_POWER_ON 0x0100
  52. #define IRDA_SD 0x0200 // Shutdown for powersave
  53. #define RS232_ON 0x0400
  54. #define SD_MEDIAQ 0x0800 // Shutdown for powersave
  55. #define LED2_ON 0x1000
  56. #define IRDA_MODE 0x2000 // Fast/Slow IrDA mode
  57. #define ENABLE_5V 0x4000 // Enable 5V circuit
  58. #define RESET_SIMCARD 0x8000
  59. #define RS232_ENABLE 0x0440
  60. #define PCMCIAMASK 0x402f
  61. struct simpad_battery {
  62. unsigned char ac_status; /* line connected yes/no */
  63. unsigned char status; /* battery loading yes/no */
  64. unsigned char percentage; /* percentage loaded */
  65. unsigned short life; /* life till empty */
  66. };
  67. /* These should match the apm_bios.h definitions */
  68. #define SIMPAD_AC_STATUS_AC_OFFLINE 0x00
  69. #define SIMPAD_AC_STATUS_AC_ONLINE 0x01
  70. #define SIMPAD_AC_STATUS_AC_BACKUP 0x02 /* What does this mean? */
  71. #define SIMPAD_AC_STATUS_AC_UNKNOWN 0xff
  72. /* These bitfields are rarely "or'd" together */
  73. #define SIMPAD_BATT_STATUS_HIGH 0x01
  74. #define SIMPAD_BATT_STATUS_LOW 0x02
  75. #define SIMPAD_BATT_STATUS_CRITICAL 0x04
  76. #define SIMPAD_BATT_STATUS_CHARGING 0x08
  77. #define SIMPAD_BATT_STATUS_CHARGE_MAIN 0x10
  78. #define SIMPAD_BATT_STATUS_DEAD 0x20 /* Battery will not charge */
  79. #define SIMPAD_BATT_NOT_INSTALLED 0x20 /* For expansion pack batteries */
  80. #define SIMPAD_BATT_STATUS_FULL 0x40 /* Battery fully charged (and connected to AC) */
  81. #define SIMPAD_BATT_STATUS_NOBATT 0x80
  82. #define SIMPAD_BATT_STATUS_UNKNOWN 0xff
  83. extern int simpad_get_battery(struct simpad_battery* );
  84. #endif // __ASM_ARCH_SIMPAD_H