pinctrl-nomadik-db8500.c 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. #include <linux/kernel.h>
  2. #include <linux/pinctrl/pinctrl.h>
  3. #include "pinctrl-nomadik.h"
  4. /* All the pins that can be used for GPIO and some other functions */
  5. #define _GPIO(offset) (offset)
  6. #define DB8500_PIN_AJ5 _GPIO(0)
  7. #define DB8500_PIN_AJ3 _GPIO(1)
  8. #define DB8500_PIN_AH4 _GPIO(2)
  9. #define DB8500_PIN_AH3 _GPIO(3)
  10. #define DB8500_PIN_AH6 _GPIO(4)
  11. #define DB8500_PIN_AG6 _GPIO(5)
  12. #define DB8500_PIN_AF6 _GPIO(6)
  13. #define DB8500_PIN_AG5 _GPIO(7)
  14. #define DB8500_PIN_AD5 _GPIO(8)
  15. #define DB8500_PIN_AE4 _GPIO(9)
  16. #define DB8500_PIN_AF5 _GPIO(10)
  17. #define DB8500_PIN_AG4 _GPIO(11)
  18. #define DB8500_PIN_AC4 _GPIO(12)
  19. #define DB8500_PIN_AF3 _GPIO(13)
  20. #define DB8500_PIN_AE3 _GPIO(14)
  21. #define DB8500_PIN_AC3 _GPIO(15)
  22. #define DB8500_PIN_AD3 _GPIO(16)
  23. #define DB8500_PIN_AD4 _GPIO(17)
  24. #define DB8500_PIN_AC2 _GPIO(18)
  25. #define DB8500_PIN_AC1 _GPIO(19)
  26. #define DB8500_PIN_AB4 _GPIO(20)
  27. #define DB8500_PIN_AB3 _GPIO(21)
  28. #define DB8500_PIN_AA3 _GPIO(22)
  29. #define DB8500_PIN_AA4 _GPIO(23)
  30. #define DB8500_PIN_AB2 _GPIO(24)
  31. #define DB8500_PIN_Y4 _GPIO(25)
  32. #define DB8500_PIN_Y2 _GPIO(26)
  33. #define DB8500_PIN_AA2 _GPIO(27)
  34. #define DB8500_PIN_AA1 _GPIO(28)
  35. #define DB8500_PIN_W2 _GPIO(29)
  36. #define DB8500_PIN_W3 _GPIO(30)
  37. #define DB8500_PIN_V3 _GPIO(31)
  38. #define DB8500_PIN_V2 _GPIO(32)
  39. #define DB8500_PIN_AF2 _GPIO(33)
  40. #define DB8500_PIN_AE1 _GPIO(34)
  41. #define DB8500_PIN_AE2 _GPIO(35)
  42. #define DB8500_PIN_AG2 _GPIO(36)
  43. /* Hole */
  44. #define DB8500_PIN_F3 _GPIO(64)
  45. #define DB8500_PIN_F1 _GPIO(65)
  46. #define DB8500_PIN_G3 _GPIO(66)
  47. #define DB8500_PIN_G2 _GPIO(67)
  48. #define DB8500_PIN_E1 _GPIO(68)
  49. #define DB8500_PIN_E2 _GPIO(69)
  50. #define DB8500_PIN_G5 _GPIO(70)
  51. #define DB8500_PIN_G4 _GPIO(71)
  52. #define DB8500_PIN_H4 _GPIO(72)
  53. #define DB8500_PIN_H3 _GPIO(73)
  54. #define DB8500_PIN_J3 _GPIO(74)
  55. #define DB8500_PIN_H2 _GPIO(75)
  56. #define DB8500_PIN_J2 _GPIO(76)
  57. #define DB8500_PIN_H1 _GPIO(77)
  58. #define DB8500_PIN_F4 _GPIO(78)
  59. #define DB8500_PIN_E3 _GPIO(79)
  60. #define DB8500_PIN_E4 _GPIO(80)
  61. #define DB8500_PIN_D2 _GPIO(81)
  62. #define DB8500_PIN_C1 _GPIO(82)
  63. #define DB8500_PIN_D3 _GPIO(83)
  64. #define DB8500_PIN_C2 _GPIO(84)
  65. #define DB8500_PIN_D5 _GPIO(85)
  66. #define DB8500_PIN_C6 _GPIO(86)
  67. #define DB8500_PIN_B3 _GPIO(87)
  68. #define DB8500_PIN_C4 _GPIO(88)
  69. #define DB8500_PIN_E6 _GPIO(89)
  70. #define DB8500_PIN_A3 _GPIO(90)
  71. #define DB8500_PIN_B6 _GPIO(91)
  72. #define DB8500_PIN_D6 _GPIO(92)
  73. #define DB8500_PIN_B7 _GPIO(93)
  74. #define DB8500_PIN_D7 _GPIO(94)
  75. #define DB8500_PIN_E8 _GPIO(95)
  76. #define DB8500_PIN_D8 _GPIO(96)
  77. #define DB8500_PIN_D9 _GPIO(97)
  78. /* Hole */
  79. #define DB8500_PIN_A5 _GPIO(128)
  80. #define DB8500_PIN_B4 _GPIO(129)
  81. #define DB8500_PIN_C8 _GPIO(130)
  82. #define DB8500_PIN_A12 _GPIO(131)
  83. #define DB8500_PIN_C10 _GPIO(132)
  84. #define DB8500_PIN_B10 _GPIO(133)
  85. #define DB8500_PIN_B9 _GPIO(134)
  86. #define DB8500_PIN_A9 _GPIO(135)
  87. #define DB8500_PIN_C7 _GPIO(136)
  88. #define DB8500_PIN_A7 _GPIO(137)
  89. #define DB8500_PIN_C5 _GPIO(138)
  90. #define DB8500_PIN_C9 _GPIO(139)
  91. #define DB8500_PIN_B11 _GPIO(140)
  92. #define DB8500_PIN_C12 _GPIO(141)
  93. #define DB8500_PIN_C11 _GPIO(142)
  94. #define DB8500_PIN_D12 _GPIO(143)
  95. #define DB8500_PIN_B13 _GPIO(144)
  96. #define DB8500_PIN_C13 _GPIO(145)
  97. #define DB8500_PIN_D13 _GPIO(146)
  98. #define DB8500_PIN_C15 _GPIO(147)
  99. #define DB8500_PIN_B16 _GPIO(148)
  100. #define DB8500_PIN_B14 _GPIO(149)
  101. #define DB8500_PIN_C14 _GPIO(150)
  102. #define DB8500_PIN_D17 _GPIO(151)
  103. #define DB8500_PIN_D16 _GPIO(152)
  104. #define DB8500_PIN_B17 _GPIO(153)
  105. #define DB8500_PIN_C16 _GPIO(154)
  106. #define DB8500_PIN_C19 _GPIO(155)
  107. #define DB8500_PIN_C17 _GPIO(156)
  108. #define DB8500_PIN_A18 _GPIO(157)
  109. #define DB8500_PIN_C18 _GPIO(158)
  110. #define DB8500_PIN_B19 _GPIO(159)
  111. #define DB8500_PIN_B20 _GPIO(160)
  112. #define DB8500_PIN_D21 _GPIO(161)
  113. #define DB8500_PIN_D20 _GPIO(162)
  114. #define DB8500_PIN_C20 _GPIO(163)
  115. #define DB8500_PIN_B21 _GPIO(164)
  116. #define DB8500_PIN_C21 _GPIO(165)
  117. #define DB8500_PIN_A22 _GPIO(166)
  118. #define DB8500_PIN_B24 _GPIO(167)
  119. #define DB8500_PIN_C22 _GPIO(168)
  120. #define DB8500_PIN_D22 _GPIO(169)
  121. #define DB8500_PIN_C23 _GPIO(170)
  122. #define DB8500_PIN_D23 _GPIO(171)
  123. /* Hole */
  124. #define DB8500_PIN_AJ27 _GPIO(192)
  125. #define DB8500_PIN_AH27 _GPIO(193)
  126. #define DB8500_PIN_AF27 _GPIO(194)
  127. #define DB8500_PIN_AG28 _GPIO(195)
  128. #define DB8500_PIN_AG26 _GPIO(196)
  129. #define DB8500_PIN_AH24 _GPIO(197)
  130. #define DB8500_PIN_AG25 _GPIO(198)
  131. #define DB8500_PIN_AH23 _GPIO(199)
  132. #define DB8500_PIN_AH26 _GPIO(200)
  133. #define DB8500_PIN_AF24 _GPIO(201)
  134. #define DB8500_PIN_AF25 _GPIO(202)
  135. #define DB8500_PIN_AE23 _GPIO(203)
  136. #define DB8500_PIN_AF23 _GPIO(204)
  137. #define DB8500_PIN_AG23 _GPIO(205)
  138. #define DB8500_PIN_AG24 _GPIO(206)
  139. #define DB8500_PIN_AJ23 _GPIO(207)
  140. #define DB8500_PIN_AH16 _GPIO(208)
  141. #define DB8500_PIN_AG15 _GPIO(209)
  142. #define DB8500_PIN_AJ15 _GPIO(210)
  143. #define DB8500_PIN_AG14 _GPIO(211)
  144. #define DB8500_PIN_AF13 _GPIO(212)
  145. #define DB8500_PIN_AG13 _GPIO(213)
  146. #define DB8500_PIN_AH15 _GPIO(214)
  147. #define DB8500_PIN_AH13 _GPIO(215)
  148. #define DB8500_PIN_AG12 _GPIO(216)
  149. #define DB8500_PIN_AH12 _GPIO(217)
  150. #define DB8500_PIN_AH11 _GPIO(218)
  151. #define DB8500_PIN_AG10 _GPIO(219)
  152. #define DB8500_PIN_AH10 _GPIO(220)
  153. #define DB8500_PIN_AJ11 _GPIO(221)
  154. #define DB8500_PIN_AJ9 _GPIO(222)
  155. #define DB8500_PIN_AH9 _GPIO(223)
  156. #define DB8500_PIN_AG9 _GPIO(224)
  157. #define DB8500_PIN_AG8 _GPIO(225)
  158. #define DB8500_PIN_AF8 _GPIO(226)
  159. #define DB8500_PIN_AH7 _GPIO(227)
  160. #define DB8500_PIN_AJ6 _GPIO(228)
  161. #define DB8500_PIN_AG7 _GPIO(229)
  162. #define DB8500_PIN_AF7 _GPIO(230)
  163. /* Hole */
  164. #define DB8500_PIN_AF28 _GPIO(256)
  165. #define DB8500_PIN_AE29 _GPIO(257)
  166. #define DB8500_PIN_AD29 _GPIO(258)
  167. #define DB8500_PIN_AC29 _GPIO(259)
  168. #define DB8500_PIN_AD28 _GPIO(260)
  169. #define DB8500_PIN_AD26 _GPIO(261)
  170. #define DB8500_PIN_AE26 _GPIO(262)
  171. #define DB8500_PIN_AG29 _GPIO(263)
  172. #define DB8500_PIN_AE27 _GPIO(264)
  173. #define DB8500_PIN_AD27 _GPIO(265)
  174. #define DB8500_PIN_AC28 _GPIO(266)
  175. #define DB8500_PIN_AC27 _GPIO(267)
  176. /*
  177. * The names of the pins are denoted by GPIO number and ball name, even
  178. * though they can be used for other things than GPIO, this is the first
  179. * column in the table of the data sheet and often used on schematics and
  180. * such.
  181. */
  182. static const struct pinctrl_pin_desc nmk_db8500_pins[] = {
  183. PINCTRL_PIN(DB8500_PIN_AJ5, "GPIO0_AJ5"),
  184. PINCTRL_PIN(DB8500_PIN_AJ3, "GPIO1_AJ3"),
  185. PINCTRL_PIN(DB8500_PIN_AH4, "GPIO2_AH4"),
  186. PINCTRL_PIN(DB8500_PIN_AH3, "GPIO3_AH3"),
  187. PINCTRL_PIN(DB8500_PIN_AH6, "GPIO4_AH6"),
  188. PINCTRL_PIN(DB8500_PIN_AG6, "GPIO5_AG6"),
  189. PINCTRL_PIN(DB8500_PIN_AF6, "GPIO6_AF6"),
  190. PINCTRL_PIN(DB8500_PIN_AG5, "GPIO7_AG5"),
  191. PINCTRL_PIN(DB8500_PIN_AD5, "GPIO8_AD5"),
  192. PINCTRL_PIN(DB8500_PIN_AE4, "GPIO9_AE4"),
  193. PINCTRL_PIN(DB8500_PIN_AF5, "GPIO10_AF5"),
  194. PINCTRL_PIN(DB8500_PIN_AG4, "GPIO11_AG4"),
  195. PINCTRL_PIN(DB8500_PIN_AC4, "GPIO12_AC4"),
  196. PINCTRL_PIN(DB8500_PIN_AF3, "GPIO13_AF3"),
  197. PINCTRL_PIN(DB8500_PIN_AE3, "GPIO14_AE3"),
  198. PINCTRL_PIN(DB8500_PIN_AC3, "GPIO15_AC3"),
  199. PINCTRL_PIN(DB8500_PIN_AD3, "GPIO16_AD3"),
  200. PINCTRL_PIN(DB8500_PIN_AD4, "GPIO17_AD4"),
  201. PINCTRL_PIN(DB8500_PIN_AC2, "GPIO18_AC2"),
  202. PINCTRL_PIN(DB8500_PIN_AC1, "GPIO19_AC1"),
  203. PINCTRL_PIN(DB8500_PIN_AB4, "GPIO20_AB4"),
  204. PINCTRL_PIN(DB8500_PIN_AB3, "GPIO21_AB3"),
  205. PINCTRL_PIN(DB8500_PIN_AA3, "GPIO22_AA3"),
  206. PINCTRL_PIN(DB8500_PIN_AA4, "GPIO23_AA4"),
  207. PINCTRL_PIN(DB8500_PIN_AB2, "GPIO24_AB2"),
  208. PINCTRL_PIN(DB8500_PIN_Y4, "GPIO25_Y4"),
  209. PINCTRL_PIN(DB8500_PIN_Y2, "GPIO26_Y2"),
  210. PINCTRL_PIN(DB8500_PIN_AA2, "GPIO27_AA2"),
  211. PINCTRL_PIN(DB8500_PIN_AA1, "GPIO28_AA1"),
  212. PINCTRL_PIN(DB8500_PIN_W2, "GPIO29_W2"),
  213. PINCTRL_PIN(DB8500_PIN_W3, "GPIO30_W3"),
  214. PINCTRL_PIN(DB8500_PIN_V3, "GPIO31_V3"),
  215. PINCTRL_PIN(DB8500_PIN_V2, "GPIO32_V2"),
  216. PINCTRL_PIN(DB8500_PIN_AF2, "GPIO33_AF2"),
  217. PINCTRL_PIN(DB8500_PIN_AE1, "GPIO34_AE1"),
  218. PINCTRL_PIN(DB8500_PIN_AE2, "GPIO35_AE2"),
  219. PINCTRL_PIN(DB8500_PIN_AG2, "GPIO36_AG2"),
  220. /* Hole */
  221. PINCTRL_PIN(DB8500_PIN_F3, "GPIO64_F3"),
  222. PINCTRL_PIN(DB8500_PIN_F1, "GPIO65_F1"),
  223. PINCTRL_PIN(DB8500_PIN_G3, "GPIO66_G3"),
  224. PINCTRL_PIN(DB8500_PIN_G2, "GPIO67_G2"),
  225. PINCTRL_PIN(DB8500_PIN_E1, "GPIO68_E1"),
  226. PINCTRL_PIN(DB8500_PIN_E2, "GPIO69_E2"),
  227. PINCTRL_PIN(DB8500_PIN_G5, "GPIO70_G5"),
  228. PINCTRL_PIN(DB8500_PIN_G4, "GPIO71_G4"),
  229. PINCTRL_PIN(DB8500_PIN_H4, "GPIO72_H4"),
  230. PINCTRL_PIN(DB8500_PIN_H3, "GPIO73_H3"),
  231. PINCTRL_PIN(DB8500_PIN_J3, "GPIO74_J3"),
  232. PINCTRL_PIN(DB8500_PIN_H2, "GPIO75_H2"),
  233. PINCTRL_PIN(DB8500_PIN_J2, "GPIO76_J2"),
  234. PINCTRL_PIN(DB8500_PIN_H1, "GPIO77_H1"),
  235. PINCTRL_PIN(DB8500_PIN_F4, "GPIO78_F4"),
  236. PINCTRL_PIN(DB8500_PIN_E3, "GPIO79_E3"),
  237. PINCTRL_PIN(DB8500_PIN_E4, "GPIO80_E4"),
  238. PINCTRL_PIN(DB8500_PIN_D2, "GPIO81_D2"),
  239. PINCTRL_PIN(DB8500_PIN_C1, "GPIO82_C1"),
  240. PINCTRL_PIN(DB8500_PIN_D3, "GPIO83_D3"),
  241. PINCTRL_PIN(DB8500_PIN_C2, "GPIO84_C2"),
  242. PINCTRL_PIN(DB8500_PIN_D5, "GPIO85_D5"),
  243. PINCTRL_PIN(DB8500_PIN_C6, "GPIO86_C6"),
  244. PINCTRL_PIN(DB8500_PIN_B3, "GPIO87_B3"),
  245. PINCTRL_PIN(DB8500_PIN_C4, "GPIO88_C4"),
  246. PINCTRL_PIN(DB8500_PIN_E6, "GPIO89_E6"),
  247. PINCTRL_PIN(DB8500_PIN_A3, "GPIO90_A3"),
  248. PINCTRL_PIN(DB8500_PIN_B6, "GPIO91_B6"),
  249. PINCTRL_PIN(DB8500_PIN_D6, "GPIO92_D6"),
  250. PINCTRL_PIN(DB8500_PIN_B7, "GPIO93_B7"),
  251. PINCTRL_PIN(DB8500_PIN_D7, "GPIO94_D7"),
  252. PINCTRL_PIN(DB8500_PIN_E8, "GPIO95_E8"),
  253. PINCTRL_PIN(DB8500_PIN_D8, "GPIO96_D8"),
  254. PINCTRL_PIN(DB8500_PIN_D9, "GPIO97_D9"),
  255. /* Hole */
  256. PINCTRL_PIN(DB8500_PIN_A5, "GPIO128_A5"),
  257. PINCTRL_PIN(DB8500_PIN_B4, "GPIO129_B4"),
  258. PINCTRL_PIN(DB8500_PIN_C8, "GPIO130_C8"),
  259. PINCTRL_PIN(DB8500_PIN_A12, "GPIO131_A12"),
  260. PINCTRL_PIN(DB8500_PIN_C10, "GPIO132_C10"),
  261. PINCTRL_PIN(DB8500_PIN_B10, "GPIO133_B10"),
  262. PINCTRL_PIN(DB8500_PIN_B9, "GPIO134_B9"),
  263. PINCTRL_PIN(DB8500_PIN_A9, "GPIO135_A9"),
  264. PINCTRL_PIN(DB8500_PIN_C7, "GPIO136_C7"),
  265. PINCTRL_PIN(DB8500_PIN_A7, "GPIO137_A7"),
  266. PINCTRL_PIN(DB8500_PIN_C5, "GPIO138_C5"),
  267. PINCTRL_PIN(DB8500_PIN_C9, "GPIO139_C9"),
  268. PINCTRL_PIN(DB8500_PIN_B11, "GPIO140_B11"),
  269. PINCTRL_PIN(DB8500_PIN_C12, "GPIO141_C12"),
  270. PINCTRL_PIN(DB8500_PIN_C11, "GPIO142_C11"),
  271. PINCTRL_PIN(DB8500_PIN_D12, "GPIO143_D12"),
  272. PINCTRL_PIN(DB8500_PIN_B13, "GPIO144_B13"),
  273. PINCTRL_PIN(DB8500_PIN_C13, "GPIO145_C13"),
  274. PINCTRL_PIN(DB8500_PIN_D13, "GPIO146_D13"),
  275. PINCTRL_PIN(DB8500_PIN_C15, "GPIO147_C15"),
  276. PINCTRL_PIN(DB8500_PIN_B16, "GPIO148_B16"),
  277. PINCTRL_PIN(DB8500_PIN_B14, "GPIO149_B14"),
  278. PINCTRL_PIN(DB8500_PIN_C14, "GPIO150_C14"),
  279. PINCTRL_PIN(DB8500_PIN_D17, "GPIO151_D17"),
  280. PINCTRL_PIN(DB8500_PIN_D16, "GPIO152_D16"),
  281. PINCTRL_PIN(DB8500_PIN_B17, "GPIO153_B17"),
  282. PINCTRL_PIN(DB8500_PIN_C16, "GPIO154_C16"),
  283. PINCTRL_PIN(DB8500_PIN_C19, "GPIO155_C19"),
  284. PINCTRL_PIN(DB8500_PIN_C17, "GPIO156_C17"),
  285. PINCTRL_PIN(DB8500_PIN_A18, "GPIO157_A18"),
  286. PINCTRL_PIN(DB8500_PIN_C18, "GPIO158_C18"),
  287. PINCTRL_PIN(DB8500_PIN_B19, "GPIO159_B19"),
  288. PINCTRL_PIN(DB8500_PIN_B20, "GPIO160_B20"),
  289. PINCTRL_PIN(DB8500_PIN_D21, "GPIO161_D21"),
  290. PINCTRL_PIN(DB8500_PIN_D20, "GPIO162_D20"),
  291. PINCTRL_PIN(DB8500_PIN_C20, "GPIO163_C20"),
  292. PINCTRL_PIN(DB8500_PIN_B21, "GPIO164_B21"),
  293. PINCTRL_PIN(DB8500_PIN_C21, "GPIO165_C21"),
  294. PINCTRL_PIN(DB8500_PIN_A22, "GPIO166_A22"),
  295. PINCTRL_PIN(DB8500_PIN_B24, "GPIO167_B24"),
  296. PINCTRL_PIN(DB8500_PIN_C22, "GPIO168_C22"),
  297. PINCTRL_PIN(DB8500_PIN_D22, "GPIO169_D22"),
  298. PINCTRL_PIN(DB8500_PIN_C23, "GPIO170_C23"),
  299. PINCTRL_PIN(DB8500_PIN_D23, "GPIO171_D23"),
  300. /* Hole */
  301. PINCTRL_PIN(DB8500_PIN_AJ27, "GPIO192_AJ27"),
  302. PINCTRL_PIN(DB8500_PIN_AH27, "GPIO193_AH27"),
  303. PINCTRL_PIN(DB8500_PIN_AF27, "GPIO194_AF27"),
  304. PINCTRL_PIN(DB8500_PIN_AG28, "GPIO195_AG28"),
  305. PINCTRL_PIN(DB8500_PIN_AG26, "GPIO196_AG26"),
  306. PINCTRL_PIN(DB8500_PIN_AH24, "GPIO197_AH24"),
  307. PINCTRL_PIN(DB8500_PIN_AG25, "GPIO198_AG25"),
  308. PINCTRL_PIN(DB8500_PIN_AH23, "GPIO199_AH23"),
  309. PINCTRL_PIN(DB8500_PIN_AH26, "GPIO200_AH26"),
  310. PINCTRL_PIN(DB8500_PIN_AF24, "GPIO201_AF24"),
  311. PINCTRL_PIN(DB8500_PIN_AF25, "GPIO202_AF25"),
  312. PINCTRL_PIN(DB8500_PIN_AE23, "GPIO203_AE23"),
  313. PINCTRL_PIN(DB8500_PIN_AF23, "GPIO204_AF23"),
  314. PINCTRL_PIN(DB8500_PIN_AG23, "GPIO205_AG23"),
  315. PINCTRL_PIN(DB8500_PIN_AG24, "GPIO206_AG24"),
  316. PINCTRL_PIN(DB8500_PIN_AJ23, "GPIO207_AJ23"),
  317. PINCTRL_PIN(DB8500_PIN_AH16, "GPIO208_AH16"),
  318. PINCTRL_PIN(DB8500_PIN_AG15, "GPIO209_AG15"),
  319. PINCTRL_PIN(DB8500_PIN_AJ15, "GPIO210_AJ15"),
  320. PINCTRL_PIN(DB8500_PIN_AG14, "GPIO211_AG14"),
  321. PINCTRL_PIN(DB8500_PIN_AF13, "GPIO212_AF13"),
  322. PINCTRL_PIN(DB8500_PIN_AG13, "GPIO213_AG13"),
  323. PINCTRL_PIN(DB8500_PIN_AH15, "GPIO214_AH15"),
  324. PINCTRL_PIN(DB8500_PIN_AH13, "GPIO215_AH13"),
  325. PINCTRL_PIN(DB8500_PIN_AG12, "GPIO216_AG12"),
  326. PINCTRL_PIN(DB8500_PIN_AH12, "GPIO217_AH12"),
  327. PINCTRL_PIN(DB8500_PIN_AH11, "GPIO218_AH11"),
  328. PINCTRL_PIN(DB8500_PIN_AG10, "GPIO219_AG10"),
  329. PINCTRL_PIN(DB8500_PIN_AH10, "GPIO220_AH10"),
  330. PINCTRL_PIN(DB8500_PIN_AJ11, "GPIO221_AJ11"),
  331. PINCTRL_PIN(DB8500_PIN_AJ9, "GPIO222_AJ9"),
  332. PINCTRL_PIN(DB8500_PIN_AH9, "GPIO223_AH9"),
  333. PINCTRL_PIN(DB8500_PIN_AG9, "GPIO224_AG9"),
  334. PINCTRL_PIN(DB8500_PIN_AG8, "GPIO225_AG8"),
  335. PINCTRL_PIN(DB8500_PIN_AF8, "GPIO226_AF8"),
  336. PINCTRL_PIN(DB8500_PIN_AH7, "GPIO227_AH7"),
  337. PINCTRL_PIN(DB8500_PIN_AJ6, "GPIO228_AJ6"),
  338. PINCTRL_PIN(DB8500_PIN_AG7, "GPIO229_AG7"),
  339. PINCTRL_PIN(DB8500_PIN_AF7, "GPIO230_AF7"),
  340. /* Hole */
  341. PINCTRL_PIN(DB8500_PIN_AF28, "GPIO256_AF28"),
  342. PINCTRL_PIN(DB8500_PIN_AE29, "GPIO257_AE29"),
  343. PINCTRL_PIN(DB8500_PIN_AD29, "GPIO258_AD29"),
  344. PINCTRL_PIN(DB8500_PIN_AC29, "GPIO259_AC29"),
  345. PINCTRL_PIN(DB8500_PIN_AD28, "GPIO260_AD28"),
  346. PINCTRL_PIN(DB8500_PIN_AD26, "GPIO261_AD26"),
  347. PINCTRL_PIN(DB8500_PIN_AE26, "GPIO262_AE26"),
  348. PINCTRL_PIN(DB8500_PIN_AG29, "GPIO263_AG29"),
  349. PINCTRL_PIN(DB8500_PIN_AE27, "GPIO264_AE27"),
  350. PINCTRL_PIN(DB8500_PIN_AD27, "GPIO265_AD27"),
  351. PINCTRL_PIN(DB8500_PIN_AC28, "GPIO266_AC28"),
  352. PINCTRL_PIN(DB8500_PIN_AC27, "GPIO267_AC27"),
  353. };
  354. #define DB8500_GPIO_RANGE(a, b, c) { .name = "DB8500", .id = a, .base = b, \
  355. .pin_base = b, .npins = c }
  356. /*
  357. * This matches the 32-pin gpio chips registered by the GPIO portion. This
  358. * cannot be const since we assign the struct gpio_chip * pointer at runtime.
  359. */
  360. static struct pinctrl_gpio_range nmk_db8500_ranges[] = {
  361. DB8500_GPIO_RANGE(0, 0, 32),
  362. DB8500_GPIO_RANGE(1, 32, 5),
  363. DB8500_GPIO_RANGE(2, 64, 32),
  364. DB8500_GPIO_RANGE(3, 96, 2),
  365. DB8500_GPIO_RANGE(4, 128, 32),
  366. DB8500_GPIO_RANGE(5, 160, 12),
  367. DB8500_GPIO_RANGE(6, 192, 32),
  368. DB8500_GPIO_RANGE(7, 224, 7),
  369. DB8500_GPIO_RANGE(8, 256, 12),
  370. };
  371. /*
  372. * Read the pin group names like this:
  373. * u0_a_1 = first groups of pins for uart0 on alt function a
  374. * i2c2_b_2 = second group of pins for i2c2 on alt function b
  375. *
  376. * The groups are arranged as sets per altfunction column, so we can
  377. * mux in one group at a time by selecting the same altfunction for them
  378. * all. When functions require pins on different altfunctions, you need
  379. * to combine several groups.
  380. */
  381. /* Altfunction A column */
  382. static const unsigned u0_a_1_pins[] = { DB8500_PIN_AJ5, DB8500_PIN_AJ3,
  383. DB8500_PIN_AH4, DB8500_PIN_AH3 };
  384. static const unsigned u1rxtx_a_1_pins[] = { DB8500_PIN_AH6, DB8500_PIN_AG6 };
  385. static const unsigned u1ctsrts_a_1_pins[] = { DB8500_PIN_AF6, DB8500_PIN_AG5 };
  386. /* Image processor I2C line, this is driven by image processor firmware */
  387. static const unsigned ipi2c_a_1_pins[] = { DB8500_PIN_AD5, DB8500_PIN_AE4 };
  388. static const unsigned ipi2c_a_2_pins[] = { DB8500_PIN_AF5, DB8500_PIN_AG4 };
  389. /* MSP0 can only be on these pins, but TXD and RXD can be flipped */
  390. static const unsigned msp0txrx_a_1_pins[] = { DB8500_PIN_AC4, DB8500_PIN_AC3 };
  391. static const unsigned msp0tfstck_a_1_pins[] = { DB8500_PIN_AF3, DB8500_PIN_AE3 };
  392. static const unsigned msp0rfsrck_a_1_pins[] = { DB8500_PIN_AD3, DB8500_PIN_AD4 };
  393. /* Basic pins of the MMC/SD card 0 interface */
  394. static const unsigned mc0_a_1_pins[] = { DB8500_PIN_AC2, DB8500_PIN_AC1,
  395. DB8500_PIN_AB4, DB8500_PIN_AA3, DB8500_PIN_AA4, DB8500_PIN_AB2,
  396. DB8500_PIN_Y4, DB8500_PIN_Y2, DB8500_PIN_AA2, DB8500_PIN_AA1 };
  397. /* Often only 4 bits are used, then these are not needed (only used for MMC) */
  398. static const unsigned mc0_dat47_a_1_pins[] = { DB8500_PIN_W2, DB8500_PIN_W3,
  399. DB8500_PIN_V3, DB8500_PIN_V2};
  400. static const unsigned mc0dat31dir_a_1_pins[] = { DB8500_PIN_AB3 };
  401. /* MSP1 can only be on these pins, but TXD and RXD can be flipped */
  402. static const unsigned msp1txrx_a_1_pins[] = { DB8500_PIN_AF2, DB8500_PIN_AG2 };
  403. static const unsigned msp1_a_1_pins[] = { DB8500_PIN_AE1, DB8500_PIN_AE2 };
  404. /* LCD interface */
  405. static const unsigned lcdb_a_1_pins[] = { DB8500_PIN_F3, DB8500_PIN_F1,
  406. DB8500_PIN_G3, DB8500_PIN_G2 };
  407. static const unsigned lcdvsi0_a_1_pins[] = { DB8500_PIN_E1 };
  408. static const unsigned lcdvsi1_a_1_pins[] = { DB8500_PIN_E2 };
  409. static const unsigned lcd_d0_d7_a_1_pins[] = {
  410. DB8500_PIN_G5, DB8500_PIN_G4, DB8500_PIN_H4, DB8500_PIN_H3,
  411. DB8500_PIN_J3, DB8500_PIN_H2, DB8500_PIN_J2, DB8500_PIN_H1 };
  412. /* D8 thru D11 often used as TVOUT lines */
  413. static const unsigned lcd_d8_d11_a_1_pins[] = { DB8500_PIN_F4,
  414. DB8500_PIN_E3, DB8500_PIN_E4, DB8500_PIN_D2 };
  415. static const unsigned lcd_d12_d23_a_1_pins[] = {
  416. DB8500_PIN_C1, DB8500_PIN_D3, DB8500_PIN_C2, DB8500_PIN_D5,
  417. DB8500_PIN_C6, DB8500_PIN_B3, DB8500_PIN_C4, DB8500_PIN_E6,
  418. DB8500_PIN_A3, DB8500_PIN_B6, DB8500_PIN_D6, DB8500_PIN_B7 };
  419. static const unsigned kp_a_1_pins[] = { DB8500_PIN_D7, DB8500_PIN_E8,
  420. DB8500_PIN_D8, DB8500_PIN_D9 };
  421. static const unsigned kpskaskb_a_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16 };
  422. static const unsigned kp_a_2_pins[] = {
  423. DB8500_PIN_B17, DB8500_PIN_C16, DB8500_PIN_C19, DB8500_PIN_C17,
  424. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19, DB8500_PIN_B20,
  425. DB8500_PIN_D21, DB8500_PIN_D20, DB8500_PIN_C20, DB8500_PIN_B21,
  426. DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24, DB8500_PIN_C22 };
  427. /* MC2 has 8 data lines and no direction control, so only for (e)MMC */
  428. static const unsigned mc2_a_1_pins[] = { DB8500_PIN_A5, DB8500_PIN_B4,
  429. DB8500_PIN_C8, DB8500_PIN_A12, DB8500_PIN_C10, DB8500_PIN_B10,
  430. DB8500_PIN_B9, DB8500_PIN_A9, DB8500_PIN_C7, DB8500_PIN_A7,
  431. DB8500_PIN_C5 };
  432. static const unsigned ssp1_a_1_pins[] = { DB8500_PIN_C9, DB8500_PIN_B11,
  433. DB8500_PIN_C12, DB8500_PIN_C11 };
  434. static const unsigned ssp0_a_1_pins[] = { DB8500_PIN_D12, DB8500_PIN_B13,
  435. DB8500_PIN_C13, DB8500_PIN_D13 };
  436. static const unsigned i2c0_a_1_pins[] = { DB8500_PIN_C15, DB8500_PIN_B16 };
  437. /*
  438. * Image processor GPIO pins are named "ipgpio" and have their own
  439. * numberspace
  440. */
  441. static const unsigned ipgpio0_a_1_pins[] = { DB8500_PIN_B14 };
  442. static const unsigned ipgpio1_a_1_pins[] = { DB8500_PIN_C14 };
  443. /* Three modem pins named RF_PURn, MODEM_STATE and MODEM_PWREN */
  444. static const unsigned modem_a_1_pins[] = { DB8500_PIN_D22, DB8500_PIN_C23,
  445. DB8500_PIN_D23 };
  446. /*
  447. * This MSP cannot switch RX and TX, SCK in a separate group since this
  448. * seems to be optional.
  449. */
  450. static const unsigned msp2sck_a_1_pins[] = { DB8500_PIN_AJ27 };
  451. static const unsigned msp2_a_1_pins[] = { DB8500_PIN_AH27, DB8500_PIN_AF27,
  452. DB8500_PIN_AG28, DB8500_PIN_AG26 };
  453. static const unsigned mc4_a_1_pins[] = { DB8500_PIN_AH24, DB8500_PIN_AG25,
  454. DB8500_PIN_AH23, DB8500_PIN_AH26, DB8500_PIN_AF24, DB8500_PIN_AF25,
  455. DB8500_PIN_AE23, DB8500_PIN_AF23, DB8500_PIN_AG23, DB8500_PIN_AG24,
  456. DB8500_PIN_AJ23 };
  457. /* MC1 has only 4 data pins, designed for SD or SDIO exclusively */
  458. static const unsigned mc1_a_1_pins[] = { DB8500_PIN_AH16, DB8500_PIN_AG15,
  459. DB8500_PIN_AJ15, DB8500_PIN_AG14, DB8500_PIN_AF13, DB8500_PIN_AG13,
  460. DB8500_PIN_AH15 };
  461. static const unsigned mc1_a_2_pins[] = { DB8500_PIN_AH16, DB8500_PIN_AJ15,
  462. DB8500_PIN_AG14, DB8500_PIN_AF13, DB8500_PIN_AG13, DB8500_PIN_AH15 };
  463. static const unsigned mc1dir_a_1_pins[] = { DB8500_PIN_AH13, DB8500_PIN_AG12,
  464. DB8500_PIN_AH12, DB8500_PIN_AH11 };
  465. static const unsigned hsir_a_1_pins[] = { DB8500_PIN_AG10, DB8500_PIN_AH10,
  466. DB8500_PIN_AJ11 };
  467. static const unsigned hsit_a_1_pins[] = { DB8500_PIN_AJ9, DB8500_PIN_AH9,
  468. DB8500_PIN_AG9, DB8500_PIN_AG8, DB8500_PIN_AF8 };
  469. static const unsigned hsit_a_2_pins[] = { DB8500_PIN_AJ9, DB8500_PIN_AH9,
  470. DB8500_PIN_AG9, DB8500_PIN_AG8 };
  471. static const unsigned clkout1_a_1_pins[] = { DB8500_PIN_AH7 };
  472. static const unsigned clkout1_a_2_pins[] = { DB8500_PIN_AG7 };
  473. static const unsigned clkout2_a_1_pins[] = { DB8500_PIN_AJ6 };
  474. static const unsigned clkout2_a_2_pins[] = { DB8500_PIN_AF7 };
  475. static const unsigned usb_a_1_pins[] = { DB8500_PIN_AF28, DB8500_PIN_AE29,
  476. DB8500_PIN_AD29, DB8500_PIN_AC29, DB8500_PIN_AD28, DB8500_PIN_AD26,
  477. DB8500_PIN_AE26, DB8500_PIN_AG29, DB8500_PIN_AE27, DB8500_PIN_AD27,
  478. DB8500_PIN_AC28, DB8500_PIN_AC27 };
  479. /* Altfunction B column */
  480. static const unsigned trig_b_1_pins[] = { DB8500_PIN_AJ5, DB8500_PIN_AJ3 };
  481. static const unsigned i2c4_b_1_pins[] = { DB8500_PIN_AH6, DB8500_PIN_AG6 };
  482. static const unsigned i2c1_b_1_pins[] = { DB8500_PIN_AF6, DB8500_PIN_AG5 };
  483. static const unsigned i2c2_b_1_pins[] = { DB8500_PIN_AD5, DB8500_PIN_AE4 };
  484. static const unsigned i2c2_b_2_pins[] = { DB8500_PIN_AF5, DB8500_PIN_AG4 };
  485. static const unsigned msp0txrx_b_1_pins[] = { DB8500_PIN_AC4, DB8500_PIN_AC3 };
  486. static const unsigned i2c1_b_2_pins[] = { DB8500_PIN_AD3, DB8500_PIN_AD4 };
  487. /* Just RX and TX for UART2 */
  488. static const unsigned u2rxtx_b_1_pins[] = { DB8500_PIN_AC2, DB8500_PIN_AC1 };
  489. static const unsigned uartmodtx_b_1_pins[] = { DB8500_PIN_AB4 };
  490. static const unsigned msp0sck_b_1_pins[] = { DB8500_PIN_AB3 };
  491. static const unsigned uartmodrx_b_1_pins[] = { DB8500_PIN_AA3 };
  492. static const unsigned stmmod_b_1_pins[] = { DB8500_PIN_AA4, DB8500_PIN_Y4,
  493. DB8500_PIN_Y2, DB8500_PIN_AA2, DB8500_PIN_AA1 };
  494. static const unsigned uartmodrx_b_2_pins[] = { DB8500_PIN_AB2 };
  495. static const unsigned spi3_b_1_pins[] = { DB8500_PIN_W2, DB8500_PIN_W3,
  496. DB8500_PIN_V3, DB8500_PIN_V2 };
  497. static const unsigned msp1txrx_b_1_pins[] = { DB8500_PIN_AF2, DB8500_PIN_AG2 };
  498. static const unsigned kp_b_1_pins[] = { DB8500_PIN_F3, DB8500_PIN_F1,
  499. DB8500_PIN_G3, DB8500_PIN_G2, DB8500_PIN_E1, DB8500_PIN_E2,
  500. DB8500_PIN_G5, DB8500_PIN_G4, DB8500_PIN_H4, DB8500_PIN_H3,
  501. DB8500_PIN_J3, DB8500_PIN_H2, DB8500_PIN_J2, DB8500_PIN_H1,
  502. DB8500_PIN_F4, DB8500_PIN_E3, DB8500_PIN_E4, DB8500_PIN_D2,
  503. DB8500_PIN_C1, DB8500_PIN_D3, DB8500_PIN_C2, DB8500_PIN_D5 };
  504. static const unsigned kp_b_2_pins[] = { DB8500_PIN_F3, DB8500_PIN_F1,
  505. DB8500_PIN_G3, DB8500_PIN_G2, DB8500_PIN_F4, DB8500_PIN_E3};
  506. static const unsigned sm_b_1_pins[] = { DB8500_PIN_C6, DB8500_PIN_B3,
  507. DB8500_PIN_C4, DB8500_PIN_E6, DB8500_PIN_A3, DB8500_PIN_B6,
  508. DB8500_PIN_D6, DB8500_PIN_B7, DB8500_PIN_D7, DB8500_PIN_D8,
  509. DB8500_PIN_D9, DB8500_PIN_A5, DB8500_PIN_B4, DB8500_PIN_C8,
  510. DB8500_PIN_A12, DB8500_PIN_C10, DB8500_PIN_B10, DB8500_PIN_B9,
  511. DB8500_PIN_A9, DB8500_PIN_C7, DB8500_PIN_A7, DB8500_PIN_C5,
  512. DB8500_PIN_C9 };
  513. /* This chip select pin can be "ps0" in alt C so have it separately */
  514. static const unsigned smcs0_b_1_pins[] = { DB8500_PIN_E8 };
  515. /* This chip select pin can be "ps1" in alt C so have it separately */
  516. static const unsigned smcs1_b_1_pins[] = { DB8500_PIN_B14 };
  517. static const unsigned ipgpio7_b_1_pins[] = { DB8500_PIN_B11 };
  518. static const unsigned ipgpio2_b_1_pins[] = { DB8500_PIN_C12 };
  519. static const unsigned ipgpio3_b_1_pins[] = { DB8500_PIN_C11 };
  520. static const unsigned lcdaclk_b_1_pins[] = { DB8500_PIN_C14 };
  521. static const unsigned lcda_b_1_pins[] = { DB8500_PIN_D22,
  522. DB8500_PIN_C23, DB8500_PIN_D23 };
  523. static const unsigned lcd_b_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16,
  524. DB8500_PIN_B17, DB8500_PIN_C16, DB8500_PIN_C19, DB8500_PIN_C17,
  525. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19, DB8500_PIN_B20,
  526. DB8500_PIN_D21, DB8500_PIN_D20, DB8500_PIN_C20, DB8500_PIN_B21,
  527. DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24, DB8500_PIN_C22 };
  528. static const unsigned ddrtrig_b_1_pins[] = { DB8500_PIN_AJ27 };
  529. static const unsigned pwl_b_1_pins[] = { DB8500_PIN_AF25 };
  530. static const unsigned spi1_b_1_pins[] = { DB8500_PIN_AG15, DB8500_PIN_AF13,
  531. DB8500_PIN_AG13, DB8500_PIN_AH15 };
  532. static const unsigned mc3_b_1_pins[] = { DB8500_PIN_AH13, DB8500_PIN_AG12,
  533. DB8500_PIN_AH12, DB8500_PIN_AH11, DB8500_PIN_AG10, DB8500_PIN_AH10,
  534. DB8500_PIN_AJ11, DB8500_PIN_AJ9, DB8500_PIN_AH9, DB8500_PIN_AG9,
  535. DB8500_PIN_AG8 };
  536. static const unsigned pwl_b_2_pins[] = { DB8500_PIN_AF8 };
  537. static const unsigned pwl_b_3_pins[] = { DB8500_PIN_AG7 };
  538. static const unsigned pwl_b_4_pins[] = { DB8500_PIN_AF7 };
  539. /* Altfunction C column */
  540. static const unsigned ipjtag_c_1_pins[] = { DB8500_PIN_AJ5, DB8500_PIN_AJ3,
  541. DB8500_PIN_AH4, DB8500_PIN_AH3, DB8500_PIN_AH6 };
  542. static const unsigned ipgpio6_c_1_pins[] = { DB8500_PIN_AG6 };
  543. static const unsigned ipgpio0_c_1_pins[] = { DB8500_PIN_AF6 };
  544. static const unsigned ipgpio1_c_1_pins[] = { DB8500_PIN_AG5 };
  545. static const unsigned ipgpio3_c_1_pins[] = { DB8500_PIN_AF5 };
  546. static const unsigned ipgpio2_c_1_pins[] = { DB8500_PIN_AG4 };
  547. static const unsigned slim0_c_1_pins[] = { DB8500_PIN_AD3, DB8500_PIN_AD4 };
  548. /* Optional 4-bit Memory Stick interface */
  549. static const unsigned ms_c_1_pins[] = { DB8500_PIN_AC2, DB8500_PIN_AC1,
  550. DB8500_PIN_AB3, DB8500_PIN_AA3, DB8500_PIN_AA4, DB8500_PIN_AB2,
  551. DB8500_PIN_Y4, DB8500_PIN_Y2, DB8500_PIN_AA2, DB8500_PIN_AA1 };
  552. static const unsigned iptrigout_c_1_pins[] = { DB8500_PIN_AB4 };
  553. static const unsigned u2rxtx_c_1_pins[] = { DB8500_PIN_W2, DB8500_PIN_W3 };
  554. static const unsigned u2ctsrts_c_1_pins[] = { DB8500_PIN_V3, DB8500_PIN_V2 };
  555. static const unsigned u0_c_1_pins[] = { DB8500_PIN_AF2, DB8500_PIN_AE1,
  556. DB8500_PIN_AE2, DB8500_PIN_AG2 };
  557. static const unsigned ipgpio4_c_1_pins[] = { DB8500_PIN_F3 };
  558. static const unsigned ipgpio5_c_1_pins[] = { DB8500_PIN_F1 };
  559. static const unsigned ipgpio6_c_2_pins[] = { DB8500_PIN_G3 };
  560. static const unsigned ipgpio7_c_1_pins[] = { DB8500_PIN_G2 };
  561. static const unsigned smcleale_c_1_pins[] = { DB8500_PIN_E1, DB8500_PIN_E2 };
  562. static const unsigned stmape_c_1_pins[] = { DB8500_PIN_G5, DB8500_PIN_G4,
  563. DB8500_PIN_H4, DB8500_PIN_H3, DB8500_PIN_J3 };
  564. static const unsigned u2rxtx_c_2_pins[] = { DB8500_PIN_H2, DB8500_PIN_J2 };
  565. static const unsigned ipgpio2_c_2_pins[] = { DB8500_PIN_F4 };
  566. static const unsigned ipgpio3_c_2_pins[] = { DB8500_PIN_E3 };
  567. static const unsigned ipgpio4_c_2_pins[] = { DB8500_PIN_E4 };
  568. static const unsigned ipgpio5_c_2_pins[] = { DB8500_PIN_D2 };
  569. static const unsigned mc5_c_1_pins[] = { DB8500_PIN_C6, DB8500_PIN_B3,
  570. DB8500_PIN_C4, DB8500_PIN_E6, DB8500_PIN_A3, DB8500_PIN_B6,
  571. DB8500_PIN_D6, DB8500_PIN_B7, DB8500_PIN_D7, DB8500_PIN_D8,
  572. DB8500_PIN_D9 };
  573. static const unsigned mc2rstn_c_1_pins[] = { DB8500_PIN_C8 };
  574. static const unsigned kp_c_1_pins[] = { DB8500_PIN_C9, DB8500_PIN_B11,
  575. DB8500_PIN_C12, DB8500_PIN_C11, DB8500_PIN_D17, DB8500_PIN_D16,
  576. DB8500_PIN_C23, DB8500_PIN_D23 };
  577. static const unsigned smps0_c_1_pins[] = { DB8500_PIN_E8 };
  578. static const unsigned smps1_c_1_pins[] = { DB8500_PIN_B14 };
  579. static const unsigned u2rxtx_c_3_pins[] = { DB8500_PIN_B17, DB8500_PIN_C16 };
  580. static const unsigned stmape_c_2_pins[] = { DB8500_PIN_C19, DB8500_PIN_C17,
  581. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19 };
  582. static const unsigned uartmodrx_c_1_pins[] = { DB8500_PIN_D21 };
  583. static const unsigned uartmodtx_c_1_pins[] = { DB8500_PIN_D20 };
  584. static const unsigned stmmod_c_1_pins[] = { DB8500_PIN_C20, DB8500_PIN_B21,
  585. DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24 };
  586. static const unsigned usbsim_c_1_pins[] = { DB8500_PIN_D22 };
  587. static const unsigned mc4rstn_c_1_pins[] = { DB8500_PIN_AF25 };
  588. static const unsigned clkout1_c_1_pins[] = { DB8500_PIN_AH13 };
  589. static const unsigned clkout2_c_1_pins[] = { DB8500_PIN_AH12 };
  590. static const unsigned i2c3_c_1_pins[] = { DB8500_PIN_AG12, DB8500_PIN_AH11 };
  591. static const unsigned spi0_c_1_pins[] = { DB8500_PIN_AH10, DB8500_PIN_AH9,
  592. DB8500_PIN_AG9, DB8500_PIN_AG8 };
  593. static const unsigned usbsim_c_2_pins[] = { DB8500_PIN_AF8 };
  594. static const unsigned i2c3_c_2_pins[] = { DB8500_PIN_AG7, DB8500_PIN_AF7 };
  595. /* Other C1 column */
  596. static const unsigned u2rx_oc1_1_pins[] = { DB8500_PIN_AB2 };
  597. static const unsigned stmape_oc1_1_pins[] = { DB8500_PIN_AA4, DB8500_PIN_Y4,
  598. DB8500_PIN_Y2, DB8500_PIN_AA2, DB8500_PIN_AA1 };
  599. static const unsigned remap0_oc1_1_pins[] = { DB8500_PIN_E1 };
  600. static const unsigned remap1_oc1_1_pins[] = { DB8500_PIN_E2 };
  601. static const unsigned ptma9_oc1_1_pins[] = { DB8500_PIN_G5, DB8500_PIN_G4,
  602. DB8500_PIN_H4, DB8500_PIN_H3, DB8500_PIN_J3, DB8500_PIN_H2,
  603. DB8500_PIN_J2, DB8500_PIN_H1 };
  604. static const unsigned kp_oc1_1_pins[] = { DB8500_PIN_C6, DB8500_PIN_B3,
  605. DB8500_PIN_C4, DB8500_PIN_E6, DB8500_PIN_A3, DB8500_PIN_B6,
  606. DB8500_PIN_D6, DB8500_PIN_B7 };
  607. static const unsigned rf_oc1_1_pins[] = { DB8500_PIN_D8, DB8500_PIN_D9 };
  608. static const unsigned hxclk_oc1_1_pins[] = { DB8500_PIN_D16 };
  609. static const unsigned uartmodrx_oc1_1_pins[] = { DB8500_PIN_B17 };
  610. static const unsigned uartmodtx_oc1_1_pins[] = { DB8500_PIN_C16 };
  611. static const unsigned stmmod_oc1_1_pins[] = { DB8500_PIN_C19, DB8500_PIN_C17,
  612. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19 };
  613. static const unsigned hxgpio_oc1_1_pins[] = { DB8500_PIN_D21, DB8500_PIN_D20,
  614. DB8500_PIN_C20, DB8500_PIN_B21, DB8500_PIN_C21, DB8500_PIN_A22,
  615. DB8500_PIN_B24, DB8500_PIN_C22 };
  616. static const unsigned rf_oc1_2_pins[] = { DB8500_PIN_C23, DB8500_PIN_D23 };
  617. static const unsigned spi2_oc1_1_pins[] = { DB8500_PIN_AH13, DB8500_PIN_AG12,
  618. DB8500_PIN_AH12, DB8500_PIN_AH11 };
  619. static const unsigned spi2_oc1_2_pins[] = { DB8500_PIN_AH13, DB8500_PIN_AH12,
  620. DB8500_PIN_AH11 };
  621. /* Other C2 column */
  622. static const unsigned sbag_oc2_1_pins[] = { DB8500_PIN_AA4, DB8500_PIN_AB2,
  623. DB8500_PIN_Y4, DB8500_PIN_Y2, DB8500_PIN_AA2, DB8500_PIN_AA1 };
  624. static const unsigned etmr4_oc2_1_pins[] = { DB8500_PIN_G5, DB8500_PIN_G4,
  625. DB8500_PIN_H4, DB8500_PIN_H3, DB8500_PIN_J3, DB8500_PIN_H2,
  626. DB8500_PIN_J2, DB8500_PIN_H1 };
  627. static const unsigned ptma9_oc2_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16,
  628. DB8500_PIN_B17, DB8500_PIN_C16, DB8500_PIN_C19, DB8500_PIN_C17,
  629. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19, DB8500_PIN_B20,
  630. DB8500_PIN_D21, DB8500_PIN_D20, DB8500_PIN_C20, DB8500_PIN_B21,
  631. DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24, DB8500_PIN_C22 };
  632. /* Other C3 column */
  633. static const unsigned stmmod_oc3_1_pins[] = { DB8500_PIN_AB2, DB8500_PIN_W2,
  634. DB8500_PIN_W3, DB8500_PIN_V3, DB8500_PIN_V2 };
  635. static const unsigned stmmod_oc3_2_pins[] = { DB8500_PIN_G5, DB8500_PIN_G4,
  636. DB8500_PIN_H4, DB8500_PIN_H3, DB8500_PIN_J3 };
  637. static const unsigned uartmodrx_oc3_1_pins[] = { DB8500_PIN_H2 };
  638. static const unsigned uartmodtx_oc3_1_pins[] = { DB8500_PIN_J2 };
  639. static const unsigned etmr4_oc3_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16,
  640. DB8500_PIN_B17, DB8500_PIN_C16, DB8500_PIN_C19, DB8500_PIN_C17,
  641. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19, DB8500_PIN_B20,
  642. DB8500_PIN_D21, DB8500_PIN_D20, DB8500_PIN_C20, DB8500_PIN_B21,
  643. DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24, DB8500_PIN_C22 };
  644. /* Other C4 column */
  645. static const unsigned sbag_oc4_1_pins[] = { DB8500_PIN_G5, DB8500_PIN_G4,
  646. DB8500_PIN_H4, DB8500_PIN_H3, DB8500_PIN_J3, DB8500_PIN_H1 };
  647. static const unsigned hwobs_oc4_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16,
  648. DB8500_PIN_B17, DB8500_PIN_C16, DB8500_PIN_C19, DB8500_PIN_C17,
  649. DB8500_PIN_A18, DB8500_PIN_C18, DB8500_PIN_B19, DB8500_PIN_B20,
  650. DB8500_PIN_D21, DB8500_PIN_D20, DB8500_PIN_C20, DB8500_PIN_B21,
  651. DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24, DB8500_PIN_C22 };
  652. #define DB8500_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins, \
  653. .npins = ARRAY_SIZE(a##_pins), .altsetting = b }
  654. static const struct nmk_pingroup nmk_db8500_groups[] = {
  655. /* Altfunction A column */
  656. DB8500_PIN_GROUP(u0_a_1, NMK_GPIO_ALT_A),
  657. DB8500_PIN_GROUP(u1rxtx_a_1, NMK_GPIO_ALT_A),
  658. DB8500_PIN_GROUP(u1ctsrts_a_1, NMK_GPIO_ALT_A),
  659. DB8500_PIN_GROUP(ipi2c_a_1, NMK_GPIO_ALT_A),
  660. DB8500_PIN_GROUP(ipi2c_a_2, NMK_GPIO_ALT_A),
  661. DB8500_PIN_GROUP(msp0txrx_a_1, NMK_GPIO_ALT_A),
  662. DB8500_PIN_GROUP(msp0tfstck_a_1, NMK_GPIO_ALT_A),
  663. DB8500_PIN_GROUP(msp0rfsrck_a_1, NMK_GPIO_ALT_A),
  664. DB8500_PIN_GROUP(mc0_a_1, NMK_GPIO_ALT_A),
  665. DB8500_PIN_GROUP(mc0_dat47_a_1, NMK_GPIO_ALT_A),
  666. DB8500_PIN_GROUP(mc0dat31dir_a_1, NMK_GPIO_ALT_A),
  667. DB8500_PIN_GROUP(msp1txrx_a_1, NMK_GPIO_ALT_A),
  668. DB8500_PIN_GROUP(msp1_a_1, NMK_GPIO_ALT_A),
  669. DB8500_PIN_GROUP(lcdb_a_1, NMK_GPIO_ALT_A),
  670. DB8500_PIN_GROUP(lcdvsi0_a_1, NMK_GPIO_ALT_A),
  671. DB8500_PIN_GROUP(lcdvsi1_a_1, NMK_GPIO_ALT_A),
  672. DB8500_PIN_GROUP(lcd_d0_d7_a_1, NMK_GPIO_ALT_A),
  673. DB8500_PIN_GROUP(lcd_d8_d11_a_1, NMK_GPIO_ALT_A),
  674. DB8500_PIN_GROUP(lcd_d12_d23_a_1, NMK_GPIO_ALT_A),
  675. DB8500_PIN_GROUP(kp_a_1, NMK_GPIO_ALT_A),
  676. DB8500_PIN_GROUP(mc2_a_1, NMK_GPIO_ALT_A),
  677. DB8500_PIN_GROUP(ssp1_a_1, NMK_GPIO_ALT_A),
  678. DB8500_PIN_GROUP(ssp0_a_1, NMK_GPIO_ALT_A),
  679. DB8500_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
  680. DB8500_PIN_GROUP(ipgpio0_a_1, NMK_GPIO_ALT_A),
  681. DB8500_PIN_GROUP(ipgpio1_a_1, NMK_GPIO_ALT_A),
  682. DB8500_PIN_GROUP(kp_a_2, NMK_GPIO_ALT_A),
  683. DB8500_PIN_GROUP(msp2sck_a_1, NMK_GPIO_ALT_A),
  684. DB8500_PIN_GROUP(msp2_a_1, NMK_GPIO_ALT_A),
  685. DB8500_PIN_GROUP(mc4_a_1, NMK_GPIO_ALT_A),
  686. DB8500_PIN_GROUP(mc1_a_1, NMK_GPIO_ALT_A),
  687. DB8500_PIN_GROUP(mc1_a_2, NMK_GPIO_ALT_A),
  688. DB8500_PIN_GROUP(hsir_a_1, NMK_GPIO_ALT_A),
  689. DB8500_PIN_GROUP(hsit_a_1, NMK_GPIO_ALT_A),
  690. DB8500_PIN_GROUP(hsit_a_2, NMK_GPIO_ALT_A),
  691. DB8500_PIN_GROUP(clkout1_a_1, NMK_GPIO_ALT_A),
  692. DB8500_PIN_GROUP(clkout1_a_2, NMK_GPIO_ALT_A),
  693. DB8500_PIN_GROUP(clkout2_a_1, NMK_GPIO_ALT_A),
  694. DB8500_PIN_GROUP(clkout2_a_2, NMK_GPIO_ALT_A),
  695. DB8500_PIN_GROUP(usb_a_1, NMK_GPIO_ALT_A),
  696. /* Altfunction B column */
  697. DB8500_PIN_GROUP(trig_b_1, NMK_GPIO_ALT_B),
  698. DB8500_PIN_GROUP(i2c4_b_1, NMK_GPIO_ALT_B),
  699. DB8500_PIN_GROUP(i2c1_b_1, NMK_GPIO_ALT_B),
  700. DB8500_PIN_GROUP(i2c2_b_1, NMK_GPIO_ALT_B),
  701. DB8500_PIN_GROUP(i2c2_b_2, NMK_GPIO_ALT_B),
  702. DB8500_PIN_GROUP(msp0txrx_b_1, NMK_GPIO_ALT_B),
  703. DB8500_PIN_GROUP(i2c1_b_2, NMK_GPIO_ALT_B),
  704. DB8500_PIN_GROUP(u2rxtx_b_1, NMK_GPIO_ALT_B),
  705. DB8500_PIN_GROUP(uartmodtx_b_1, NMK_GPIO_ALT_B),
  706. DB8500_PIN_GROUP(msp0sck_b_1, NMK_GPIO_ALT_B),
  707. DB8500_PIN_GROUP(uartmodrx_b_1, NMK_GPIO_ALT_B),
  708. DB8500_PIN_GROUP(stmmod_b_1, NMK_GPIO_ALT_B),
  709. DB8500_PIN_GROUP(uartmodrx_b_2, NMK_GPIO_ALT_B),
  710. DB8500_PIN_GROUP(spi3_b_1, NMK_GPIO_ALT_B),
  711. DB8500_PIN_GROUP(msp1txrx_b_1, NMK_GPIO_ALT_B),
  712. DB8500_PIN_GROUP(kp_b_1, NMK_GPIO_ALT_B),
  713. DB8500_PIN_GROUP(kp_b_2, NMK_GPIO_ALT_B),
  714. DB8500_PIN_GROUP(sm_b_1, NMK_GPIO_ALT_B),
  715. DB8500_PIN_GROUP(smcs0_b_1, NMK_GPIO_ALT_B),
  716. DB8500_PIN_GROUP(smcs1_b_1, NMK_GPIO_ALT_B),
  717. DB8500_PIN_GROUP(ipgpio7_b_1, NMK_GPIO_ALT_B),
  718. DB8500_PIN_GROUP(ipgpio2_b_1, NMK_GPIO_ALT_B),
  719. DB8500_PIN_GROUP(ipgpio3_b_1, NMK_GPIO_ALT_B),
  720. DB8500_PIN_GROUP(lcdaclk_b_1, NMK_GPIO_ALT_B),
  721. DB8500_PIN_GROUP(lcda_b_1, NMK_GPIO_ALT_B),
  722. DB8500_PIN_GROUP(lcd_b_1, NMK_GPIO_ALT_B),
  723. DB8500_PIN_GROUP(ddrtrig_b_1, NMK_GPIO_ALT_B),
  724. DB8500_PIN_GROUP(pwl_b_1, NMK_GPIO_ALT_B),
  725. DB8500_PIN_GROUP(spi1_b_1, NMK_GPIO_ALT_B),
  726. DB8500_PIN_GROUP(mc3_b_1, NMK_GPIO_ALT_B),
  727. DB8500_PIN_GROUP(pwl_b_2, NMK_GPIO_ALT_B),
  728. DB8500_PIN_GROUP(pwl_b_3, NMK_GPIO_ALT_B),
  729. DB8500_PIN_GROUP(pwl_b_4, NMK_GPIO_ALT_B),
  730. /* Altfunction C column */
  731. DB8500_PIN_GROUP(ipjtag_c_1, NMK_GPIO_ALT_C),
  732. DB8500_PIN_GROUP(ipgpio6_c_1, NMK_GPIO_ALT_C),
  733. DB8500_PIN_GROUP(ipgpio0_c_1, NMK_GPIO_ALT_C),
  734. DB8500_PIN_GROUP(ipgpio1_c_1, NMK_GPIO_ALT_C),
  735. DB8500_PIN_GROUP(ipgpio3_c_1, NMK_GPIO_ALT_C),
  736. DB8500_PIN_GROUP(ipgpio2_c_1, NMK_GPIO_ALT_C),
  737. DB8500_PIN_GROUP(slim0_c_1, NMK_GPIO_ALT_C),
  738. DB8500_PIN_GROUP(ms_c_1, NMK_GPIO_ALT_C),
  739. DB8500_PIN_GROUP(iptrigout_c_1, NMK_GPIO_ALT_C),
  740. DB8500_PIN_GROUP(u2rxtx_c_1, NMK_GPIO_ALT_C),
  741. DB8500_PIN_GROUP(u2ctsrts_c_1, NMK_GPIO_ALT_C),
  742. DB8500_PIN_GROUP(u0_c_1, NMK_GPIO_ALT_C),
  743. DB8500_PIN_GROUP(ipgpio4_c_1, NMK_GPIO_ALT_C),
  744. DB8500_PIN_GROUP(ipgpio5_c_1, NMK_GPIO_ALT_C),
  745. DB8500_PIN_GROUP(ipgpio6_c_1, NMK_GPIO_ALT_C),
  746. DB8500_PIN_GROUP(ipgpio7_c_1, NMK_GPIO_ALT_C),
  747. DB8500_PIN_GROUP(smcleale_c_1, NMK_GPIO_ALT_C),
  748. DB8500_PIN_GROUP(stmape_c_1, NMK_GPIO_ALT_C),
  749. DB8500_PIN_GROUP(u2rxtx_c_2, NMK_GPIO_ALT_C),
  750. DB8500_PIN_GROUP(ipgpio2_c_2, NMK_GPIO_ALT_C),
  751. DB8500_PIN_GROUP(ipgpio3_c_2, NMK_GPIO_ALT_C),
  752. DB8500_PIN_GROUP(ipgpio4_c_2, NMK_GPIO_ALT_C),
  753. DB8500_PIN_GROUP(ipgpio5_c_2, NMK_GPIO_ALT_C),
  754. DB8500_PIN_GROUP(mc5_c_1, NMK_GPIO_ALT_C),
  755. DB8500_PIN_GROUP(mc2rstn_c_1, NMK_GPIO_ALT_C),
  756. DB8500_PIN_GROUP(kp_c_1, NMK_GPIO_ALT_C),
  757. DB8500_PIN_GROUP(smps0_c_1, NMK_GPIO_ALT_C),
  758. DB8500_PIN_GROUP(smps1_c_1, NMK_GPIO_ALT_C),
  759. DB8500_PIN_GROUP(u2rxtx_c_3, NMK_GPIO_ALT_C),
  760. DB8500_PIN_GROUP(stmape_c_2, NMK_GPIO_ALT_C),
  761. DB8500_PIN_GROUP(uartmodrx_c_1, NMK_GPIO_ALT_C),
  762. DB8500_PIN_GROUP(uartmodtx_c_1, NMK_GPIO_ALT_C),
  763. DB8500_PIN_GROUP(stmmod_c_1, NMK_GPIO_ALT_C),
  764. DB8500_PIN_GROUP(usbsim_c_1, NMK_GPIO_ALT_C),
  765. DB8500_PIN_GROUP(mc4rstn_c_1, NMK_GPIO_ALT_C),
  766. DB8500_PIN_GROUP(clkout1_c_1, NMK_GPIO_ALT_C),
  767. DB8500_PIN_GROUP(clkout2_c_1, NMK_GPIO_ALT_C),
  768. DB8500_PIN_GROUP(i2c3_c_1, NMK_GPIO_ALT_C),
  769. DB8500_PIN_GROUP(spi0_c_1, NMK_GPIO_ALT_C),
  770. DB8500_PIN_GROUP(usbsim_c_2, NMK_GPIO_ALT_C),
  771. DB8500_PIN_GROUP(i2c3_c_2, NMK_GPIO_ALT_C),
  772. /* Other alt C1 column */
  773. DB8500_PIN_GROUP(u2rx_oc1_1, NMK_GPIO_ALT_C1),
  774. DB8500_PIN_GROUP(stmape_oc1_1, NMK_GPIO_ALT_C1),
  775. DB8500_PIN_GROUP(remap0_oc1_1, NMK_GPIO_ALT_C1),
  776. DB8500_PIN_GROUP(remap1_oc1_1, NMK_GPIO_ALT_C1),
  777. DB8500_PIN_GROUP(ptma9_oc1_1, NMK_GPIO_ALT_C1),
  778. DB8500_PIN_GROUP(kp_oc1_1, NMK_GPIO_ALT_C1),
  779. DB8500_PIN_GROUP(rf_oc1_1, NMK_GPIO_ALT_C1),
  780. DB8500_PIN_GROUP(hxclk_oc1_1, NMK_GPIO_ALT_C1),
  781. DB8500_PIN_GROUP(uartmodrx_oc1_1, NMK_GPIO_ALT_C1),
  782. DB8500_PIN_GROUP(uartmodtx_oc1_1, NMK_GPIO_ALT_C1),
  783. DB8500_PIN_GROUP(stmmod_oc1_1, NMK_GPIO_ALT_C1),
  784. DB8500_PIN_GROUP(hxgpio_oc1_1, NMK_GPIO_ALT_C1),
  785. DB8500_PIN_GROUP(rf_oc1_2, NMK_GPIO_ALT_C1),
  786. DB8500_PIN_GROUP(spi2_oc1_1, NMK_GPIO_ALT_C1),
  787. DB8500_PIN_GROUP(spi2_oc1_2, NMK_GPIO_ALT_C1),
  788. /* Other alt C2 column */
  789. DB8500_PIN_GROUP(sbag_oc2_1, NMK_GPIO_ALT_C2),
  790. DB8500_PIN_GROUP(etmr4_oc2_1, NMK_GPIO_ALT_C2),
  791. DB8500_PIN_GROUP(ptma9_oc2_1, NMK_GPIO_ALT_C2),
  792. /* Other alt C3 column */
  793. DB8500_PIN_GROUP(stmmod_oc3_1, NMK_GPIO_ALT_C3),
  794. DB8500_PIN_GROUP(stmmod_oc3_2, NMK_GPIO_ALT_C3),
  795. DB8500_PIN_GROUP(uartmodrx_oc3_1, NMK_GPIO_ALT_C3),
  796. DB8500_PIN_GROUP(uartmodtx_oc3_1, NMK_GPIO_ALT_C3),
  797. DB8500_PIN_GROUP(etmr4_oc3_1, NMK_GPIO_ALT_C3),
  798. /* Other alt C4 column */
  799. DB8500_PIN_GROUP(sbag_oc4_1, NMK_GPIO_ALT_C4),
  800. DB8500_PIN_GROUP(hwobs_oc4_1, NMK_GPIO_ALT_C4),
  801. };
  802. /* We use this macro to define the groups applicable to a function */
  803. #define DB8500_FUNC_GROUPS(a, b...) \
  804. static const char * const a##_groups[] = { b };
  805. DB8500_FUNC_GROUPS(u0, "u0_a_1", "u0_c_1");
  806. DB8500_FUNC_GROUPS(u1, "u1rxtx_a_1", "u1ctsrts_a_1");
  807. /*
  808. * UART2 can be muxed out with just RX/TX in four places, CTS+RTS is however
  809. * only available on two pins in alternative function C
  810. */
  811. DB8500_FUNC_GROUPS(u2, "u2rxtx_b_1", "u2rxtx_c_1", "u2ctsrts_c_1",
  812. "u2rxtx_c_2", "u2rxtx_c_3", "u2rx_oc1_1");
  813. DB8500_FUNC_GROUPS(ipi2c, "ipi2c_a_1", "ipi2c_a_2");
  814. /*
  815. * MSP0 can only be on a certain set of pins, but the TX/RX pins can be
  816. * switched around by selecting the altfunction A or B. The SCK pin is
  817. * only available on the altfunction B.
  818. */
  819. DB8500_FUNC_GROUPS(msp0, "msp0txrx_a_1", "msp0tfstck_a_1", "msp0rfstck_a_1",
  820. "msp0txrx_b_1", "msp0sck_b_1");
  821. DB8500_FUNC_GROUPS(mc0, "mc0_a_1", "mc0_dat47_a_1", "mc0dat31dir_a_1");
  822. /* MSP0 can swap RX/TX like MSP0 but has no SCK pin available */
  823. DB8500_FUNC_GROUPS(msp1, "msp1txrx_a_1", "msp1_a_1", "msp1txrx_b_1");
  824. DB8500_FUNC_GROUPS(lcdb, "lcdb_a_1");
  825. DB8500_FUNC_GROUPS(lcd, "lcdvsi0_a_1", "lcdvsi1_a_1", "lcd_d0_d7_a_1",
  826. "lcd_d8_d11_a_1", "lcd_d12_d23_a_1", "lcd_b_1");
  827. DB8500_FUNC_GROUPS(kp, "kp_a_1", "kp_a_2", "kp_b_1", "kp_b_2", "kp_c_1", "kp_oc1_1");
  828. DB8500_FUNC_GROUPS(mc2, "mc2_a_1", "mc2rstn_c_1");
  829. DB8500_FUNC_GROUPS(ssp1, "ssp1_a_1");
  830. DB8500_FUNC_GROUPS(ssp0, "ssp0_a_1");
  831. DB8500_FUNC_GROUPS(i2c0, "i2c0_a_1");
  832. /* The image processor has 8 GPIO pins that can be muxed out */
  833. DB8500_FUNC_GROUPS(ipgpio, "ipgpio0_a_1", "ipgpio1_a_1", "ipgpio7_b_1",
  834. "ipgpio2_b_1", "ipgpio3_b_1", "ipgpio6_c_1", "ipgpio0_c_1",
  835. "ipgpio1_c_1", "ipgpio3_c_1", "ipgpio2_c_1", "ipgpio4_c_1",
  836. "ipgpio5_c_1", "ipgpio6_c_2", "ipgpio7_c_1", "ipgpio2_c_2",
  837. "ipgpio3_c_2", "ipgpio4_c_2", "ipgpio5_c_2");
  838. /* MSP2 can not invert the RX/TX pins but has the optional SCK pin */
  839. DB8500_FUNC_GROUPS(msp2, "msp2sck_a_1", "msp2_a_1");
  840. DB8500_FUNC_GROUPS(mc4, "mc4_a_1", "mc4rstn_c_1");
  841. DB8500_FUNC_GROUPS(mc1, "mc1_a_1", "mc1_a_2", "mc1dir_a_1");
  842. DB8500_FUNC_GROUPS(hsi, "hsir_a_1", "hsit_a_1", "hsit_a_2");
  843. DB8500_FUNC_GROUPS(clkout, "clkout1_a_1", "clkout1_a_2", "clkout1_c_1",
  844. "clkout2_a_1", "clkout2_a_2", "clkout2_c_1");
  845. DB8500_FUNC_GROUPS(usb, "usb_a_1");
  846. DB8500_FUNC_GROUPS(trig, "trig_b_1");
  847. DB8500_FUNC_GROUPS(i2c4, "i2c4_b_1");
  848. DB8500_FUNC_GROUPS(i2c1, "i2c1_b_1", "i2c1_b_2");
  849. DB8500_FUNC_GROUPS(i2c2, "i2c2_b_1", "i2c2_b_2");
  850. /*
  851. * The modem UART can output its RX and TX pins in some different places,
  852. * so select one of each.
  853. */
  854. DB8500_FUNC_GROUPS(uartmod, "uartmodtx_b_1", "uartmodrx_b_1", "uartmodrx_b_2",
  855. "uartmodrx_c_1", "uartmod_tx_c_1", "uartmodrx_oc1_1",
  856. "uartmodtx_oc1_1", "uartmodrx_oc3_1", "uartmodtx_oc3_1");
  857. DB8500_FUNC_GROUPS(stmmod, "stmmod_b_1", "stmmod_c_1", "stmmod_oc1_1",
  858. "stmmod_oc3_1", "stmmod_oc3_2");
  859. DB8500_FUNC_GROUPS(spi3, "spi3_b_1");
  860. /* Select between CS0 on alt B or PS1 on alt C */
  861. DB8500_FUNC_GROUPS(sm, "sm_b_1", "smcs0_b_1", "smcs1_b_1", "smcleale_c_1",
  862. "smps0_c_1", "smps1_c_1");
  863. DB8500_FUNC_GROUPS(lcda, "lcdaclk_b_1", "lcda_b_1");
  864. DB8500_FUNC_GROUPS(ddrtrig, "ddrtrig_b_1");
  865. DB8500_FUNC_GROUPS(pwl, "pwl_b_1", "pwl_b_2", "pwl_b_3", "pwl_b_4");
  866. DB8500_FUNC_GROUPS(spi1, "spi1_b_1");
  867. DB8500_FUNC_GROUPS(mc3, "mc3_b_1");
  868. DB8500_FUNC_GROUPS(ipjtag, "ipjtag_c_1");
  869. DB8500_FUNC_GROUPS(slim0, "slim0_c_1");
  870. DB8500_FUNC_GROUPS(ms, "ms_c_1");
  871. DB8500_FUNC_GROUPS(iptrigout, "iptrigout_c_1");
  872. DB8500_FUNC_GROUPS(stmape, "stmape_c_1", "stmape_c_2", "stmape_oc1_1");
  873. DB8500_FUNC_GROUPS(mc5, "mc5_c_1");
  874. DB8500_FUNC_GROUPS(usbsim, "usbsim_c_1", "usbsim_c_2");
  875. DB8500_FUNC_GROUPS(i2c3, "i2c3_c_1", "i2c3_c_2");
  876. DB8500_FUNC_GROUPS(spi0, "spi0_c_1");
  877. DB8500_FUNC_GROUPS(spi2, "spi2_oc1_1", "spi2_oc1_2");
  878. DB8500_FUNC_GROUPS(remap, "remap0_oc1_1", "remap1_oc1_1");
  879. DB8500_FUNC_GROUPS(sbag, "sbag_oc2_1", "sbag_oc4_1");
  880. DB8500_FUNC_GROUPS(ptm, "ptma9_oc1_1", "ptma9_oc2_1");
  881. DB8500_FUNC_GROUPS(rf, "rf_oc1_1", "rf_oc1_2");
  882. DB8500_FUNC_GROUPS(hx, "hxclk_oc1_1", "hxgpio_oc1_1");
  883. DB8500_FUNC_GROUPS(etm, "etmr4_oc2_1", "etmr4_oc3_1");
  884. DB8500_FUNC_GROUPS(hwobs, "hwobs_oc4_1");
  885. #define FUNCTION(fname) \
  886. { \
  887. .name = #fname, \
  888. .groups = fname##_groups, \
  889. .ngroups = ARRAY_SIZE(fname##_groups), \
  890. }
  891. static const struct nmk_function nmk_db8500_functions[] = {
  892. FUNCTION(u0),
  893. FUNCTION(u1),
  894. FUNCTION(u2),
  895. FUNCTION(ipi2c),
  896. FUNCTION(msp0),
  897. FUNCTION(mc0),
  898. FUNCTION(msp1),
  899. FUNCTION(lcdb),
  900. FUNCTION(lcd),
  901. FUNCTION(kp),
  902. FUNCTION(mc2),
  903. FUNCTION(ssp1),
  904. FUNCTION(ssp0),
  905. FUNCTION(i2c0),
  906. FUNCTION(ipgpio),
  907. FUNCTION(msp2),
  908. FUNCTION(mc4),
  909. FUNCTION(mc1),
  910. FUNCTION(hsi),
  911. FUNCTION(clkout),
  912. FUNCTION(usb),
  913. FUNCTION(trig),
  914. FUNCTION(i2c4),
  915. FUNCTION(i2c1),
  916. FUNCTION(i2c2),
  917. FUNCTION(uartmod),
  918. FUNCTION(stmmod),
  919. FUNCTION(spi3),
  920. FUNCTION(sm),
  921. FUNCTION(lcda),
  922. FUNCTION(ddrtrig),
  923. FUNCTION(pwl),
  924. FUNCTION(spi1),
  925. FUNCTION(mc3),
  926. FUNCTION(ipjtag),
  927. FUNCTION(slim0),
  928. FUNCTION(ms),
  929. FUNCTION(iptrigout),
  930. FUNCTION(stmape),
  931. FUNCTION(mc5),
  932. FUNCTION(usbsim),
  933. FUNCTION(i2c3),
  934. FUNCTION(spi0),
  935. FUNCTION(spi2),
  936. FUNCTION(remap),
  937. FUNCTION(ptm),
  938. FUNCTION(rf),
  939. FUNCTION(hx),
  940. FUNCTION(etm),
  941. FUNCTION(hwobs),
  942. };
  943. static const struct prcm_gpiocr_altcx_pin_desc db8500_altcx_pins[] = {
  944. PRCM_GPIOCR_ALTCX(23, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_CLK_a */
  945. true, PRCM_IDX_GPIOCR1, 7, /* SBAG_CLK_a */
  946. false, 0, 0,
  947. false, 0, 0
  948. ),
  949. PRCM_GPIOCR_ALTCX(24, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE or U2_RXD ??? */
  950. true, PRCM_IDX_GPIOCR1, 7, /* SBAG_VAL_a */
  951. true, PRCM_IDX_GPIOCR1, 10, /* STM_MOD_CMD0 */
  952. false, 0, 0
  953. ),
  954. PRCM_GPIOCR_ALTCX(25, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[0] */
  955. true, PRCM_IDX_GPIOCR1, 7, /* SBAG_D_a[0] */
  956. false, 0, 0,
  957. false, 0, 0
  958. ),
  959. PRCM_GPIOCR_ALTCX(26, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[1] */
  960. true, PRCM_IDX_GPIOCR1, 7, /* SBAG_D_a[1] */
  961. false, 0, 0,
  962. false, 0, 0
  963. ),
  964. PRCM_GPIOCR_ALTCX(27, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[2] */
  965. true, PRCM_IDX_GPIOCR1, 7, /* SBAG_D_a[2] */
  966. false, 0, 0,
  967. false, 0, 0
  968. ),
  969. PRCM_GPIOCR_ALTCX(28, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[3] */
  970. true, PRCM_IDX_GPIOCR1, 7, /* SBAG_D_a[3] */
  971. false, 0, 0,
  972. false, 0, 0
  973. ),
  974. PRCM_GPIOCR_ALTCX(29, false, 0, 0,
  975. false, 0, 0,
  976. true, PRCM_IDX_GPIOCR1, 10, /* STM_MOD_CMD0 */
  977. false, 0, 0
  978. ),
  979. PRCM_GPIOCR_ALTCX(30, false, 0, 0,
  980. false, 0, 0,
  981. true, PRCM_IDX_GPIOCR1, 10, /* STM_MOD_CMD0 */
  982. false, 0, 0
  983. ),
  984. PRCM_GPIOCR_ALTCX(31, false, 0, 0,
  985. false, 0, 0,
  986. true, PRCM_IDX_GPIOCR1, 10, /* STM_MOD_CMD0 */
  987. false, 0, 0
  988. ),
  989. PRCM_GPIOCR_ALTCX(32, false, 0, 0,
  990. false, 0, 0,
  991. true, PRCM_IDX_GPIOCR1, 10, /* STM_MOD_CMD0 */
  992. false, 0, 0
  993. ),
  994. PRCM_GPIOCR_ALTCX(68, true, PRCM_IDX_GPIOCR1, 18, /* REMAP_SELECT_ON */
  995. false, 0, 0,
  996. false, 0, 0,
  997. false, 0, 0
  998. ),
  999. PRCM_GPIOCR_ALTCX(69, true, PRCM_IDX_GPIOCR1, 18, /* REMAP_SELECT_ON */
  1000. false, 0, 0,
  1001. false, 0, 0,
  1002. false, 0, 0
  1003. ),
  1004. PRCM_GPIOCR_ALTCX(70, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D23 */
  1005. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1006. true, PRCM_IDX_GPIOCR1, 11, /* STM_MOD_CMD1 */
  1007. true, PRCM_IDX_GPIOCR1, 8 /* SBAG_CLK */
  1008. ),
  1009. PRCM_GPIOCR_ALTCX(71, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D22 */
  1010. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1011. true, PRCM_IDX_GPIOCR1, 11, /* STM_MOD_CMD1 */
  1012. true, PRCM_IDX_GPIOCR1, 8 /* SBAG_D3 */
  1013. ),
  1014. PRCM_GPIOCR_ALTCX(72, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D21 */
  1015. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1016. true, PRCM_IDX_GPIOCR1, 11, /* STM_MOD_CMD1 */
  1017. true, PRCM_IDX_GPIOCR1, 8 /* SBAG_D2 */
  1018. ),
  1019. PRCM_GPIOCR_ALTCX(73, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D20 */
  1020. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1021. true, PRCM_IDX_GPIOCR1, 11, /* STM_MOD_CMD1 */
  1022. true, PRCM_IDX_GPIOCR1, 8 /* SBAG_D1 */
  1023. ),
  1024. PRCM_GPIOCR_ALTCX(74, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D19 */
  1025. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1026. true, PRCM_IDX_GPIOCR1, 11, /* STM_MOD_CMD1 */
  1027. true, PRCM_IDX_GPIOCR1, 8 /* SBAG_D0 */
  1028. ),
  1029. PRCM_GPIOCR_ALTCX(75, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D18 */
  1030. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1031. true, PRCM_IDX_GPIOCR1, 0, /* DBG_UARTMOD_CMD0 */
  1032. false, 0, 0
  1033. ),
  1034. PRCM_GPIOCR_ALTCX(76, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D17 */
  1035. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1036. true, PRCM_IDX_GPIOCR1, 0, /* DBG_UARTMOD_CMD0 */
  1037. false, 0, 0
  1038. ),
  1039. PRCM_GPIOCR_ALTCX(77, true, PRCM_IDX_GPIOCR1, 5, /* PTM_A9_D16 */
  1040. true, PRCM_IDX_GPIOCR2, 2, /* DBG_ETM_R4_CMD0 */
  1041. false, 0, 0,
  1042. true, PRCM_IDX_GPIOCR1, 8 /* SBAG_VAL */
  1043. ),
  1044. PRCM_GPIOCR_ALTCX(86, true, PRCM_IDX_GPIOCR1, 12, /* KP_O3 */
  1045. false, 0, 0,
  1046. false, 0, 0,
  1047. false, 0, 0
  1048. ),
  1049. PRCM_GPIOCR_ALTCX(87, true, PRCM_IDX_GPIOCR1, 12, /* KP_O2 */
  1050. false, 0, 0,
  1051. false, 0, 0,
  1052. false, 0, 0
  1053. ),
  1054. PRCM_GPIOCR_ALTCX(88, true, PRCM_IDX_GPIOCR1, 12, /* KP_I3 */
  1055. false, 0, 0,
  1056. false, 0, 0,
  1057. false, 0, 0
  1058. ),
  1059. PRCM_GPIOCR_ALTCX(89, true, PRCM_IDX_GPIOCR1, 12, /* KP_I2 */
  1060. false, 0, 0,
  1061. false, 0, 0,
  1062. false, 0, 0
  1063. ),
  1064. PRCM_GPIOCR_ALTCX(90, true, PRCM_IDX_GPIOCR1, 12, /* KP_O1 */
  1065. false, 0, 0,
  1066. false, 0, 0,
  1067. false, 0, 0
  1068. ),
  1069. PRCM_GPIOCR_ALTCX(91, true, PRCM_IDX_GPIOCR1, 12, /* KP_O0 */
  1070. false, 0, 0,
  1071. false, 0, 0,
  1072. false, 0, 0
  1073. ),
  1074. PRCM_GPIOCR_ALTCX(92, true, PRCM_IDX_GPIOCR1, 12, /* KP_I1 */
  1075. false, 0, 0,
  1076. false, 0, 0,
  1077. false, 0, 0
  1078. ),
  1079. PRCM_GPIOCR_ALTCX(93, true, PRCM_IDX_GPIOCR1, 12, /* KP_I0 */
  1080. false, 0, 0,
  1081. false, 0, 0,
  1082. false, 0, 0
  1083. ),
  1084. PRCM_GPIOCR_ALTCX(96, true, PRCM_IDX_GPIOCR2, 3, /* RF_INT */
  1085. false, 0, 0,
  1086. false, 0, 0,
  1087. false, 0, 0
  1088. ),
  1089. PRCM_GPIOCR_ALTCX(97, true, PRCM_IDX_GPIOCR2, 1, /* RF_CTRL */
  1090. false, 0, 0,
  1091. false, 0, 0,
  1092. false, 0, 0
  1093. ),
  1094. PRCM_GPIOCR_ALTCX(151, false, 0, 0,
  1095. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_CTL */
  1096. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1097. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS17 */
  1098. ),
  1099. PRCM_GPIOCR_ALTCX(152, true, PRCM_IDX_GPIOCR1, 4, /* Hx_CLK */
  1100. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_CLK */
  1101. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1102. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS16 */
  1103. ),
  1104. PRCM_GPIOCR_ALTCX(153, true, PRCM_IDX_GPIOCR1, 1, /* UARTMOD_CMD1 */
  1105. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D15 */
  1106. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1107. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS15 */
  1108. ),
  1109. PRCM_GPIOCR_ALTCX(154, true, PRCM_IDX_GPIOCR1, 1, /* UARTMOD_CMD1 */
  1110. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D14 */
  1111. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1112. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS14 */
  1113. ),
  1114. PRCM_GPIOCR_ALTCX(155, true, PRCM_IDX_GPIOCR1, 13, /* STM_MOD_CMD2 */
  1115. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D13 */
  1116. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1117. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS13 */
  1118. ),
  1119. PRCM_GPIOCR_ALTCX(156, true, PRCM_IDX_GPIOCR1, 13, /* STM_MOD_CMD2 */
  1120. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D12 */
  1121. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1122. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS12 */
  1123. ),
  1124. PRCM_GPIOCR_ALTCX(157, true, PRCM_IDX_GPIOCR1, 13, /* STM_MOD_CMD2 */
  1125. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D11 */
  1126. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1127. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS11 */
  1128. ),
  1129. PRCM_GPIOCR_ALTCX(158, true, PRCM_IDX_GPIOCR1, 13, /* STM_MOD_CMD2 */
  1130. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D10 */
  1131. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1132. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS10 */
  1133. ),
  1134. PRCM_GPIOCR_ALTCX(159, true, PRCM_IDX_GPIOCR1, 13, /* STM_MOD_CMD2 */
  1135. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D9 */
  1136. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1137. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS9 */
  1138. ),
  1139. PRCM_GPIOCR_ALTCX(160, false, 0, 0,
  1140. true, PRCM_IDX_GPIOCR1, 14, /* PTM_A9_D8 */
  1141. true, PRCM_IDX_GPIOCR1, 19, /* DBG_ETM_R4_CMD2 */
  1142. true, PRCM_IDX_GPIOCR1, 25 /* HW_OBS8 */
  1143. ),
  1144. PRCM_GPIOCR_ALTCX(161, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO7 */
  1145. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D7 */
  1146. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1147. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS7 */
  1148. ),
  1149. PRCM_GPIOCR_ALTCX(162, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO6 */
  1150. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D6 */
  1151. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1152. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS6 */
  1153. ),
  1154. PRCM_GPIOCR_ALTCX(163, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO5 */
  1155. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D5 */
  1156. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1157. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS5 */
  1158. ),
  1159. PRCM_GPIOCR_ALTCX(164, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO4 */
  1160. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D4 */
  1161. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1162. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS4 */
  1163. ),
  1164. PRCM_GPIOCR_ALTCX(165, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO3 */
  1165. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D3 */
  1166. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1167. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS3 */
  1168. ),
  1169. PRCM_GPIOCR_ALTCX(166, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO2 */
  1170. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D2 */
  1171. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1172. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS2 */
  1173. ),
  1174. PRCM_GPIOCR_ALTCX(167, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO1 */
  1175. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D1 */
  1176. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1177. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS1 */
  1178. ),
  1179. PRCM_GPIOCR_ALTCX(168, true, PRCM_IDX_GPIOCR1, 4, /* Hx_GPIO0 */
  1180. true, PRCM_IDX_GPIOCR1, 6, /* PTM_A9_D0 */
  1181. true, PRCM_IDX_GPIOCR1, 15, /* DBG_ETM_R4_CMD1*/
  1182. true, PRCM_IDX_GPIOCR1, 24 /* HW_OBS0 */
  1183. ),
  1184. PRCM_GPIOCR_ALTCX(170, true, PRCM_IDX_GPIOCR2, 2, /* RF_INT */
  1185. false, 0, 0,
  1186. false, 0, 0,
  1187. false, 0, 0
  1188. ),
  1189. PRCM_GPIOCR_ALTCX(171, true, PRCM_IDX_GPIOCR2, 0, /* RF_CTRL */
  1190. false, 0, 0,
  1191. false, 0, 0,
  1192. false, 0, 0
  1193. ),
  1194. PRCM_GPIOCR_ALTCX(215, true, PRCM_IDX_GPIOCR1, 23, /* SPI2_TXD */
  1195. false, 0, 0,
  1196. false, 0, 0,
  1197. false, 0, 0
  1198. ),
  1199. PRCM_GPIOCR_ALTCX(216, true, PRCM_IDX_GPIOCR1, 23, /* SPI2_FRM */
  1200. false, 0, 0,
  1201. false, 0, 0,
  1202. false, 0, 0
  1203. ),
  1204. PRCM_GPIOCR_ALTCX(217, true, PRCM_IDX_GPIOCR1, 23, /* SPI2_CLK */
  1205. false, 0, 0,
  1206. false, 0, 0,
  1207. false, 0, 0
  1208. ),
  1209. PRCM_GPIOCR_ALTCX(218, true, PRCM_IDX_GPIOCR1, 23, /* SPI2_RXD */
  1210. false, 0, 0,
  1211. false, 0, 0,
  1212. false, 0, 0
  1213. ),
  1214. };
  1215. static const u16 db8500_prcm_gpiocr_regs[] = {
  1216. [PRCM_IDX_GPIOCR1] = 0x138,
  1217. [PRCM_IDX_GPIOCR2] = 0x574,
  1218. };
  1219. static const struct nmk_pinctrl_soc_data nmk_db8500_soc = {
  1220. .gpio_ranges = nmk_db8500_ranges,
  1221. .gpio_num_ranges = ARRAY_SIZE(nmk_db8500_ranges),
  1222. .pins = nmk_db8500_pins,
  1223. .npins = ARRAY_SIZE(nmk_db8500_pins),
  1224. .functions = nmk_db8500_functions,
  1225. .nfunctions = ARRAY_SIZE(nmk_db8500_functions),
  1226. .groups = nmk_db8500_groups,
  1227. .ngroups = ARRAY_SIZE(nmk_db8500_groups),
  1228. .altcx_pins = db8500_altcx_pins,
  1229. .npins_altcx = ARRAY_SIZE(db8500_altcx_pins),
  1230. .prcm_gpiocr_registers = db8500_prcm_gpiocr_regs,
  1231. };
  1232. void nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc)
  1233. {
  1234. *soc = &nmk_db8500_soc;
  1235. }