magician.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * GPIO and IRQ definitions for HTC Magician PDA phones
  3. *
  4. * Copyright (c) 2007 Philipp Zabel
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. */
  11. #ifndef _MAGICIAN_H_
  12. #define _MAGICIAN_H_
  13. #include <linux/gpio.h>
  14. #include <mach/irqs.h>
  15. /*
  16. * PXA GPIOs
  17. */
  18. #define GPIO0_MAGICIAN_KEY_POWER 0
  19. #define GPIO9_MAGICIAN_UNKNOWN 9
  20. #define GPIO10_MAGICIAN_GSM_IRQ 10
  21. #define GPIO11_MAGICIAN_GSM_OUT1 11
  22. #define GPIO13_MAGICIAN_CPLD_IRQ 13
  23. #define GPIO14_MAGICIAN_TSC2046_CS 14
  24. #define GPIO18_MAGICIAN_UNKNOWN 18
  25. #define GPIO22_MAGICIAN_VIBRA_EN 22
  26. #define GPIO26_MAGICIAN_GSM_POWER 26
  27. #define GPIO27_MAGICIAN_USBC_PUEN 27
  28. #define GPIO30_MAGICIAN_BQ24022_nCHARGE_EN 30
  29. #define GPIO37_MAGICIAN_KEY_HANGUP 37
  30. #define GPIO38_MAGICIAN_KEY_CONTACTS 38
  31. #define GPIO40_MAGICIAN_GSM_OUT2 40
  32. #define GPIO48_MAGICIAN_UNKNOWN 48
  33. #define GPIO56_MAGICIAN_UNKNOWN 56
  34. #define GPIO57_MAGICIAN_CAM_RESET 57
  35. #define GPIO75_MAGICIAN_SAMSUNG_POWER 75
  36. #define GPIO83_MAGICIAN_nIR_EN 83
  37. #define GPIO86_MAGICIAN_GSM_RESET 86
  38. #define GPIO87_MAGICIAN_GSM_SELECT 87
  39. #define GPIO90_MAGICIAN_KEY_CALENDAR 90
  40. #define GPIO91_MAGICIAN_KEY_CAMERA 91
  41. #define GPIO93_MAGICIAN_KEY_UP 93
  42. #define GPIO94_MAGICIAN_KEY_DOWN 94
  43. #define GPIO95_MAGICIAN_KEY_LEFT 95
  44. #define GPIO96_MAGICIAN_KEY_RIGHT 96
  45. #define GPIO97_MAGICIAN_KEY_ENTER 97
  46. #define GPIO98_MAGICIAN_KEY_RECORD 98
  47. #define GPIO99_MAGICIAN_HEADPHONE_IN 99
  48. #define GPIO100_MAGICIAN_KEY_VOL_UP 100
  49. #define GPIO101_MAGICIAN_KEY_VOL_DOWN 101
  50. #define GPIO102_MAGICIAN_KEY_PHONE 102
  51. #define GPIO103_MAGICIAN_LED_KP 103
  52. #define GPIO104_MAGICIAN_LCD_VOFF_EN 104
  53. #define GPIO105_MAGICIAN_LCD_VON_EN 105
  54. #define GPIO106_MAGICIAN_LCD_DCDC_NRESET 106
  55. #define GPIO107_MAGICIAN_DS1WM_IRQ 107
  56. #define GPIO108_MAGICIAN_GSM_READY 108
  57. #define GPIO114_MAGICIAN_UNKNOWN 114
  58. #define GPIO115_MAGICIAN_nPEN_IRQ 115
  59. #define GPIO116_MAGICIAN_nCAM_EN 116
  60. #define GPIO119_MAGICIAN_UNKNOWN 119
  61. #define GPIO120_MAGICIAN_UNKNOWN 120
  62. /*
  63. * CPLD IRQs
  64. */
  65. #define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0)
  66. #define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1)
  67. #define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2)
  68. #define IRQ_MAGICIAN_VBUS (IRQ_BOARD_START + 3)
  69. #define MAGICIAN_NR_IRQS (IRQ_BOARD_START + 8)
  70. /*
  71. * CPLD EGPIOs
  72. */
  73. #define MAGICIAN_EGPIO_BASE PXA_NR_BUILTIN_GPIO
  74. #define MAGICIAN_EGPIO(reg,bit) \
  75. (MAGICIAN_EGPIO_BASE + 8*reg + bit)
  76. /* output */
  77. #define EGPIO_MAGICIAN_TOPPOLY_POWER MAGICIAN_EGPIO(0, 2)
  78. #define EGPIO_MAGICIAN_LED_POWER MAGICIAN_EGPIO(0, 5)
  79. #define EGPIO_MAGICIAN_GSM_RESET MAGICIAN_EGPIO(0, 6)
  80. #define EGPIO_MAGICIAN_LCD_POWER MAGICIAN_EGPIO(0, 7)
  81. #define EGPIO_MAGICIAN_SPK_POWER MAGICIAN_EGPIO(1, 0)
  82. #define EGPIO_MAGICIAN_EP_POWER MAGICIAN_EGPIO(1, 1)
  83. #define EGPIO_MAGICIAN_IN_SEL0 MAGICIAN_EGPIO(1, 2)
  84. #define EGPIO_MAGICIAN_IN_SEL1 MAGICIAN_EGPIO(1, 3)
  85. #define EGPIO_MAGICIAN_MIC_POWER MAGICIAN_EGPIO(1, 4)
  86. #define EGPIO_MAGICIAN_CODEC_RESET MAGICIAN_EGPIO(1, 5)
  87. #define EGPIO_MAGICIAN_CODEC_POWER MAGICIAN_EGPIO(1, 6)
  88. #define EGPIO_MAGICIAN_BL_POWER MAGICIAN_EGPIO(1, 7)
  89. #define EGPIO_MAGICIAN_SD_POWER MAGICIAN_EGPIO(2, 0)
  90. #define EGPIO_MAGICIAN_CARKIT_MIC MAGICIAN_EGPIO(2, 1)
  91. #define EGPIO_MAGICIAN_IR_RX_SHUTDOWN MAGICIAN_EGPIO(2, 2)
  92. #define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3)
  93. #define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4)
  94. #define EGPIO_MAGICIAN_BQ24022_ISET2 MAGICIAN_EGPIO(2, 5)
  95. #define EGPIO_MAGICIAN_NICD_CHARGE MAGICIAN_EGPIO(2, 6)
  96. #define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7)
  97. /* input */
  98. /* USB or AC charger type */
  99. #define EGPIO_MAGICIAN_CABLE_TYPE MAGICIAN_EGPIO(4, 0)
  100. /*
  101. * Vbus is detected
  102. * FIXME behaves like (6,3), may differ for host/device
  103. */
  104. #define EGPIO_MAGICIAN_CABLE_VBUS MAGICIAN_EGPIO(4, 1)
  105. #define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0)
  106. #define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1)
  107. #define EGPIO_MAGICIAN_BOARD_ID2 MAGICIAN_EGPIO(5, 2)
  108. #define EGPIO_MAGICIAN_LCD_SELECT MAGICIAN_EGPIO(5, 3)
  109. #define EGPIO_MAGICIAN_nSD_READONLY MAGICIAN_EGPIO(5, 4)
  110. #define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1)
  111. /* FIXME behaves like (4,1), may differ for host/device */
  112. #define EGPIO_MAGICIAN_CABLE_INSERTED MAGICIAN_EGPIO(6, 3)
  113. #endif /* _MAGICIAN_H_ */