spitz.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /*
  2. * Hardware specific definitions for SL-Cx000 series of PDAs
  3. *
  4. * Copyright (c) 2005 Alexander Wykes
  5. * Copyright (c) 2005 Richard Purdie
  6. *
  7. * Based on Sharp's 2.4 kernel patches
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. */
  14. #ifndef __ASM_ARCH_SPITZ_H
  15. #define __ASM_ARCH_SPITZ_H 1
  16. #endif
  17. #include "irqs.h" /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */
  18. #include <linux/fb.h>
  19. /* Spitz/Akita GPIOs */
  20. #define SPITZ_GPIO_KEY_INT (0) /* Key Interrupt */
  21. #define SPITZ_GPIO_RESET (1)
  22. #define SPITZ_GPIO_nSD_DETECT (9)
  23. #define SPITZ_GPIO_TP_INT (11) /* Touch Panel interrupt */
  24. #define SPITZ_GPIO_AK_INT (13) /* Remote Control */
  25. #define SPITZ_GPIO_ADS7846_CS (14)
  26. #define SPITZ_GPIO_SYNC (16)
  27. #define SPITZ_GPIO_MAX1111_CS (20)
  28. #define SPITZ_GPIO_FATAL_BAT (21)
  29. #define SPITZ_GPIO_HSYNC (22)
  30. #define SPITZ_GPIO_nSD_CLK (32)
  31. #define SPITZ_GPIO_USB_DEVICE (35)
  32. #define SPITZ_GPIO_USB_HOST (37)
  33. #define SPITZ_GPIO_USB_CONNECT (41)
  34. #define SPITZ_GPIO_LCDCON_CS (53)
  35. #define SPITZ_GPIO_nPCE (54)
  36. #define SPITZ_GPIO_nSD_WP (81)
  37. #define SPITZ_GPIO_ON_RESET (89)
  38. #define SPITZ_GPIO_BAT_COVER (90)
  39. #define SPITZ_GPIO_CF_CD (94)
  40. #define SPITZ_GPIO_ON_KEY (95)
  41. #define SPITZ_GPIO_SWA (97)
  42. #define SPITZ_GPIO_SWB (96)
  43. #define SPITZ_GPIO_CHRG_FULL (101)
  44. #define SPITZ_GPIO_CO (101)
  45. #define SPITZ_GPIO_CF_IRQ (105)
  46. #define SPITZ_GPIO_AC_IN (115)
  47. #define SPITZ_GPIO_HP_IN (116)
  48. /* Spitz Only GPIOs */
  49. #define SPITZ_GPIO_CF2_IRQ (106) /* CF slot1 Ready */
  50. #define SPITZ_GPIO_CF2_CD (93)
  51. /* Spitz/Akita Keyboard Definitions */
  52. #define SPITZ_KEY_STROBE_NUM (11)
  53. #define SPITZ_KEY_SENSE_NUM (7)
  54. #define SPITZ_GPIO_G0_STROBE_BIT 0x0f800000
  55. #define SPITZ_GPIO_G1_STROBE_BIT 0x00100000
  56. #define SPITZ_GPIO_G2_STROBE_BIT 0x01000000
  57. #define SPITZ_GPIO_G3_STROBE_BIT 0x00041880
  58. #define SPITZ_GPIO_G0_SENSE_BIT 0x00021000
  59. #define SPITZ_GPIO_G1_SENSE_BIT 0x000000d4
  60. #define SPITZ_GPIO_G2_SENSE_BIT 0x08000000
  61. #define SPITZ_GPIO_G3_SENSE_BIT 0x00000000
  62. #define SPITZ_GPIO_KEY_STROBE0 88
  63. #define SPITZ_GPIO_KEY_STROBE1 23
  64. #define SPITZ_GPIO_KEY_STROBE2 24
  65. #define SPITZ_GPIO_KEY_STROBE3 25
  66. #define SPITZ_GPIO_KEY_STROBE4 26
  67. #define SPITZ_GPIO_KEY_STROBE5 27
  68. #define SPITZ_GPIO_KEY_STROBE6 52
  69. #define SPITZ_GPIO_KEY_STROBE7 103
  70. #define SPITZ_GPIO_KEY_STROBE8 107
  71. #define SPITZ_GPIO_KEY_STROBE9 108
  72. #define SPITZ_GPIO_KEY_STROBE10 114
  73. #define SPITZ_GPIO_KEY_SENSE0 12
  74. #define SPITZ_GPIO_KEY_SENSE1 17
  75. #define SPITZ_GPIO_KEY_SENSE2 91
  76. #define SPITZ_GPIO_KEY_SENSE3 34
  77. #define SPITZ_GPIO_KEY_SENSE4 36
  78. #define SPITZ_GPIO_KEY_SENSE5 38
  79. #define SPITZ_GPIO_KEY_SENSE6 39
  80. /* Spitz Scoop Device (No. 1) GPIOs */
  81. /* Suspend States in comments */
  82. #define SPITZ_SCP_LED_GREEN SCOOP_GPCR_PA11 /* Keep */
  83. #define SPITZ_SCP_JK_B SCOOP_GPCR_PA12 /* Keep */
  84. #define SPITZ_SCP_CHRG_ON SCOOP_GPCR_PA13 /* Keep */
  85. #define SPITZ_SCP_MUTE_L SCOOP_GPCR_PA14 /* Low */
  86. #define SPITZ_SCP_MUTE_R SCOOP_GPCR_PA15 /* Low */
  87. #define SPITZ_SCP_CF_POWER SCOOP_GPCR_PA16 /* Keep */
  88. #define SPITZ_SCP_LED_ORANGE SCOOP_GPCR_PA17 /* Keep */
  89. #define SPITZ_SCP_JK_A SCOOP_GPCR_PA18 /* Low */
  90. #define SPITZ_SCP_ADC_TEMP_ON SCOOP_GPCR_PA19 /* Low */
  91. #define SPITZ_SCP_IO_DIR (SPITZ_SCP_JK_B | SPITZ_SCP_CHRG_ON | \
  92. SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | \
  93. SPITZ_SCP_CF_POWER | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON)
  94. #define SPITZ_SCP_IO_OUT (SPITZ_SCP_CHRG_ON | SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R)
  95. #define SPITZ_SCP_SUS_CLR (SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON)
  96. #define SPITZ_SCP_SUS_SET 0
  97. #define SPITZ_SCP_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
  98. #define SPITZ_GPIO_LED_GREEN (SPITZ_SCP_GPIO_BASE + 0)
  99. #define SPITZ_GPIO_JK_B (SPITZ_SCP_GPIO_BASE + 1)
  100. #define SPITZ_GPIO_CHRG_ON (SPITZ_SCP_GPIO_BASE + 2)
  101. #define SPITZ_GPIO_MUTE_L (SPITZ_SCP_GPIO_BASE + 3)
  102. #define SPITZ_GPIO_MUTE_R (SPITZ_SCP_GPIO_BASE + 4)
  103. #define SPITZ_GPIO_CF_POWER (SPITZ_SCP_GPIO_BASE + 5)
  104. #define SPITZ_GPIO_LED_ORANGE (SPITZ_SCP_GPIO_BASE + 6)
  105. #define SPITZ_GPIO_JK_A (SPITZ_SCP_GPIO_BASE + 7)
  106. #define SPITZ_GPIO_ADC_TEMP_ON (SPITZ_SCP_GPIO_BASE + 8)
  107. /* Spitz Scoop Device (No. 2) GPIOs */
  108. /* Suspend States in comments */
  109. #define SPITZ_SCP2_IR_ON SCOOP_GPCR_PA11 /* High */
  110. #define SPITZ_SCP2_AKIN_PULLUP SCOOP_GPCR_PA12 /* Keep */
  111. #define SPITZ_SCP2_RESERVED_1 SCOOP_GPCR_PA13 /* High */
  112. #define SPITZ_SCP2_RESERVED_2 SCOOP_GPCR_PA14 /* Low */
  113. #define SPITZ_SCP2_RESERVED_3 SCOOP_GPCR_PA15 /* Low */
  114. #define SPITZ_SCP2_RESERVED_4 SCOOP_GPCR_PA16 /* Low */
  115. #define SPITZ_SCP2_BACKLIGHT_CONT SCOOP_GPCR_PA17 /* Low */
  116. #define SPITZ_SCP2_BACKLIGHT_ON SCOOP_GPCR_PA18 /* Low */
  117. #define SPITZ_SCP2_MIC_BIAS SCOOP_GPCR_PA19 /* Low */
  118. #define SPITZ_SCP2_IO_DIR (SPITZ_SCP2_AKIN_PULLUP | SPITZ_SCP2_RESERVED_1 | \
  119. SPITZ_SCP2_RESERVED_2 | SPITZ_SCP2_RESERVED_3 | SPITZ_SCP2_RESERVED_4 | \
  120. SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS)
  121. #define SPITZ_SCP2_IO_OUT (SPITZ_SCP2_AKIN_PULLUP | SPITZ_SCP2_RESERVED_1)
  122. #define SPITZ_SCP2_SUS_CLR (SPITZ_SCP2_RESERVED_2 | SPITZ_SCP2_RESERVED_3 | SPITZ_SCP2_RESERVED_4 | \
  123. SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS)
  124. #define SPITZ_SCP2_SUS_SET (SPITZ_SCP2_IR_ON | SPITZ_SCP2_RESERVED_1)
  125. #define SPITZ_SCP2_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 12)
  126. #define SPITZ_GPIO_IR_ON (SPITZ_SCP2_GPIO_BASE + 0)
  127. #define SPITZ_GPIO_AKIN_PULLUP (SPITZ_SCP2_GPIO_BASE + 1)
  128. #define SPITZ_GPIO_RESERVED_1 (SPITZ_SCP2_GPIO_BASE + 2)
  129. #define SPITZ_GPIO_RESERVED_2 (SPITZ_SCP2_GPIO_BASE + 3)
  130. #define SPITZ_GPIO_RESERVED_3 (SPITZ_SCP2_GPIO_BASE + 4)
  131. #define SPITZ_GPIO_RESERVED_4 (SPITZ_SCP2_GPIO_BASE + 5)
  132. #define SPITZ_GPIO_BACKLIGHT_CONT (SPITZ_SCP2_GPIO_BASE + 6)
  133. #define SPITZ_GPIO_BACKLIGHT_ON (SPITZ_SCP2_GPIO_BASE + 7)
  134. #define SPITZ_GPIO_MIC_BIAS (SPITZ_SCP2_GPIO_BASE + 8)
  135. /* Akita IO Expander GPIOs */
  136. #define AKITA_IOEXP_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 12)
  137. #define AKITA_GPIO_RESERVED_0 (AKITA_IOEXP_GPIO_BASE + 0)
  138. #define AKITA_GPIO_RESERVED_1 (AKITA_IOEXP_GPIO_BASE + 1)
  139. #define AKITA_GPIO_MIC_BIAS (AKITA_IOEXP_GPIO_BASE + 2)
  140. #define AKITA_GPIO_BACKLIGHT_ON (AKITA_IOEXP_GPIO_BASE + 3)
  141. #define AKITA_GPIO_BACKLIGHT_CONT (AKITA_IOEXP_GPIO_BASE + 4)
  142. #define AKITA_GPIO_AKIN_PULLUP (AKITA_IOEXP_GPIO_BASE + 5)
  143. #define AKITA_GPIO_IR_ON (AKITA_IOEXP_GPIO_BASE + 6)
  144. #define AKITA_GPIO_RESERVED_7 (AKITA_IOEXP_GPIO_BASE + 7)
  145. /* Spitz IRQ Definitions */
  146. #define SPITZ_IRQ_GPIO_KEY_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_KEY_INT)
  147. #define SPITZ_IRQ_GPIO_AC_IN PXA_GPIO_TO_IRQ(SPITZ_GPIO_AC_IN)
  148. #define SPITZ_IRQ_GPIO_AK_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_AK_INT)
  149. #define SPITZ_IRQ_GPIO_HP_IN PXA_GPIO_TO_IRQ(SPITZ_GPIO_HP_IN)
  150. #define SPITZ_IRQ_GPIO_TP_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_TP_INT)
  151. #define SPITZ_IRQ_GPIO_SYNC PXA_GPIO_TO_IRQ(SPITZ_GPIO_SYNC)
  152. #define SPITZ_IRQ_GPIO_ON_KEY PXA_GPIO_TO_IRQ(SPITZ_GPIO_ON_KEY)
  153. #define SPITZ_IRQ_GPIO_SWA PXA_GPIO_TO_IRQ(SPITZ_GPIO_SWA)
  154. #define SPITZ_IRQ_GPIO_SWB PXA_GPIO_TO_IRQ(SPITZ_GPIO_SWB)
  155. #define SPITZ_IRQ_GPIO_BAT_COVER PXA_GPIO_TO_IRQ(SPITZ_GPIO_BAT_COVER)
  156. #define SPITZ_IRQ_GPIO_FATAL_BAT PXA_GPIO_TO_IRQ(SPITZ_GPIO_FATAL_BAT)
  157. #define SPITZ_IRQ_GPIO_CO PXA_GPIO_TO_IRQ(SPITZ_GPIO_CO)
  158. #define SPITZ_IRQ_GPIO_CF_IRQ PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF_IRQ)
  159. #define SPITZ_IRQ_GPIO_CF_CD PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF_CD)
  160. #define SPITZ_IRQ_GPIO_CF2_IRQ PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF2_IRQ)
  161. #define SPITZ_IRQ_GPIO_nSD_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_nSD_INT)
  162. #define SPITZ_IRQ_GPIO_nSD_DETECT PXA_GPIO_TO_IRQ(SPITZ_GPIO_nSD_DETECT)
  163. /*
  164. * Shared data structures
  165. */
  166. extern struct platform_device spitzssp_device;
  167. extern struct sharpsl_charger_machinfo spitz_pm_machinfo;