pinctrl-adi2-bf54x.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /*
  2. * Pinctrl Driver for ADI GPIO2 controller
  3. *
  4. * Copyright 2007-2013 Analog Devices Inc.
  5. *
  6. * Licensed under the GPLv2 or later
  7. */
  8. #include <asm/portmux.h>
  9. #include "pinctrl-adi2.h"
  10. static const struct pinctrl_pin_desc adi_pads[] = {
  11. PINCTRL_PIN(0, "PA0"),
  12. PINCTRL_PIN(1, "PA1"),
  13. PINCTRL_PIN(2, "PA2"),
  14. PINCTRL_PIN(3, "PG3"),
  15. PINCTRL_PIN(4, "PA4"),
  16. PINCTRL_PIN(5, "PA5"),
  17. PINCTRL_PIN(6, "PA6"),
  18. PINCTRL_PIN(7, "PA7"),
  19. PINCTRL_PIN(8, "PA8"),
  20. PINCTRL_PIN(9, "PA9"),
  21. PINCTRL_PIN(10, "PA10"),
  22. PINCTRL_PIN(11, "PA11"),
  23. PINCTRL_PIN(12, "PA12"),
  24. PINCTRL_PIN(13, "PA13"),
  25. PINCTRL_PIN(14, "PA14"),
  26. PINCTRL_PIN(15, "PA15"),
  27. PINCTRL_PIN(16, "PB0"),
  28. PINCTRL_PIN(17, "PB1"),
  29. PINCTRL_PIN(18, "PB2"),
  30. PINCTRL_PIN(19, "PB3"),
  31. PINCTRL_PIN(20, "PB4"),
  32. PINCTRL_PIN(21, "PB5"),
  33. PINCTRL_PIN(22, "PB6"),
  34. PINCTRL_PIN(23, "PB7"),
  35. PINCTRL_PIN(24, "PB8"),
  36. PINCTRL_PIN(25, "PB9"),
  37. PINCTRL_PIN(26, "PB10"),
  38. PINCTRL_PIN(27, "PB11"),
  39. PINCTRL_PIN(28, "PB12"),
  40. PINCTRL_PIN(29, "PB13"),
  41. PINCTRL_PIN(30, "PB14"),
  42. PINCTRL_PIN(32, "PC0"),
  43. PINCTRL_PIN(33, "PC1"),
  44. PINCTRL_PIN(34, "PC2"),
  45. PINCTRL_PIN(35, "PC3"),
  46. PINCTRL_PIN(36, "PC4"),
  47. PINCTRL_PIN(37, "PC5"),
  48. PINCTRL_PIN(38, "PC6"),
  49. PINCTRL_PIN(39, "PC7"),
  50. PINCTRL_PIN(40, "PC8"),
  51. PINCTRL_PIN(41, "PC9"),
  52. PINCTRL_PIN(42, "PC10"),
  53. PINCTRL_PIN(43, "PC11"),
  54. PINCTRL_PIN(44, "PC12"),
  55. PINCTRL_PIN(45, "PC13"),
  56. PINCTRL_PIN(48, "PD0"),
  57. PINCTRL_PIN(49, "PD1"),
  58. PINCTRL_PIN(50, "PD2"),
  59. PINCTRL_PIN(51, "PD3"),
  60. PINCTRL_PIN(52, "PD4"),
  61. PINCTRL_PIN(53, "PD5"),
  62. PINCTRL_PIN(54, "PD6"),
  63. PINCTRL_PIN(55, "PD7"),
  64. PINCTRL_PIN(56, "PD8"),
  65. PINCTRL_PIN(57, "PD9"),
  66. PINCTRL_PIN(58, "PD10"),
  67. PINCTRL_PIN(59, "PD11"),
  68. PINCTRL_PIN(60, "PD12"),
  69. PINCTRL_PIN(61, "PD13"),
  70. PINCTRL_PIN(62, "PD14"),
  71. PINCTRL_PIN(63, "PD15"),
  72. PINCTRL_PIN(64, "PE0"),
  73. PINCTRL_PIN(65, "PE1"),
  74. PINCTRL_PIN(66, "PE2"),
  75. PINCTRL_PIN(67, "PE3"),
  76. PINCTRL_PIN(68, "PE4"),
  77. PINCTRL_PIN(69, "PE5"),
  78. PINCTRL_PIN(70, "PE6"),
  79. PINCTRL_PIN(71, "PE7"),
  80. PINCTRL_PIN(72, "PE8"),
  81. PINCTRL_PIN(73, "PE9"),
  82. PINCTRL_PIN(74, "PE10"),
  83. PINCTRL_PIN(75, "PE11"),
  84. PINCTRL_PIN(76, "PE12"),
  85. PINCTRL_PIN(77, "PE13"),
  86. PINCTRL_PIN(78, "PE14"),
  87. PINCTRL_PIN(79, "PE15"),
  88. PINCTRL_PIN(80, "PF0"),
  89. PINCTRL_PIN(81, "PF1"),
  90. PINCTRL_PIN(82, "PF2"),
  91. PINCTRL_PIN(83, "PF3"),
  92. PINCTRL_PIN(84, "PF4"),
  93. PINCTRL_PIN(85, "PF5"),
  94. PINCTRL_PIN(86, "PF6"),
  95. PINCTRL_PIN(87, "PF7"),
  96. PINCTRL_PIN(88, "PF8"),
  97. PINCTRL_PIN(89, "PF9"),
  98. PINCTRL_PIN(90, "PF10"),
  99. PINCTRL_PIN(91, "PF11"),
  100. PINCTRL_PIN(92, "PF12"),
  101. PINCTRL_PIN(93, "PF13"),
  102. PINCTRL_PIN(94, "PF14"),
  103. PINCTRL_PIN(95, "PF15"),
  104. PINCTRL_PIN(96, "PG0"),
  105. PINCTRL_PIN(97, "PG1"),
  106. PINCTRL_PIN(98, "PG2"),
  107. PINCTRL_PIN(99, "PG3"),
  108. PINCTRL_PIN(100, "PG4"),
  109. PINCTRL_PIN(101, "PG5"),
  110. PINCTRL_PIN(102, "PG6"),
  111. PINCTRL_PIN(103, "PG7"),
  112. PINCTRL_PIN(104, "PG8"),
  113. PINCTRL_PIN(105, "PG9"),
  114. PINCTRL_PIN(106, "PG10"),
  115. PINCTRL_PIN(107, "PG11"),
  116. PINCTRL_PIN(108, "PG12"),
  117. PINCTRL_PIN(109, "PG13"),
  118. PINCTRL_PIN(110, "PG14"),
  119. PINCTRL_PIN(111, "PG15"),
  120. PINCTRL_PIN(112, "PH0"),
  121. PINCTRL_PIN(113, "PH1"),
  122. PINCTRL_PIN(114, "PH2"),
  123. PINCTRL_PIN(115, "PH3"),
  124. PINCTRL_PIN(116, "PH4"),
  125. PINCTRL_PIN(117, "PH5"),
  126. PINCTRL_PIN(118, "PH6"),
  127. PINCTRL_PIN(119, "PH7"),
  128. PINCTRL_PIN(120, "PH8"),
  129. PINCTRL_PIN(121, "PH9"),
  130. PINCTRL_PIN(122, "PH10"),
  131. PINCTRL_PIN(123, "PH11"),
  132. PINCTRL_PIN(124, "PH12"),
  133. PINCTRL_PIN(125, "PH13"),
  134. PINCTRL_PIN(128, "PI0"),
  135. PINCTRL_PIN(129, "PI1"),
  136. PINCTRL_PIN(130, "PI2"),
  137. PINCTRL_PIN(131, "PI3"),
  138. PINCTRL_PIN(132, "PI4"),
  139. PINCTRL_PIN(133, "PI5"),
  140. PINCTRL_PIN(134, "PI6"),
  141. PINCTRL_PIN(135, "PI7"),
  142. PINCTRL_PIN(136, "PI8"),
  143. PINCTRL_PIN(137, "PI9"),
  144. PINCTRL_PIN(138, "PI10"),
  145. PINCTRL_PIN(139, "PI11"),
  146. PINCTRL_PIN(140, "PI12"),
  147. PINCTRL_PIN(141, "PI13"),
  148. PINCTRL_PIN(142, "PI14"),
  149. PINCTRL_PIN(143, "PI15"),
  150. PINCTRL_PIN(144, "PJ0"),
  151. PINCTRL_PIN(145, "PJ1"),
  152. PINCTRL_PIN(146, "PJ2"),
  153. PINCTRL_PIN(147, "PJ3"),
  154. PINCTRL_PIN(148, "PJ4"),
  155. PINCTRL_PIN(149, "PJ5"),
  156. PINCTRL_PIN(150, "PJ6"),
  157. PINCTRL_PIN(151, "PJ7"),
  158. PINCTRL_PIN(152, "PJ8"),
  159. PINCTRL_PIN(153, "PJ9"),
  160. PINCTRL_PIN(154, "PJ10"),
  161. PINCTRL_PIN(155, "PJ11"),
  162. PINCTRL_PIN(156, "PJ12"),
  163. PINCTRL_PIN(157, "PJ13"),
  164. };
  165. static const unsigned uart0_pins[] = {
  166. GPIO_PE7, GPIO_PE8,
  167. };
  168. static const unsigned uart1_pins[] = {
  169. GPIO_PH0, GPIO_PH1,
  170. };
  171. static const unsigned uart1_ctsrts_pins[] = {
  172. GPIO_PE9, GPIO_PE10,
  173. };
  174. static const unsigned uart2_pins[] = {
  175. GPIO_PB4, GPIO_PB5,
  176. };
  177. static const unsigned uart3_pins[] = {
  178. GPIO_PB6, GPIO_PB7,
  179. };
  180. static const unsigned uart3_ctsrts_pins[] = {
  181. GPIO_PB2, GPIO_PB3,
  182. };
  183. static const unsigned rsi0_pins[] = {
  184. GPIO_PC8, GPIO_PC9, GPIO_PC10, GPIO_PC11, GPIO_PC12, GPIO_PC13,
  185. };
  186. static const unsigned spi0_pins[] = {
  187. GPIO_PE0, GPIO_PE1, GPIO_PE2,
  188. };
  189. static const unsigned spi1_pins[] = {
  190. GPIO_PG8, GPIO_PG9, GPIO_PG10,
  191. };
  192. static const unsigned twi0_pins[] = {
  193. GPIO_PE14, GPIO_PE15,
  194. };
  195. static const unsigned twi1_pins[] = {
  196. GPIO_PB0, GPIO_PB1,
  197. };
  198. static const unsigned rotary_pins[] = {
  199. GPIO_PH4, GPIO_PH3, GPIO_PH5,
  200. };
  201. static const unsigned can0_pins[] = {
  202. GPIO_PG13, GPIO_PG12,
  203. };
  204. static const unsigned can1_pins[] = {
  205. GPIO_PG14, GPIO_PG15,
  206. };
  207. static const unsigned smc0_pins[] = {
  208. GPIO_PH8, GPIO_PH9, GPIO_PH10, GPIO_PH11, GPIO_PH12, GPIO_PH13,
  209. GPIO_PI0, GPIO_PI1, GPIO_PI2, GPIO_PI3, GPIO_PI4, GPIO_PI5, GPIO_PI6,
  210. GPIO_PI7, GPIO_PI8, GPIO_PI9, GPIO_PI10, GPIO_PI11,
  211. GPIO_PI12, GPIO_PI13, GPIO_PI14, GPIO_PI15,
  212. };
  213. static const unsigned sport0_pins[] = {
  214. GPIO_PC0, GPIO_PC2, GPIO_PC3, GPIO_PC4, GPIO_PC6, GPIO_PC7,
  215. };
  216. static const unsigned sport1_pins[] = {
  217. GPIO_PD0, GPIO_PD2, GPIO_PD3, GPIO_PD4, GPIO_PD6, GPIO_PD7,
  218. };
  219. static const unsigned sport2_pins[] = {
  220. GPIO_PA0, GPIO_PA2, GPIO_PA3, GPIO_PA4, GPIO_PA6, GPIO_PA7,
  221. };
  222. static const unsigned sport3_pins[] = {
  223. GPIO_PA8, GPIO_PA10, GPIO_PA11, GPIO_PA12, GPIO_PA14, GPIO_PA15,
  224. };
  225. static const unsigned ppi0_8b_pins[] = {
  226. GPIO_PF0, GPIO_PF1, GPIO_PF2, GPIO_PF3, GPIO_PF4, GPIO_PF5, GPIO_PF6,
  227. GPIO_PF7, GPIO_PF13, GPIO_PG0, GPIO_PG1, GPIO_PG2,
  228. };
  229. static const unsigned ppi0_16b_pins[] = {
  230. GPIO_PF0, GPIO_PF1, GPIO_PF2, GPIO_PF3, GPIO_PF4, GPIO_PF5, GPIO_PF6,
  231. GPIO_PF7, GPIO_PF9, GPIO_PF10, GPIO_PF11, GPIO_PF12,
  232. GPIO_PF13, GPIO_PF14, GPIO_PF15,
  233. GPIO_PG0, GPIO_PG1, GPIO_PG2,
  234. };
  235. static const unsigned ppi0_24b_pins[] = {
  236. GPIO_PF0, GPIO_PF1, GPIO_PF2, GPIO_PF3, GPIO_PF4, GPIO_PF5, GPIO_PF6,
  237. GPIO_PF7, GPIO_PF8, GPIO_PF9, GPIO_PF10, GPIO_PF11, GPIO_PF12,
  238. GPIO_PF13, GPIO_PF14, GPIO_PF15, GPIO_PD0, GPIO_PD1, GPIO_PD2,
  239. GPIO_PD3, GPIO_PD4, GPIO_PD5, GPIO_PG3, GPIO_PG4,
  240. GPIO_PG0, GPIO_PG1, GPIO_PG2,
  241. };
  242. static const unsigned ppi1_8b_pins[] = {
  243. GPIO_PD0, GPIO_PD1, GPIO_PD2, GPIO_PD3, GPIO_PD4, GPIO_PD5, GPIO_PD6,
  244. GPIO_PD7, GPIO_PE11, GPIO_PE12, GPIO_PE13,
  245. };
  246. static const unsigned ppi1_16b_pins[] = {
  247. GPIO_PD0, GPIO_PD1, GPIO_PD2, GPIO_PD3, GPIO_PD4, GPIO_PD5, GPIO_PD6,
  248. GPIO_PD7, GPIO_PD8, GPIO_PD9, GPIO_PD10, GPIO_PD11, GPIO_PD12,
  249. GPIO_PD13, GPIO_PD14, GPIO_PD15,
  250. GPIO_PE11, GPIO_PE12, GPIO_PE13,
  251. };
  252. static const unsigned ppi2_8b_pins[] = {
  253. GPIO_PD8, GPIO_PD9, GPIO_PD10, GPIO_PD11, GPIO_PD12,
  254. GPIO_PD13, GPIO_PD14, GPIO_PD15,
  255. GPIO_PA7, GPIO_PB0, GPIO_PB1, GPIO_PB2, GPIO_PB3,
  256. };
  257. static const unsigned atapi_pins[] = {
  258. GPIO_PH2, GPIO_PJ3, GPIO_PJ4, GPIO_PJ5, GPIO_PJ6,
  259. GPIO_PJ7, GPIO_PJ8, GPIO_PJ9, GPIO_PJ10,
  260. };
  261. static const unsigned atapi_alter_pins[] = {
  262. GPIO_PF0, GPIO_PF1, GPIO_PF2, GPIO_PF3, GPIO_PF4, GPIO_PF5, GPIO_PF6,
  263. GPIO_PF7, GPIO_PF8, GPIO_PF9, GPIO_PF10, GPIO_PF11, GPIO_PF12,
  264. GPIO_PF13, GPIO_PF14, GPIO_PF15, GPIO_PG2, GPIO_PG3, GPIO_PG4,
  265. };
  266. static const unsigned nfc0_pins[] = {
  267. GPIO_PJ1, GPIO_PJ2,
  268. };
  269. static const unsigned keys_4x4_pins[] = {
  270. GPIO_PD8, GPIO_PD9, GPIO_PD10, GPIO_PD11,
  271. GPIO_PD12, GPIO_PD13, GPIO_PD14, GPIO_PD15,
  272. };
  273. static const unsigned keys_8x8_pins[] = {
  274. GPIO_PD8, GPIO_PD9, GPIO_PD10, GPIO_PD11,
  275. GPIO_PD12, GPIO_PD13, GPIO_PD14, GPIO_PD15,
  276. GPIO_PE0, GPIO_PE1, GPIO_PE2, GPIO_PE3,
  277. GPIO_PE4, GPIO_PE5, GPIO_PE6, GPIO_PE7,
  278. };
  279. static const unsigned short uart0_mux[] = {
  280. P_UART0_TX, P_UART0_RX,
  281. 0
  282. };
  283. static const unsigned short uart1_mux[] = {
  284. P_UART1_TX, P_UART1_RX,
  285. 0
  286. };
  287. static const unsigned short uart1_ctsrts_mux[] = {
  288. P_UART1_RTS, P_UART1_CTS,
  289. 0
  290. };
  291. static const unsigned short uart2_mux[] = {
  292. P_UART2_TX, P_UART2_RX,
  293. 0
  294. };
  295. static const unsigned short uart3_mux[] = {
  296. P_UART3_TX, P_UART3_RX,
  297. 0
  298. };
  299. static const unsigned short uart3_ctsrts_mux[] = {
  300. P_UART3_RTS, P_UART3_CTS,
  301. 0
  302. };
  303. static const unsigned short rsi0_mux[] = {
  304. P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD,
  305. 0
  306. };
  307. static const unsigned short spi0_mux[] = {
  308. P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0
  309. };
  310. static const unsigned short spi1_mux[] = {
  311. P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0
  312. };
  313. static const unsigned short twi0_mux[] = {
  314. P_TWI0_SCL, P_TWI0_SDA, 0
  315. };
  316. static const unsigned short twi1_mux[] = {
  317. P_TWI1_SCL, P_TWI1_SDA, 0
  318. };
  319. static const unsigned short rotary_mux[] = {
  320. P_CNT_CUD, P_CNT_CDG, P_CNT_CZM, 0
  321. };
  322. static const unsigned short sport0_mux[] = {
  323. P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
  324. P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
  325. };
  326. static const unsigned short sport1_mux[] = {
  327. P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
  328. P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
  329. };
  330. static const unsigned short sport2_mux[] = {
  331. P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
  332. P_SPORT2_DRPRI, P_SPORT2_RSCLK, 0
  333. };
  334. static const unsigned short sport3_mux[] = {
  335. P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
  336. P_SPORT3_DRPRI, P_SPORT3_RSCLK, 0
  337. };
  338. static const unsigned short can0_mux[] = {
  339. P_CAN0_RX, P_CAN0_TX, 0
  340. };
  341. static const unsigned short can1_mux[] = {
  342. P_CAN1_RX, P_CAN1_TX, 0
  343. };
  344. static const unsigned short smc0_mux[] = {
  345. P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
  346. P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
  347. P_A22, P_A23, P_A24, P_A25, P_NOR_CLK, 0,
  348. };
  349. static const unsigned short ppi0_8b_mux[] = {
  350. P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3,
  351. P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7,
  352. P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
  353. 0,
  354. };
  355. static const unsigned short ppi0_16b_mux[] = {
  356. P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3,
  357. P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7,
  358. P_PPI0_D8, P_PPI0_D9, P_PPI0_D10, P_PPI0_D11,
  359. P_PPI0_D12, P_PPI0_D13, P_PPI0_D14, P_PPI0_D15,
  360. P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
  361. 0,
  362. };
  363. static const unsigned short ppi0_24b_mux[] = {
  364. P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3,
  365. P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7,
  366. P_PPI0_D8, P_PPI0_D9, P_PPI0_D10, P_PPI0_D11,
  367. P_PPI0_D12, P_PPI0_D13, P_PPI0_D14, P_PPI0_D15,
  368. P_PPI0_D16, P_PPI0_D17, P_PPI0_D18, P_PPI0_D19,
  369. P_PPI0_D20, P_PPI0_D21, P_PPI0_D22, P_PPI0_D23,
  370. P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
  371. 0,
  372. };
  373. static const unsigned short ppi1_8b_mux[] = {
  374. P_PPI1_D0, P_PPI1_D1, P_PPI1_D2, P_PPI1_D3,
  375. P_PPI1_D4, P_PPI1_D5, P_PPI1_D6, P_PPI1_D7,
  376. P_PPI1_CLK, P_PPI1_FS1, P_PPI1_FS2,
  377. 0,
  378. };
  379. static const unsigned short ppi1_16b_mux[] = {
  380. P_PPI1_D0, P_PPI1_D1, P_PPI1_D2, P_PPI1_D3,
  381. P_PPI1_D4, P_PPI1_D5, P_PPI1_D6, P_PPI1_D7,
  382. P_PPI1_D8, P_PPI1_D9, P_PPI1_D10, P_PPI1_D11,
  383. P_PPI1_D12, P_PPI1_D13, P_PPI1_D14, P_PPI1_D15,
  384. P_PPI1_CLK, P_PPI1_FS1, P_PPI1_FS2,
  385. 0,
  386. };
  387. static const unsigned short ppi2_8b_mux[] = {
  388. P_PPI2_D0, P_PPI2_D1, P_PPI2_D2, P_PPI2_D3,
  389. P_PPI2_D4, P_PPI2_D5, P_PPI2_D6, P_PPI2_D7,
  390. P_PPI2_CLK, P_PPI2_FS1, P_PPI2_FS2,
  391. 0,
  392. };
  393. static const unsigned short atapi_mux[] = {
  394. P_ATAPI_RESET, P_ATAPI_DIOR, P_ATAPI_DIOW, P_ATAPI_CS0, P_ATAPI_CS1,
  395. P_ATAPI_DMACK, P_ATAPI_DMARQ, P_ATAPI_INTRQ, P_ATAPI_IORDY,
  396. };
  397. static const unsigned short atapi_alter_mux[] = {
  398. P_ATAPI_D0A, P_ATAPI_D1A, P_ATAPI_D2A, P_ATAPI_D3A, P_ATAPI_D4A,
  399. P_ATAPI_D5A, P_ATAPI_D6A, P_ATAPI_D7A, P_ATAPI_D8A, P_ATAPI_D9A,
  400. P_ATAPI_D10A, P_ATAPI_D11A, P_ATAPI_D12A, P_ATAPI_D13A, P_ATAPI_D14A,
  401. P_ATAPI_D15A, P_ATAPI_A0A, P_ATAPI_A1A, P_ATAPI_A2A,
  402. 0
  403. };
  404. static const unsigned short nfc0_mux[] = {
  405. P_NAND_CE, P_NAND_RB,
  406. 0
  407. };
  408. static const unsigned short keys_4x4_mux[] = {
  409. P_KEY_ROW3, P_KEY_ROW2, P_KEY_ROW1, P_KEY_ROW0,
  410. P_KEY_COL3, P_KEY_COL2, P_KEY_COL1, P_KEY_COL0,
  411. 0
  412. };
  413. static const unsigned short keys_8x8_mux[] = {
  414. P_KEY_ROW7, P_KEY_ROW6, P_KEY_ROW5, P_KEY_ROW4,
  415. P_KEY_ROW3, P_KEY_ROW2, P_KEY_ROW1, P_KEY_ROW0,
  416. P_KEY_COL7, P_KEY_COL6, P_KEY_COL5, P_KEY_COL4,
  417. P_KEY_COL3, P_KEY_COL2, P_KEY_COL1, P_KEY_COL0,
  418. 0
  419. };
  420. static const struct adi_pin_group adi_pin_groups[] = {
  421. ADI_PIN_GROUP("uart0grp", uart0_pins, uart0_mux),
  422. ADI_PIN_GROUP("uart1grp", uart1_pins, uart1_mux),
  423. ADI_PIN_GROUP("uart1ctsrtsgrp", uart1_ctsrts_pins, uart1_ctsrts_mux),
  424. ADI_PIN_GROUP("uart2grp", uart2_pins, uart2_mux),
  425. ADI_PIN_GROUP("uart3grp", uart3_pins, uart3_mux),
  426. ADI_PIN_GROUP("uart3ctsrtsgrp", uart3_ctsrts_pins, uart3_ctsrts_mux),
  427. ADI_PIN_GROUP("rsi0grp", rsi0_pins, rsi0_mux),
  428. ADI_PIN_GROUP("spi0grp", spi0_pins, spi0_mux),
  429. ADI_PIN_GROUP("spi1grp", spi1_pins, spi1_mux),
  430. ADI_PIN_GROUP("twi0grp", twi0_pins, twi0_mux),
  431. ADI_PIN_GROUP("twi1grp", twi1_pins, twi1_mux),
  432. ADI_PIN_GROUP("rotarygrp", rotary_pins, rotary_mux),
  433. ADI_PIN_GROUP("can0grp", can0_pins, can0_mux),
  434. ADI_PIN_GROUP("can1grp", can1_pins, can1_mux),
  435. ADI_PIN_GROUP("smc0grp", smc0_pins, smc0_mux),
  436. ADI_PIN_GROUP("sport0grp", sport0_pins, sport0_mux),
  437. ADI_PIN_GROUP("sport1grp", sport1_pins, sport1_mux),
  438. ADI_PIN_GROUP("sport2grp", sport2_pins, sport2_mux),
  439. ADI_PIN_GROUP("sport3grp", sport3_pins, sport3_mux),
  440. ADI_PIN_GROUP("ppi0_8bgrp", ppi0_8b_pins, ppi0_8b_mux),
  441. ADI_PIN_GROUP("ppi0_16bgrp", ppi0_16b_pins, ppi0_16b_mux),
  442. ADI_PIN_GROUP("ppi0_24bgrp", ppi0_24b_pins, ppi0_24b_mux),
  443. ADI_PIN_GROUP("ppi1_8bgrp", ppi1_8b_pins, ppi1_8b_mux),
  444. ADI_PIN_GROUP("ppi1_16bgrp", ppi1_16b_pins, ppi1_16b_mux),
  445. ADI_PIN_GROUP("ppi2_8bgrp", ppi2_8b_pins, ppi2_8b_mux),
  446. ADI_PIN_GROUP("atapigrp", atapi_pins, atapi_mux),
  447. ADI_PIN_GROUP("atapialtergrp", atapi_alter_pins, atapi_alter_mux),
  448. ADI_PIN_GROUP("nfc0grp", nfc0_pins, nfc0_mux),
  449. ADI_PIN_GROUP("keys_4x4grp", keys_4x4_pins, keys_4x4_mux),
  450. ADI_PIN_GROUP("keys_8x8grp", keys_8x8_pins, keys_8x8_mux),
  451. };
  452. static const char * const uart0grp[] = { "uart0grp" };
  453. static const char * const uart1grp[] = { "uart1grp" };
  454. static const char * const uart1ctsrtsgrp[] = { "uart1ctsrtsgrp" };
  455. static const char * const uart2grp[] = { "uart2grp" };
  456. static const char * const uart3grp[] = { "uart3grp" };
  457. static const char * const uart3ctsrtsgrp[] = { "uart3ctsrtsgrp" };
  458. static const char * const rsi0grp[] = { "rsi0grp" };
  459. static const char * const spi0grp[] = { "spi0grp" };
  460. static const char * const spi1grp[] = { "spi1grp" };
  461. static const char * const twi0grp[] = { "twi0grp" };
  462. static const char * const twi1grp[] = { "twi1grp" };
  463. static const char * const rotarygrp[] = { "rotarygrp" };
  464. static const char * const can0grp[] = { "can0grp" };
  465. static const char * const can1grp[] = { "can1grp" };
  466. static const char * const smc0grp[] = { "smc0grp" };
  467. static const char * const sport0grp[] = { "sport0grp" };
  468. static const char * const sport1grp[] = { "sport1grp" };
  469. static const char * const sport2grp[] = { "sport2grp" };
  470. static const char * const sport3grp[] = { "sport3grp" };
  471. static const char * const ppi0grp[] = { "ppi0_8bgrp",
  472. "ppi0_16bgrp",
  473. "ppi0_24bgrp" };
  474. static const char * const ppi1grp[] = { "ppi1_8bgrp",
  475. "ppi1_16bgrp" };
  476. static const char * const ppi2grp[] = { "ppi2_8bgrp" };
  477. static const char * const atapigrp[] = { "atapigrp" };
  478. static const char * const atapialtergrp[] = { "atapialtergrp" };
  479. static const char * const nfc0grp[] = { "nfc0grp" };
  480. static const char * const keysgrp[] = { "keys_4x4grp",
  481. "keys_8x8grp" };
  482. static const struct adi_pmx_func adi_pmx_functions[] = {
  483. ADI_PMX_FUNCTION("uart0", uart0grp),
  484. ADI_PMX_FUNCTION("uart1", uart1grp),
  485. ADI_PMX_FUNCTION("uart1_ctsrts", uart1ctsrtsgrp),
  486. ADI_PMX_FUNCTION("uart2", uart2grp),
  487. ADI_PMX_FUNCTION("uart3", uart3grp),
  488. ADI_PMX_FUNCTION("uart3_ctsrts", uart3ctsrtsgrp),
  489. ADI_PMX_FUNCTION("rsi0", rsi0grp),
  490. ADI_PMX_FUNCTION("spi0", spi0grp),
  491. ADI_PMX_FUNCTION("spi1", spi1grp),
  492. ADI_PMX_FUNCTION("twi0", twi0grp),
  493. ADI_PMX_FUNCTION("twi1", twi1grp),
  494. ADI_PMX_FUNCTION("rotary", rotarygrp),
  495. ADI_PMX_FUNCTION("can0", can0grp),
  496. ADI_PMX_FUNCTION("can1", can1grp),
  497. ADI_PMX_FUNCTION("smc0", smc0grp),
  498. ADI_PMX_FUNCTION("sport0", sport0grp),
  499. ADI_PMX_FUNCTION("sport1", sport1grp),
  500. ADI_PMX_FUNCTION("sport2", sport2grp),
  501. ADI_PMX_FUNCTION("sport3", sport3grp),
  502. ADI_PMX_FUNCTION("ppi0", ppi0grp),
  503. ADI_PMX_FUNCTION("ppi1", ppi1grp),
  504. ADI_PMX_FUNCTION("ppi2", ppi2grp),
  505. ADI_PMX_FUNCTION("atapi", atapigrp),
  506. ADI_PMX_FUNCTION("atapi_alter", atapialtergrp),
  507. ADI_PMX_FUNCTION("nfc0", nfc0grp),
  508. ADI_PMX_FUNCTION("keys", keysgrp),
  509. };
  510. static const struct adi_pinctrl_soc_data adi_bf54x_soc = {
  511. .functions = adi_pmx_functions,
  512. .nfunctions = ARRAY_SIZE(adi_pmx_functions),
  513. .groups = adi_pin_groups,
  514. .ngroups = ARRAY_SIZE(adi_pin_groups),
  515. .pins = adi_pads,
  516. .npins = ARRAY_SIZE(adi_pads),
  517. };
  518. void adi_pinctrl_soc_init(const struct adi_pinctrl_soc_data **soc)
  519. {
  520. *soc = &adi_bf54x_soc;
  521. }