mtgpio.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. * Copyright (c) 2020, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_GPIO_H
  7. #define MT_GPIO_H
  8. #include <mtgpio_common.h>
  9. /* Enumeration for GPIO pin */
  10. typedef enum GPIO_PIN {
  11. GPIO_UNSUPPORTED = -1,
  12. GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5, GPIO6, GPIO7,
  13. GPIO8, GPIO9, GPIO10, GPIO11, GPIO12, GPIO13, GPIO14, GPIO15,
  14. GPIO16, GPIO17, GPIO18, GPIO19, GPIO20, GPIO21, GPIO22, GPIO23,
  15. GPIO24, GPIO25, GPIO26, GPIO27, GPIO28, GPIO29, GPIO30, GPIO31,
  16. GPIO32, GPIO33, GPIO34, GPIO35, GPIO36, GPIO37, GPIO38, GPIO39,
  17. GPIO40, GPIO41, GPIO42, GPIO43, GPIO44, GPIO45, GPIO46, GPIO47,
  18. GPIO48, GPIO49, GPIO50, GPIO51, GPIO52, GPIO53, GPIO54, GPIO55,
  19. GPIO56, GPIO57, GPIO58, GPIO59, GPIO60, GPIO61, GPIO62, GPIO63,
  20. GPIO64, GPIO65, GPIO66, GPIO67, GPIO68, GPIO69, GPIO70, GPIO71,
  21. GPIO72, GPIO73, GPIO74, GPIO75, GPIO76, GPIO77, GPIO78, GPIO79,
  22. GPIO80, GPIO81, GPIO82, GPIO83, GPIO84, GPIO85, GPIO86, GPIO87,
  23. GPIO88, GPIO89, GPIO90, GPIO91, GPIO92, GPIO93, GPIO94, GPIO95,
  24. GPIO96, GPIO97, GPIO98, GPIO99, GPIO100, GPIO101, GPIO102, GPIO103,
  25. GPIO104, GPIO105, GPIO106, GPIO107, GPIO108, GPIO109, GPIO110, GPIO111,
  26. GPIO112, GPIO113, GPIO114, GPIO115, GPIO116, GPIO117, GPIO118, GPIO119,
  27. GPIO120, GPIO121, GPIO122, GPIO123, GPIO124, GPIO125, GPIO126, GPIO127,
  28. GPIO128, GPIO129, GPIO130, GPIO131, GPIO132, GPIO133, GPIO134, GPIO135,
  29. GPIO136, GPIO137, GPIO138, GPIO139, GPIO140, GPIO141, GPIO142, GPIO143,
  30. MT_GPIO_BASE_MAX
  31. } GPIO_PIN;
  32. static const struct mt_pin_info mt_pin_infos[] = {
  33. PIN(0, 1, 0, 0x23, 0x60),
  34. PIN(1, 1, 1, 0x23, 0x60),
  35. PIN(2, 1, 2, 0x23, 0x60),
  36. PIN(3, 1, 3, 0x23, 0x60),
  37. PIN(4, 1, 4, 0x23, 0x60),
  38. PIN(5, 1, 5, 0x23, 0x60),
  39. PIN(6, 0, 6, 0x23, 0x70),
  40. PIN(7, 0, 7, 0x23, 0x70),
  41. PIN(8, 0, 13, 0x23, 0x70),
  42. PIN(9, 0, 8, 0x23, 0x70),
  43. PIN(10, 0, 14, 0x23, 0x70),
  44. PIN(11, 0, 9, 0x23, 0x70),
  45. PIN(12, 0, 15, 0x23, 0x70),
  46. PIN(13, 0, 10, 0x23, 0x70),
  47. PIN(14, 0, 16, 0x23, 0x70),
  48. PIN(15, 0, 11, 0x23, 0x70),
  49. PIN(16, 0, 17, 0x23, 0x70),
  50. PIN(17, 0, 12, 0x23, 0x70),
  51. PIN(18, 0, 5, 0x10, 0x60),
  52. PIN(19, 0, 12, 0x10, 0x60),
  53. PIN(20, 0, 11, 0x10, 0x60),
  54. PIN(21, 0, 10, 0x10, 0x60),
  55. PIN(22, 0, 0, 0x10, 0x60),
  56. PIN(23, 0, 1, 0x10, 0x60),
  57. PIN(24, 0, 2, 0x10, 0x60),
  58. PIN(25, 0, 4, 0x10, 0x60),
  59. PIN(26, 0, 3, 0x10, 0x60),
  60. PIN(27, 0, 6, 0x10, 0x60),
  61. PIN(28, 0, 7, 0x10, 0x60),
  62. PIN(29, 0, 8, 0x10, 0x60),
  63. PIN(30, 0, 9, 0x10, 0x60),
  64. PIN(31, 0, 13, 0x21, 0xa0),
  65. PIN(32, 0, 12, 0x21, 0xa0),
  66. PIN(33, 0, 11, 0x21, 0xa0),
  67. PIN(34, 0, 14, 0x21, 0xa0),
  68. PIN(35, 0, 15, 0x21, 0xa0),
  69. PIN(36, 0, 3, 0x21, 0xb0),
  70. PIN(37, 0, 6, 0x21, 0xb0),
  71. PIN(38, 0, 4, 0x21, 0xb0),
  72. PIN(39, 0, 5, 0x21, 0xb0),
  73. PIN(40, 0, 8, 0x21, 0xb0),
  74. PIN(41, 0, 7, 0x21, 0xb0),
  75. PIN(42, 0, 10, 0x21, 0xb0),
  76. PIN(43, 0, 9, 0x21, 0xb0),
  77. PIN(44, 0, 20, 0x21, 0xb0),
  78. PIN(45, 0, 21, 0x21, 0xb0),
  79. PIN(46, 0, 18, 0x21, 0xa0),
  80. PIN(47, 0, 16, 0x21, 0xa0),
  81. PIN(48, 0, 19, 0x21, 0xa0),
  82. PIN(49, 0, 17, 0x21, 0xa0),
  83. PIN(50, 0, 25, 0x21, 0xa0),
  84. PIN(51, 0, 20, 0x21, 0xa0),
  85. PIN(52, 0, 26, 0x21, 0xa0),
  86. PIN(53, 0, 21, 0x21, 0xa0),
  87. PIN(54, 0, 22, 0x21, 0xa0),
  88. PIN(55, 0, 23, 0x21, 0xa0),
  89. PIN(56, 0, 24, 0x21, 0xa0),
  90. PIN(57, 0, 29, 0x21, 0xa0),
  91. PIN(58, 0, 27, 0x21, 0xa0),
  92. PIN(59, 0, 30, 0x21, 0xa0),
  93. PIN(60, 0, 28, 0x21, 0xa0),
  94. PIN(61, 0, 8, 0x21, 0xa0),
  95. PIN(62, 0, 7, 0x21, 0xa0),
  96. PIN(63, 0, 10, 0x21, 0xa0),
  97. PIN(64, 0, 9, 0x21, 0xa0),
  98. PIN(65, 0, 1, 0x21, 0xb0),
  99. PIN(66, 0, 31, 0x21, 0xa0),
  100. PIN(67, 0, 0, 0x21, 0xb0),
  101. PIN(68, 0, 2, 0x21, 0xb0),
  102. PIN(69, 0, 0, 0x21, 0xa0),
  103. PIN(70, 0, 6, 0x21, 0xa0),
  104. PIN(71, 0, 4, 0x21, 0xa0),
  105. PIN(72, 0, 5, 0x21, 0xa0),
  106. PIN(73, 0, 1, 0x21, 0xa0),
  107. PIN(74, 0, 2, 0x21, 0xa0),
  108. PIN(75, 0, 3, 0x21, 0xa0),
  109. PIN(76, 0, 11, 0x21, 0xb0),
  110. PIN(77, 1, 1, 0x22, 0x60),
  111. PIN(78, 1, 2, 0x22, 0x60),
  112. PIN(79, 1, 9, 0x22, 0x60),
  113. PIN(80, 1, 10, 0x22, 0x60),
  114. PIN(81, 1, 11, 0x22, 0x60),
  115. PIN(82, 1, 12, 0x22, 0x60),
  116. PIN(83, 1, 13, 0x22, 0x60),
  117. PIN(84, 1, 14, 0x22, 0x60),
  118. PIN(85, 1, 15, 0x22, 0x60),
  119. PIN(86, 1, 16, 0x22, 0x60),
  120. PIN(87, 1, 3, 0x22, 0x60),
  121. PIN(88, 1, 4, 0x22, 0x60),
  122. PIN(89, 1, 5, 0x22, 0x60),
  123. PIN(90, 1, 6, 0x22, 0x60),
  124. PIN(91, 1, 7, 0x22, 0x60),
  125. PIN(92, 1, 8, 0x22, 0x60),
  126. PIN(93, 1, 18, 0x22, 0x60),
  127. PIN(94, 1, 19, 0x22, 0x60),
  128. PIN(95, 1, 17, 0x22, 0x60),
  129. PIN(96, 1, 0, 0x22, 0x60),
  130. PIN(97, 0, 20, 0x22, 0x70),
  131. PIN(98, 0, 28, 0x22, 0x70),
  132. PIN(99, 0, 27, 0x22, 0x70),
  133. PIN(100, 0, 30, 0x22, 0x70),
  134. PIN(101, 0, 29, 0x22, 0x70),
  135. PIN(102, 0, 0, 0x22, 0x70),
  136. PIN(103, 0, 31, 0x22, 0x70),
  137. PIN(104, 1, 25, 0x22, 0x60),
  138. PIN(105, 1, 26, 0x22, 0x60),
  139. PIN(106, 1, 23, 0x22, 0x60),
  140. PIN(107, 1, 24, 0x22, 0x60),
  141. PIN(108, 0, 22, 0x22, 0x70),
  142. PIN(109, 0, 21, 0x22, 0x70),
  143. PIN(110, 1, 1, 0x14, 0x20),
  144. PIN(111, 1, 0, 0x14, 0x20),
  145. PIN(112, 1, 2, 0x14, 0x20),
  146. PIN(113, 1, 3, 0x14, 0x20),
  147. PIN(114, 1, 4, 0x14, 0x20),
  148. PIN(115, 1, 5, 0x14, 0x20),
  149. PIN(116, 1, 9, 0x25, 0x50),
  150. PIN(117, 1, 8, 0x25, 0x50),
  151. PIN(118, 1, 7, 0x25, 0x50),
  152. PIN(119, 1, 6, 0x25, 0x50),
  153. PIN(120, 1, 11, 0x25, 0x50),
  154. PIN(121, 1, 1, 0x25, 0x50),
  155. PIN(122, 1, 0, 0x25, 0x50),
  156. PIN(123, 1, 5, 0x25, 0x50),
  157. PIN(124, 1, 4, 0x25, 0x50),
  158. PIN(125, 1, 3, 0x25, 0x50),
  159. PIN(126, 1, 2, 0x25, 0x50),
  160. PIN(127, 1, 10, 0x25, 0x50),
  161. PIN(128, 0, 3, 0x22, 0x70),
  162. PIN(129, 0, 1, 0x22, 0x70),
  163. PIN(130, 0, 4, 0x22, 0x70),
  164. PIN(131, 0, 2, 0x22, 0x70),
  165. PIN(132, 0, 13, 0x25, 0x60),
  166. PIN(133, 0, 12, 0x25, 0x60),
  167. PIN(134, 0, 15, 0x25, 0x60),
  168. PIN(135, 0, 14, 0x25, 0x60),
  169. PIN(136, 0, 13, 0x21, 0xb0),
  170. PIN(137, 0, 12, 0x21, 0xb0),
  171. PIN(138, 0, 15, 0x21, 0xb0),
  172. PIN(139, 0, 14, 0x21, 0xb0),
  173. PIN(140, 0, 17, 0x21, 0xb0),
  174. PIN(141, 0, 16, 0x21, 0xb0),
  175. PIN(142, 0, 19, 0x21, 0xb0),
  176. PIN(143, 0, 18, 0x21, 0xb0),
  177. };
  178. #endif /* MT_GPIO_H */