pinctrl-tb10x.c 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. /*
  2. * Abilis Systems TB10x pin control driver
  3. *
  4. * Copyright (C) Abilis Systems 2012
  5. *
  6. * Author: Christian Ruppert <christian.ruppert@abilis.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <linux/stringify.h>
  22. #include <linux/pinctrl/pinctrl.h>
  23. #include <linux/pinctrl/pinmux.h>
  24. #include <linux/pinctrl/machine.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/module.h>
  27. #include <linux/mutex.h>
  28. #include <linux/err.h>
  29. #include <linux/io.h>
  30. #include <linux/of.h>
  31. #include <linux/slab.h>
  32. #include "pinctrl-utils.h"
  33. #define TB10X_PORT1 (0)
  34. #define TB10X_PORT2 (16)
  35. #define TB10X_PORT3 (32)
  36. #define TB10X_PORT4 (48)
  37. #define TB10X_PORT5 (128)
  38. #define TB10X_PORT6 (64)
  39. #define TB10X_PORT7 (80)
  40. #define TB10X_PORT8 (96)
  41. #define TB10X_PORT9 (112)
  42. #define TB10X_GPIOS (256)
  43. #define PCFG_PORT_BITWIDTH (2)
  44. #define PCFG_PORT_MASK(PORT) \
  45. (((1 << PCFG_PORT_BITWIDTH) - 1) << (PCFG_PORT_BITWIDTH * (PORT)))
  46. static const struct pinctrl_pin_desc tb10x_pins[] = {
  47. /* Port 1 */
  48. PINCTRL_PIN(TB10X_PORT1 + 0, "MICLK_S0"),
  49. PINCTRL_PIN(TB10X_PORT1 + 1, "MISTRT_S0"),
  50. PINCTRL_PIN(TB10X_PORT1 + 2, "MIVAL_S0"),
  51. PINCTRL_PIN(TB10X_PORT1 + 3, "MDI_S0"),
  52. PINCTRL_PIN(TB10X_PORT1 + 4, "GPIOA0"),
  53. PINCTRL_PIN(TB10X_PORT1 + 5, "GPIOA1"),
  54. PINCTRL_PIN(TB10X_PORT1 + 6, "GPIOA2"),
  55. PINCTRL_PIN(TB10X_PORT1 + 7, "MDI_S1"),
  56. PINCTRL_PIN(TB10X_PORT1 + 8, "MIVAL_S1"),
  57. PINCTRL_PIN(TB10X_PORT1 + 9, "MISTRT_S1"),
  58. PINCTRL_PIN(TB10X_PORT1 + 10, "MICLK_S1"),
  59. /* Port 2 */
  60. PINCTRL_PIN(TB10X_PORT2 + 0, "MICLK_S2"),
  61. PINCTRL_PIN(TB10X_PORT2 + 1, "MISTRT_S2"),
  62. PINCTRL_PIN(TB10X_PORT2 + 2, "MIVAL_S2"),
  63. PINCTRL_PIN(TB10X_PORT2 + 3, "MDI_S2"),
  64. PINCTRL_PIN(TB10X_PORT2 + 4, "GPIOC0"),
  65. PINCTRL_PIN(TB10X_PORT2 + 5, "GPIOC1"),
  66. PINCTRL_PIN(TB10X_PORT2 + 6, "GPIOC2"),
  67. PINCTRL_PIN(TB10X_PORT2 + 7, "MDI_S3"),
  68. PINCTRL_PIN(TB10X_PORT2 + 8, "MIVAL_S3"),
  69. PINCTRL_PIN(TB10X_PORT2 + 9, "MISTRT_S3"),
  70. PINCTRL_PIN(TB10X_PORT2 + 10, "MICLK_S3"),
  71. /* Port 3 */
  72. PINCTRL_PIN(TB10X_PORT3 + 0, "MICLK_S4"),
  73. PINCTRL_PIN(TB10X_PORT3 + 1, "MISTRT_S4"),
  74. PINCTRL_PIN(TB10X_PORT3 + 2, "MIVAL_S4"),
  75. PINCTRL_PIN(TB10X_PORT3 + 3, "MDI_S4"),
  76. PINCTRL_PIN(TB10X_PORT3 + 4, "GPIOE0"),
  77. PINCTRL_PIN(TB10X_PORT3 + 5, "GPIOE1"),
  78. PINCTRL_PIN(TB10X_PORT3 + 6, "GPIOE2"),
  79. PINCTRL_PIN(TB10X_PORT3 + 7, "MDI_S5"),
  80. PINCTRL_PIN(TB10X_PORT3 + 8, "MIVAL_S5"),
  81. PINCTRL_PIN(TB10X_PORT3 + 9, "MISTRT_S5"),
  82. PINCTRL_PIN(TB10X_PORT3 + 10, "MICLK_S5"),
  83. /* Port 4 */
  84. PINCTRL_PIN(TB10X_PORT4 + 0, "MICLK_S6"),
  85. PINCTRL_PIN(TB10X_PORT4 + 1, "MISTRT_S6"),
  86. PINCTRL_PIN(TB10X_PORT4 + 2, "MIVAL_S6"),
  87. PINCTRL_PIN(TB10X_PORT4 + 3, "MDI_S6"),
  88. PINCTRL_PIN(TB10X_PORT4 + 4, "GPIOG0"),
  89. PINCTRL_PIN(TB10X_PORT4 + 5, "GPIOG1"),
  90. PINCTRL_PIN(TB10X_PORT4 + 6, "GPIOG2"),
  91. PINCTRL_PIN(TB10X_PORT4 + 7, "MDI_S7"),
  92. PINCTRL_PIN(TB10X_PORT4 + 8, "MIVAL_S7"),
  93. PINCTRL_PIN(TB10X_PORT4 + 9, "MISTRT_S7"),
  94. PINCTRL_PIN(TB10X_PORT4 + 10, "MICLK_S7"),
  95. /* Port 5 */
  96. PINCTRL_PIN(TB10X_PORT5 + 0, "PC_CE1N"),
  97. PINCTRL_PIN(TB10X_PORT5 + 1, "PC_CE2N"),
  98. PINCTRL_PIN(TB10X_PORT5 + 2, "PC_REGN"),
  99. PINCTRL_PIN(TB10X_PORT5 + 3, "PC_INPACKN"),
  100. PINCTRL_PIN(TB10X_PORT5 + 4, "PC_OEN"),
  101. PINCTRL_PIN(TB10X_PORT5 + 5, "PC_WEN"),
  102. PINCTRL_PIN(TB10X_PORT5 + 6, "PC_IORDN"),
  103. PINCTRL_PIN(TB10X_PORT5 + 7, "PC_IOWRN"),
  104. PINCTRL_PIN(TB10X_PORT5 + 8, "PC_RDYIRQN"),
  105. PINCTRL_PIN(TB10X_PORT5 + 9, "PC_WAITN"),
  106. PINCTRL_PIN(TB10X_PORT5 + 10, "PC_A0"),
  107. PINCTRL_PIN(TB10X_PORT5 + 11, "PC_A1"),
  108. PINCTRL_PIN(TB10X_PORT5 + 12, "PC_A2"),
  109. PINCTRL_PIN(TB10X_PORT5 + 13, "PC_A3"),
  110. PINCTRL_PIN(TB10X_PORT5 + 14, "PC_A4"),
  111. PINCTRL_PIN(TB10X_PORT5 + 15, "PC_A5"),
  112. PINCTRL_PIN(TB10X_PORT5 + 16, "PC_A6"),
  113. PINCTRL_PIN(TB10X_PORT5 + 17, "PC_A7"),
  114. PINCTRL_PIN(TB10X_PORT5 + 18, "PC_A8"),
  115. PINCTRL_PIN(TB10X_PORT5 + 19, "PC_A9"),
  116. PINCTRL_PIN(TB10X_PORT5 + 20, "PC_A10"),
  117. PINCTRL_PIN(TB10X_PORT5 + 21, "PC_A11"),
  118. PINCTRL_PIN(TB10X_PORT5 + 22, "PC_A12"),
  119. PINCTRL_PIN(TB10X_PORT5 + 23, "PC_A13"),
  120. PINCTRL_PIN(TB10X_PORT5 + 24, "PC_A14"),
  121. PINCTRL_PIN(TB10X_PORT5 + 25, "PC_D0"),
  122. PINCTRL_PIN(TB10X_PORT5 + 26, "PC_D1"),
  123. PINCTRL_PIN(TB10X_PORT5 + 27, "PC_D2"),
  124. PINCTRL_PIN(TB10X_PORT5 + 28, "PC_D3"),
  125. PINCTRL_PIN(TB10X_PORT5 + 29, "PC_D4"),
  126. PINCTRL_PIN(TB10X_PORT5 + 30, "PC_D5"),
  127. PINCTRL_PIN(TB10X_PORT5 + 31, "PC_D6"),
  128. PINCTRL_PIN(TB10X_PORT5 + 32, "PC_D7"),
  129. PINCTRL_PIN(TB10X_PORT5 + 33, "PC_MOSTRT"),
  130. PINCTRL_PIN(TB10X_PORT5 + 34, "PC_MOVAL"),
  131. PINCTRL_PIN(TB10X_PORT5 + 35, "PC_MDO0"),
  132. PINCTRL_PIN(TB10X_PORT5 + 36, "PC_MDO1"),
  133. PINCTRL_PIN(TB10X_PORT5 + 37, "PC_MDO2"),
  134. PINCTRL_PIN(TB10X_PORT5 + 38, "PC_MDO3"),
  135. PINCTRL_PIN(TB10X_PORT5 + 39, "PC_MDO4"),
  136. PINCTRL_PIN(TB10X_PORT5 + 40, "PC_MDO5"),
  137. PINCTRL_PIN(TB10X_PORT5 + 41, "PC_MDO6"),
  138. PINCTRL_PIN(TB10X_PORT5 + 42, "PC_MDO7"),
  139. PINCTRL_PIN(TB10X_PORT5 + 43, "PC_MISTRT"),
  140. PINCTRL_PIN(TB10X_PORT5 + 44, "PC_MIVAL"),
  141. PINCTRL_PIN(TB10X_PORT5 + 45, "PC_MDI0"),
  142. PINCTRL_PIN(TB10X_PORT5 + 46, "PC_MDI1"),
  143. PINCTRL_PIN(TB10X_PORT5 + 47, "PC_MDI2"),
  144. PINCTRL_PIN(TB10X_PORT5 + 48, "PC_MDI3"),
  145. PINCTRL_PIN(TB10X_PORT5 + 49, "PC_MDI4"),
  146. PINCTRL_PIN(TB10X_PORT5 + 50, "PC_MDI5"),
  147. PINCTRL_PIN(TB10X_PORT5 + 51, "PC_MDI6"),
  148. PINCTRL_PIN(TB10X_PORT5 + 52, "PC_MDI7"),
  149. PINCTRL_PIN(TB10X_PORT5 + 53, "PC_MICLK"),
  150. /* Port 6 */
  151. PINCTRL_PIN(TB10X_PORT6 + 0, "T_MOSTRT_S0"),
  152. PINCTRL_PIN(TB10X_PORT6 + 1, "T_MOVAL_S0"),
  153. PINCTRL_PIN(TB10X_PORT6 + 2, "T_MDO_S0"),
  154. PINCTRL_PIN(TB10X_PORT6 + 3, "T_MOSTRT_S1"),
  155. PINCTRL_PIN(TB10X_PORT6 + 4, "T_MOVAL_S1"),
  156. PINCTRL_PIN(TB10X_PORT6 + 5, "T_MDO_S1"),
  157. PINCTRL_PIN(TB10X_PORT6 + 6, "T_MOSTRT_S2"),
  158. PINCTRL_PIN(TB10X_PORT6 + 7, "T_MOVAL_S2"),
  159. PINCTRL_PIN(TB10X_PORT6 + 8, "T_MDO_S2"),
  160. PINCTRL_PIN(TB10X_PORT6 + 9, "T_MOSTRT_S3"),
  161. /* Port 7 */
  162. PINCTRL_PIN(TB10X_PORT7 + 0, "UART0_TXD"),
  163. PINCTRL_PIN(TB10X_PORT7 + 1, "UART0_RXD"),
  164. PINCTRL_PIN(TB10X_PORT7 + 2, "UART0_CTS"),
  165. PINCTRL_PIN(TB10X_PORT7 + 3, "UART0_RTS"),
  166. PINCTRL_PIN(TB10X_PORT7 + 4, "UART1_TXD"),
  167. PINCTRL_PIN(TB10X_PORT7 + 5, "UART1_RXD"),
  168. PINCTRL_PIN(TB10X_PORT7 + 6, "UART1_CTS"),
  169. PINCTRL_PIN(TB10X_PORT7 + 7, "UART1_RTS"),
  170. /* Port 8 */
  171. PINCTRL_PIN(TB10X_PORT8 + 0, "SPI3_CLK"),
  172. PINCTRL_PIN(TB10X_PORT8 + 1, "SPI3_MISO"),
  173. PINCTRL_PIN(TB10X_PORT8 + 2, "SPI3_MOSI"),
  174. PINCTRL_PIN(TB10X_PORT8 + 3, "SPI3_SSN"),
  175. /* Port 9 */
  176. PINCTRL_PIN(TB10X_PORT9 + 0, "SPI1_CLK"),
  177. PINCTRL_PIN(TB10X_PORT9 + 1, "SPI1_MISO"),
  178. PINCTRL_PIN(TB10X_PORT9 + 2, "SPI1_MOSI"),
  179. PINCTRL_PIN(TB10X_PORT9 + 3, "SPI1_SSN0"),
  180. PINCTRL_PIN(TB10X_PORT9 + 4, "SPI1_SSN1"),
  181. /* Unmuxed GPIOs */
  182. PINCTRL_PIN(TB10X_GPIOS + 0, "GPIOB0"),
  183. PINCTRL_PIN(TB10X_GPIOS + 1, "GPIOB1"),
  184. PINCTRL_PIN(TB10X_GPIOS + 2, "GPIOD0"),
  185. PINCTRL_PIN(TB10X_GPIOS + 3, "GPIOD1"),
  186. PINCTRL_PIN(TB10X_GPIOS + 4, "GPIOF0"),
  187. PINCTRL_PIN(TB10X_GPIOS + 5, "GPIOF1"),
  188. PINCTRL_PIN(TB10X_GPIOS + 6, "GPIOH0"),
  189. PINCTRL_PIN(TB10X_GPIOS + 7, "GPIOH1"),
  190. PINCTRL_PIN(TB10X_GPIOS + 8, "GPIOI0"),
  191. PINCTRL_PIN(TB10X_GPIOS + 9, "GPIOI1"),
  192. PINCTRL_PIN(TB10X_GPIOS + 10, "GPIOI2"),
  193. PINCTRL_PIN(TB10X_GPIOS + 11, "GPIOI3"),
  194. PINCTRL_PIN(TB10X_GPIOS + 12, "GPIOI4"),
  195. PINCTRL_PIN(TB10X_GPIOS + 13, "GPIOI5"),
  196. PINCTRL_PIN(TB10X_GPIOS + 14, "GPIOI6"),
  197. PINCTRL_PIN(TB10X_GPIOS + 15, "GPIOI7"),
  198. PINCTRL_PIN(TB10X_GPIOS + 16, "GPIOI8"),
  199. PINCTRL_PIN(TB10X_GPIOS + 17, "GPIOI9"),
  200. PINCTRL_PIN(TB10X_GPIOS + 18, "GPIOI10"),
  201. PINCTRL_PIN(TB10X_GPIOS + 19, "GPIOI11"),
  202. PINCTRL_PIN(TB10X_GPIOS + 20, "GPION0"),
  203. PINCTRL_PIN(TB10X_GPIOS + 21, "GPION1"),
  204. PINCTRL_PIN(TB10X_GPIOS + 22, "GPION2"),
  205. PINCTRL_PIN(TB10X_GPIOS + 23, "GPION3"),
  206. #define MAX_PIN (TB10X_GPIOS + 24)
  207. PINCTRL_PIN(MAX_PIN, "GPION4"),
  208. };
  209. /* Port 1 */
  210. static const unsigned mis0_pins[] = { TB10X_PORT1 + 0, TB10X_PORT1 + 1,
  211. TB10X_PORT1 + 2, TB10X_PORT1 + 3};
  212. static const unsigned gpioa_pins[] = { TB10X_PORT1 + 4, TB10X_PORT1 + 5,
  213. TB10X_PORT1 + 6};
  214. static const unsigned mis1_pins[] = { TB10X_PORT1 + 7, TB10X_PORT1 + 8,
  215. TB10X_PORT1 + 9, TB10X_PORT1 + 10};
  216. static const unsigned mip1_pins[] = { TB10X_PORT1 + 0, TB10X_PORT1 + 1,
  217. TB10X_PORT1 + 2, TB10X_PORT1 + 3,
  218. TB10X_PORT1 + 4, TB10X_PORT1 + 5,
  219. TB10X_PORT1 + 6, TB10X_PORT1 + 7,
  220. TB10X_PORT1 + 8, TB10X_PORT1 + 9,
  221. TB10X_PORT1 + 10};
  222. /* Port 2 */
  223. static const unsigned mis2_pins[] = { TB10X_PORT2 + 0, TB10X_PORT2 + 1,
  224. TB10X_PORT2 + 2, TB10X_PORT2 + 3};
  225. static const unsigned gpioc_pins[] = { TB10X_PORT2 + 4, TB10X_PORT2 + 5,
  226. TB10X_PORT2 + 6};
  227. static const unsigned mis3_pins[] = { TB10X_PORT2 + 7, TB10X_PORT2 + 8,
  228. TB10X_PORT2 + 9, TB10X_PORT2 + 10};
  229. static const unsigned mip3_pins[] = { TB10X_PORT2 + 0, TB10X_PORT2 + 1,
  230. TB10X_PORT2 + 2, TB10X_PORT2 + 3,
  231. TB10X_PORT2 + 4, TB10X_PORT2 + 5,
  232. TB10X_PORT2 + 6, TB10X_PORT2 + 7,
  233. TB10X_PORT2 + 8, TB10X_PORT2 + 9,
  234. TB10X_PORT2 + 10};
  235. /* Port 3 */
  236. static const unsigned mis4_pins[] = { TB10X_PORT3 + 0, TB10X_PORT3 + 1,
  237. TB10X_PORT3 + 2, TB10X_PORT3 + 3};
  238. static const unsigned gpioe_pins[] = { TB10X_PORT3 + 4, TB10X_PORT3 + 5,
  239. TB10X_PORT3 + 6};
  240. static const unsigned mis5_pins[] = { TB10X_PORT3 + 7, TB10X_PORT3 + 8,
  241. TB10X_PORT3 + 9, TB10X_PORT3 + 10};
  242. static const unsigned mip5_pins[] = { TB10X_PORT3 + 0, TB10X_PORT3 + 1,
  243. TB10X_PORT3 + 2, TB10X_PORT3 + 3,
  244. TB10X_PORT3 + 4, TB10X_PORT3 + 5,
  245. TB10X_PORT3 + 6, TB10X_PORT3 + 7,
  246. TB10X_PORT3 + 8, TB10X_PORT3 + 9,
  247. TB10X_PORT3 + 10};
  248. /* Port 4 */
  249. static const unsigned mis6_pins[] = { TB10X_PORT4 + 0, TB10X_PORT4 + 1,
  250. TB10X_PORT4 + 2, TB10X_PORT4 + 3};
  251. static const unsigned gpiog_pins[] = { TB10X_PORT4 + 4, TB10X_PORT4 + 5,
  252. TB10X_PORT4 + 6};
  253. static const unsigned mis7_pins[] = { TB10X_PORT4 + 7, TB10X_PORT4 + 8,
  254. TB10X_PORT4 + 9, TB10X_PORT4 + 10};
  255. static const unsigned mip7_pins[] = { TB10X_PORT4 + 0, TB10X_PORT4 + 1,
  256. TB10X_PORT4 + 2, TB10X_PORT4 + 3,
  257. TB10X_PORT4 + 4, TB10X_PORT4 + 5,
  258. TB10X_PORT4 + 6, TB10X_PORT4 + 7,
  259. TB10X_PORT4 + 8, TB10X_PORT4 + 9,
  260. TB10X_PORT4 + 10};
  261. /* Port 6 */
  262. static const unsigned mop_pins[] = { TB10X_PORT6 + 0, TB10X_PORT6 + 1,
  263. TB10X_PORT6 + 2, TB10X_PORT6 + 3,
  264. TB10X_PORT6 + 4, TB10X_PORT6 + 5,
  265. TB10X_PORT6 + 6, TB10X_PORT6 + 7,
  266. TB10X_PORT6 + 8, TB10X_PORT6 + 9};
  267. static const unsigned mos0_pins[] = { TB10X_PORT6 + 0, TB10X_PORT6 + 1,
  268. TB10X_PORT6 + 2};
  269. static const unsigned mos1_pins[] = { TB10X_PORT6 + 3, TB10X_PORT6 + 4,
  270. TB10X_PORT6 + 5};
  271. static const unsigned mos2_pins[] = { TB10X_PORT6 + 6, TB10X_PORT6 + 7,
  272. TB10X_PORT6 + 8};
  273. static const unsigned mos3_pins[] = { TB10X_PORT6 + 9};
  274. /* Port 7 */
  275. static const unsigned uart0_pins[] = { TB10X_PORT7 + 0, TB10X_PORT7 + 1,
  276. TB10X_PORT7 + 2, TB10X_PORT7 + 3};
  277. static const unsigned uart1_pins[] = { TB10X_PORT7 + 4, TB10X_PORT7 + 5,
  278. TB10X_PORT7 + 6, TB10X_PORT7 + 7};
  279. static const unsigned gpiol_pins[] = { TB10X_PORT7 + 0, TB10X_PORT7 + 1,
  280. TB10X_PORT7 + 2, TB10X_PORT7 + 3};
  281. static const unsigned gpiom_pins[] = { TB10X_PORT7 + 4, TB10X_PORT7 + 5,
  282. TB10X_PORT7 + 6, TB10X_PORT7 + 7};
  283. /* Port 8 */
  284. static const unsigned spi3_pins[] = { TB10X_PORT8 + 0, TB10X_PORT8 + 1,
  285. TB10X_PORT8 + 2, TB10X_PORT8 + 3};
  286. static const unsigned jtag_pins[] = { TB10X_PORT8 + 0, TB10X_PORT8 + 1,
  287. TB10X_PORT8 + 2, TB10X_PORT8 + 3};
  288. /* Port 9 */
  289. static const unsigned spi1_pins[] = { TB10X_PORT9 + 0, TB10X_PORT9 + 1,
  290. TB10X_PORT9 + 2, TB10X_PORT9 + 3,
  291. TB10X_PORT9 + 4};
  292. static const unsigned gpion_pins[] = { TB10X_PORT9 + 0, TB10X_PORT9 + 1,
  293. TB10X_PORT9 + 2, TB10X_PORT9 + 3,
  294. TB10X_PORT9 + 4};
  295. /* Port 5 */
  296. static const unsigned gpioj_pins[] = { TB10X_PORT5 + 0, TB10X_PORT5 + 1,
  297. TB10X_PORT5 + 2, TB10X_PORT5 + 3,
  298. TB10X_PORT5 + 4, TB10X_PORT5 + 5,
  299. TB10X_PORT5 + 6, TB10X_PORT5 + 7,
  300. TB10X_PORT5 + 8, TB10X_PORT5 + 9,
  301. TB10X_PORT5 + 10, TB10X_PORT5 + 11,
  302. TB10X_PORT5 + 12, TB10X_PORT5 + 13,
  303. TB10X_PORT5 + 14, TB10X_PORT5 + 15,
  304. TB10X_PORT5 + 16, TB10X_PORT5 + 17,
  305. TB10X_PORT5 + 18, TB10X_PORT5 + 19,
  306. TB10X_PORT5 + 20, TB10X_PORT5 + 21,
  307. TB10X_PORT5 + 22, TB10X_PORT5 + 23,
  308. TB10X_PORT5 + 24, TB10X_PORT5 + 25,
  309. TB10X_PORT5 + 26, TB10X_PORT5 + 27,
  310. TB10X_PORT5 + 28, TB10X_PORT5 + 29,
  311. TB10X_PORT5 + 30, TB10X_PORT5 + 31};
  312. static const unsigned gpiok_pins[] = { TB10X_PORT5 + 32, TB10X_PORT5 + 33,
  313. TB10X_PORT5 + 34, TB10X_PORT5 + 35,
  314. TB10X_PORT5 + 36, TB10X_PORT5 + 37,
  315. TB10X_PORT5 + 38, TB10X_PORT5 + 39,
  316. TB10X_PORT5 + 40, TB10X_PORT5 + 41,
  317. TB10X_PORT5 + 42, TB10X_PORT5 + 43,
  318. TB10X_PORT5 + 44, TB10X_PORT5 + 45,
  319. TB10X_PORT5 + 46, TB10X_PORT5 + 47,
  320. TB10X_PORT5 + 48, TB10X_PORT5 + 49,
  321. TB10X_PORT5 + 50, TB10X_PORT5 + 51,
  322. TB10X_PORT5 + 52, TB10X_PORT5 + 53};
  323. static const unsigned ciplus_pins[] = { TB10X_PORT5 + 0, TB10X_PORT5 + 1,
  324. TB10X_PORT5 + 2, TB10X_PORT5 + 3,
  325. TB10X_PORT5 + 4, TB10X_PORT5 + 5,
  326. TB10X_PORT5 + 6, TB10X_PORT5 + 7,
  327. TB10X_PORT5 + 8, TB10X_PORT5 + 9,
  328. TB10X_PORT5 + 10, TB10X_PORT5 + 11,
  329. TB10X_PORT5 + 12, TB10X_PORT5 + 13,
  330. TB10X_PORT5 + 14, TB10X_PORT5 + 15,
  331. TB10X_PORT5 + 16, TB10X_PORT5 + 17,
  332. TB10X_PORT5 + 18, TB10X_PORT5 + 19,
  333. TB10X_PORT5 + 20, TB10X_PORT5 + 21,
  334. TB10X_PORT5 + 22, TB10X_PORT5 + 23,
  335. TB10X_PORT5 + 24, TB10X_PORT5 + 25,
  336. TB10X_PORT5 + 26, TB10X_PORT5 + 27,
  337. TB10X_PORT5 + 28, TB10X_PORT5 + 29,
  338. TB10X_PORT5 + 30, TB10X_PORT5 + 31,
  339. TB10X_PORT5 + 32, TB10X_PORT5 + 33,
  340. TB10X_PORT5 + 34, TB10X_PORT5 + 35,
  341. TB10X_PORT5 + 36, TB10X_PORT5 + 37,
  342. TB10X_PORT5 + 38, TB10X_PORT5 + 39,
  343. TB10X_PORT5 + 40, TB10X_PORT5 + 41,
  344. TB10X_PORT5 + 42, TB10X_PORT5 + 43,
  345. TB10X_PORT5 + 44, TB10X_PORT5 + 45,
  346. TB10X_PORT5 + 46, TB10X_PORT5 + 47,
  347. TB10X_PORT5 + 48, TB10X_PORT5 + 49,
  348. TB10X_PORT5 + 50, TB10X_PORT5 + 51,
  349. TB10X_PORT5 + 52, TB10X_PORT5 + 53};
  350. static const unsigned mcard_pins[] = { TB10X_PORT5 + 3, TB10X_PORT5 + 10,
  351. TB10X_PORT5 + 11, TB10X_PORT5 + 12,
  352. TB10X_PORT5 + 22, TB10X_PORT5 + 23,
  353. TB10X_PORT5 + 33, TB10X_PORT5 + 35,
  354. TB10X_PORT5 + 36, TB10X_PORT5 + 37,
  355. TB10X_PORT5 + 38, TB10X_PORT5 + 39,
  356. TB10X_PORT5 + 40, TB10X_PORT5 + 41,
  357. TB10X_PORT5 + 42, TB10X_PORT5 + 43,
  358. TB10X_PORT5 + 45, TB10X_PORT5 + 46,
  359. TB10X_PORT5 + 47, TB10X_PORT5 + 48,
  360. TB10X_PORT5 + 49, TB10X_PORT5 + 50,
  361. TB10X_PORT5 + 51, TB10X_PORT5 + 52,
  362. TB10X_PORT5 + 53};
  363. static const unsigned stc0_pins[] = { TB10X_PORT5 + 34, TB10X_PORT5 + 35,
  364. TB10X_PORT5 + 36, TB10X_PORT5 + 37,
  365. TB10X_PORT5 + 38, TB10X_PORT5 + 39,
  366. TB10X_PORT5 + 40};
  367. static const unsigned stc1_pins[] = { TB10X_PORT5 + 25, TB10X_PORT5 + 26,
  368. TB10X_PORT5 + 27, TB10X_PORT5 + 28,
  369. TB10X_PORT5 + 29, TB10X_PORT5 + 30,
  370. TB10X_PORT5 + 44};
  371. /* Unmuxed GPIOs */
  372. static const unsigned gpiob_pins[] = { TB10X_GPIOS + 0, TB10X_GPIOS + 1};
  373. static const unsigned gpiod_pins[] = { TB10X_GPIOS + 2, TB10X_GPIOS + 3};
  374. static const unsigned gpiof_pins[] = { TB10X_GPIOS + 4, TB10X_GPIOS + 5};
  375. static const unsigned gpioh_pins[] = { TB10X_GPIOS + 6, TB10X_GPIOS + 7};
  376. static const unsigned gpioi_pins[] = { TB10X_GPIOS + 8, TB10X_GPIOS + 9,
  377. TB10X_GPIOS + 10, TB10X_GPIOS + 11,
  378. TB10X_GPIOS + 12, TB10X_GPIOS + 13,
  379. TB10X_GPIOS + 14, TB10X_GPIOS + 15,
  380. TB10X_GPIOS + 16, TB10X_GPIOS + 17,
  381. TB10X_GPIOS + 18, TB10X_GPIOS + 19};
  382. struct tb10x_pinfuncgrp {
  383. const char *name;
  384. const unsigned int *pins;
  385. const unsigned int pincnt;
  386. const int port;
  387. const unsigned int mode;
  388. const int isgpio;
  389. };
  390. #define DEFPINFUNCGRP(NAME, PORT, MODE, ISGPIO) { \
  391. .name = __stringify(NAME), \
  392. .pins = NAME##_pins, .pincnt = ARRAY_SIZE(NAME##_pins), \
  393. .port = (PORT), .mode = (MODE), \
  394. .isgpio = (ISGPIO), \
  395. }
  396. static const struct tb10x_pinfuncgrp tb10x_pingroups[] = {
  397. DEFPINFUNCGRP(mis0, 0, 0, 0),
  398. DEFPINFUNCGRP(gpioa, 0, 0, 1),
  399. DEFPINFUNCGRP(mis1, 0, 0, 0),
  400. DEFPINFUNCGRP(mip1, 0, 1, 0),
  401. DEFPINFUNCGRP(mis2, 1, 0, 0),
  402. DEFPINFUNCGRP(gpioc, 1, 0, 1),
  403. DEFPINFUNCGRP(mis3, 1, 0, 0),
  404. DEFPINFUNCGRP(mip3, 1, 1, 0),
  405. DEFPINFUNCGRP(mis4, 2, 0, 0),
  406. DEFPINFUNCGRP(gpioe, 2, 0, 1),
  407. DEFPINFUNCGRP(mis5, 2, 0, 0),
  408. DEFPINFUNCGRP(mip5, 2, 1, 0),
  409. DEFPINFUNCGRP(mis6, 3, 0, 0),
  410. DEFPINFUNCGRP(gpiog, 3, 0, 1),
  411. DEFPINFUNCGRP(mis7, 3, 0, 0),
  412. DEFPINFUNCGRP(mip7, 3, 1, 0),
  413. DEFPINFUNCGRP(gpioj, 4, 0, 1),
  414. DEFPINFUNCGRP(gpiok, 4, 0, 1),
  415. DEFPINFUNCGRP(ciplus, 4, 1, 0),
  416. DEFPINFUNCGRP(mcard, 4, 2, 0),
  417. DEFPINFUNCGRP(stc0, 4, 3, 0),
  418. DEFPINFUNCGRP(stc1, 4, 3, 0),
  419. DEFPINFUNCGRP(mop, 5, 0, 0),
  420. DEFPINFUNCGRP(mos0, 5, 1, 0),
  421. DEFPINFUNCGRP(mos1, 5, 1, 0),
  422. DEFPINFUNCGRP(mos2, 5, 1, 0),
  423. DEFPINFUNCGRP(mos3, 5, 1, 0),
  424. DEFPINFUNCGRP(uart0, 6, 0, 0),
  425. DEFPINFUNCGRP(uart1, 6, 0, 0),
  426. DEFPINFUNCGRP(gpiol, 6, 1, 1),
  427. DEFPINFUNCGRP(gpiom, 6, 1, 1),
  428. DEFPINFUNCGRP(spi3, 7, 0, 0),
  429. DEFPINFUNCGRP(jtag, 7, 1, 0),
  430. DEFPINFUNCGRP(spi1, 8, 0, 0),
  431. DEFPINFUNCGRP(gpion, 8, 1, 1),
  432. DEFPINFUNCGRP(gpiob, -1, 0, 1),
  433. DEFPINFUNCGRP(gpiod, -1, 0, 1),
  434. DEFPINFUNCGRP(gpiof, -1, 0, 1),
  435. DEFPINFUNCGRP(gpioh, -1, 0, 1),
  436. DEFPINFUNCGRP(gpioi, -1, 0, 1),
  437. };
  438. #undef DEFPINFUNCGRP
  439. struct tb10x_of_pinfunc {
  440. const char *name;
  441. const char *group;
  442. };
  443. #define TB10X_PORTS (9)
  444. /**
  445. * struct tb10x_port - state of an I/O port
  446. * @mode: Node this port is currently in.
  447. * @count: Number of enabled functions which require this port to be
  448. * configured in @mode.
  449. */
  450. struct tb10x_port {
  451. unsigned int mode;
  452. unsigned int count;
  453. };
  454. /**
  455. * struct tb10x_pinctrl - TB10x pin controller internal state
  456. * @pctl: pointer to the pinctrl_dev structure of this pin controller.
  457. * @base: register set base address.
  458. * @pingroups: pointer to an array of the pin groups this driver manages.
  459. * @pinfuncgrpcnt: number of pingroups in @pingroups.
  460. * @pinfuncs: pointer to an array of pin functions this driver manages.
  461. * @pinfuncnt: number of pin functions in @pinfuncs.
  462. * @mutex: mutex for exclusive access to a pin controller's state.
  463. * @ports: current state of each port.
  464. * @gpios: Indicates if a given pin is currently used as GPIO (1) or not (0).
  465. */
  466. struct tb10x_pinctrl {
  467. struct pinctrl_dev *pctl;
  468. void *base;
  469. const struct tb10x_pinfuncgrp *pingroups;
  470. unsigned int pinfuncgrpcnt;
  471. struct tb10x_of_pinfunc *pinfuncs;
  472. unsigned int pinfuncnt;
  473. struct mutex mutex;
  474. struct tb10x_port ports[TB10X_PORTS];
  475. DECLARE_BITMAP(gpios, MAX_PIN + 1);
  476. };
  477. static inline void tb10x_pinctrl_set_config(struct tb10x_pinctrl *state,
  478. unsigned int port, unsigned int mode)
  479. {
  480. u32 pcfg;
  481. if (state->ports[port].count)
  482. return;
  483. state->ports[port].mode = mode;
  484. pcfg = ioread32(state->base) & ~(PCFG_PORT_MASK(port));
  485. pcfg |= (mode << (PCFG_PORT_BITWIDTH * port)) & PCFG_PORT_MASK(port);
  486. iowrite32(pcfg, state->base);
  487. }
  488. static inline unsigned int tb10x_pinctrl_get_config(
  489. struct tb10x_pinctrl *state,
  490. unsigned int port)
  491. {
  492. return (ioread32(state->base) & PCFG_PORT_MASK(port))
  493. >> (PCFG_PORT_BITWIDTH * port);
  494. }
  495. static int tb10x_get_groups_count(struct pinctrl_dev *pctl)
  496. {
  497. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  498. return state->pinfuncgrpcnt;
  499. }
  500. static const char *tb10x_get_group_name(struct pinctrl_dev *pctl, unsigned n)
  501. {
  502. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  503. return state->pingroups[n].name;
  504. }
  505. static int tb10x_get_group_pins(struct pinctrl_dev *pctl, unsigned n,
  506. unsigned const **pins,
  507. unsigned * const num_pins)
  508. {
  509. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  510. *pins = state->pingroups[n].pins;
  511. *num_pins = state->pingroups[n].pincnt;
  512. return 0;
  513. }
  514. static int tb10x_dt_node_to_map(struct pinctrl_dev *pctl,
  515. struct device_node *np_config,
  516. struct pinctrl_map **map, unsigned *num_maps)
  517. {
  518. const char *string;
  519. unsigned reserved_maps = 0;
  520. int ret = 0;
  521. if (of_property_read_string(np_config, "abilis,function", &string)) {
  522. pr_err("%pOF: No abilis,function property in device tree.\n",
  523. np_config);
  524. return -EINVAL;
  525. }
  526. *map = NULL;
  527. *num_maps = 0;
  528. ret = pinctrl_utils_reserve_map(pctl, map, &reserved_maps,
  529. num_maps, 1);
  530. if (ret)
  531. goto out;
  532. ret = pinctrl_utils_add_map_mux(pctl, map, &reserved_maps,
  533. num_maps, string, np_config->name);
  534. out:
  535. return ret;
  536. }
  537. static const struct pinctrl_ops tb10x_pinctrl_ops = {
  538. .get_groups_count = tb10x_get_groups_count,
  539. .get_group_name = tb10x_get_group_name,
  540. .get_group_pins = tb10x_get_group_pins,
  541. .dt_node_to_map = tb10x_dt_node_to_map,
  542. .dt_free_map = pinctrl_utils_free_map,
  543. };
  544. static int tb10x_get_functions_count(struct pinctrl_dev *pctl)
  545. {
  546. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  547. return state->pinfuncnt;
  548. }
  549. static const char *tb10x_get_function_name(struct pinctrl_dev *pctl,
  550. unsigned n)
  551. {
  552. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  553. return state->pinfuncs[n].name;
  554. }
  555. static int tb10x_get_function_groups(struct pinctrl_dev *pctl,
  556. unsigned n, const char * const **groups,
  557. unsigned * const num_groups)
  558. {
  559. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  560. *groups = &state->pinfuncs[n].group;
  561. *num_groups = 1;
  562. return 0;
  563. }
  564. static int tb10x_gpio_request_enable(struct pinctrl_dev *pctl,
  565. struct pinctrl_gpio_range *range,
  566. unsigned pin)
  567. {
  568. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  569. int muxport = -1;
  570. int muxmode = -1;
  571. int i;
  572. mutex_lock(&state->mutex);
  573. /*
  574. * Figure out to which port the requested GPIO belongs and how to
  575. * configure that port.
  576. * This loop also checks for pin conflicts between GPIOs and other
  577. * functions.
  578. */
  579. for (i = 0; i < state->pinfuncgrpcnt; i++) {
  580. const struct tb10x_pinfuncgrp *pfg = &state->pingroups[i];
  581. unsigned int mode = pfg->mode;
  582. int j, port = pfg->port;
  583. /*
  584. * Skip pin groups which are always mapped and don't need
  585. * to be configured.
  586. */
  587. if (port < 0)
  588. continue;
  589. for (j = 0; j < pfg->pincnt; j++) {
  590. if (pin == pfg->pins[j]) {
  591. if (pfg->isgpio) {
  592. /*
  593. * Remember the GPIO-only setting of
  594. * the port this pin belongs to.
  595. */
  596. muxport = port;
  597. muxmode = mode;
  598. } else if (state->ports[port].count
  599. && (state->ports[port].mode == mode)) {
  600. /*
  601. * Error: The requested pin is already
  602. * used for something else.
  603. */
  604. mutex_unlock(&state->mutex);
  605. return -EBUSY;
  606. }
  607. break;
  608. }
  609. }
  610. }
  611. /*
  612. * If we haven't returned an error at this point, the GPIO pin is not
  613. * used by another function and the GPIO request can be granted:
  614. * Register pin as being used as GPIO so we don't allocate it to
  615. * another function later.
  616. */
  617. set_bit(pin, state->gpios);
  618. /*
  619. * Potential conflicts between GPIOs and pin functions were caught
  620. * earlier in this function and tb10x_pinctrl_set_config will do the
  621. * Right Thing, either configure the port in GPIO only mode or leave
  622. * another mode compatible with this GPIO request untouched.
  623. */
  624. if (muxport >= 0)
  625. tb10x_pinctrl_set_config(state, muxport, muxmode);
  626. mutex_unlock(&state->mutex);
  627. return 0;
  628. }
  629. static void tb10x_gpio_disable_free(struct pinctrl_dev *pctl,
  630. struct pinctrl_gpio_range *range,
  631. unsigned pin)
  632. {
  633. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  634. mutex_lock(&state->mutex);
  635. clear_bit(pin, state->gpios);
  636. mutex_unlock(&state->mutex);
  637. }
  638. static int tb10x_pctl_set_mux(struct pinctrl_dev *pctl,
  639. unsigned func_selector, unsigned group_selector)
  640. {
  641. struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
  642. const struct tb10x_pinfuncgrp *grp = &state->pingroups[group_selector];
  643. int i;
  644. if (grp->port < 0)
  645. return 0;
  646. mutex_lock(&state->mutex);
  647. /*
  648. * Check if the requested function is compatible with previously
  649. * requested functions.
  650. */
  651. if (state->ports[grp->port].count
  652. && (state->ports[grp->port].mode != grp->mode)) {
  653. mutex_unlock(&state->mutex);
  654. return -EBUSY;
  655. }
  656. /*
  657. * Check if the requested function is compatible with previously
  658. * requested GPIOs.
  659. */
  660. for (i = 0; i < grp->pincnt; i++)
  661. if (test_bit(grp->pins[i], state->gpios)) {
  662. mutex_unlock(&state->mutex);
  663. return -EBUSY;
  664. }
  665. tb10x_pinctrl_set_config(state, grp->port, grp->mode);
  666. state->ports[grp->port].count++;
  667. mutex_unlock(&state->mutex);
  668. return 0;
  669. }
  670. static const struct pinmux_ops tb10x_pinmux_ops = {
  671. .get_functions_count = tb10x_get_functions_count,
  672. .get_function_name = tb10x_get_function_name,
  673. .get_function_groups = tb10x_get_function_groups,
  674. .gpio_request_enable = tb10x_gpio_request_enable,
  675. .gpio_disable_free = tb10x_gpio_disable_free,
  676. .set_mux = tb10x_pctl_set_mux,
  677. };
  678. static struct pinctrl_desc tb10x_pindesc = {
  679. .name = "TB10x",
  680. .pins = tb10x_pins,
  681. .npins = ARRAY_SIZE(tb10x_pins),
  682. .owner = THIS_MODULE,
  683. .pctlops = &tb10x_pinctrl_ops,
  684. .pmxops = &tb10x_pinmux_ops,
  685. };
  686. static int tb10x_pinctrl_probe(struct platform_device *pdev)
  687. {
  688. int ret = -EINVAL;
  689. struct resource *mem;
  690. struct device *dev = &pdev->dev;
  691. struct device_node *of_node = dev->of_node;
  692. struct device_node *child;
  693. struct tb10x_pinctrl *state;
  694. int i;
  695. if (!of_node) {
  696. dev_err(dev, "No device tree node found.\n");
  697. return -EINVAL;
  698. }
  699. state = devm_kzalloc(dev, sizeof(struct tb10x_pinctrl) +
  700. of_get_child_count(of_node)
  701. * sizeof(struct tb10x_of_pinfunc),
  702. GFP_KERNEL);
  703. if (!state)
  704. return -ENOMEM;
  705. platform_set_drvdata(pdev, state);
  706. state->pinfuncs = (struct tb10x_of_pinfunc *)(state + 1);
  707. mutex_init(&state->mutex);
  708. mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  709. state->base = devm_ioremap_resource(dev, mem);
  710. if (IS_ERR(state->base)) {
  711. ret = PTR_ERR(state->base);
  712. goto fail;
  713. }
  714. state->pingroups = tb10x_pingroups;
  715. state->pinfuncgrpcnt = ARRAY_SIZE(tb10x_pingroups);
  716. for (i = 0; i < TB10X_PORTS; i++)
  717. state->ports[i].mode = tb10x_pinctrl_get_config(state, i);
  718. for_each_child_of_node(of_node, child) {
  719. const char *name;
  720. if (!of_property_read_string(child, "abilis,function",
  721. &name)) {
  722. state->pinfuncs[state->pinfuncnt].name = child->name;
  723. state->pinfuncs[state->pinfuncnt].group = name;
  724. state->pinfuncnt++;
  725. }
  726. }
  727. state->pctl = devm_pinctrl_register(dev, &tb10x_pindesc, state);
  728. if (IS_ERR(state->pctl)) {
  729. dev_err(dev, "could not register TB10x pin driver\n");
  730. ret = PTR_ERR(state->pctl);
  731. goto fail;
  732. }
  733. return 0;
  734. fail:
  735. mutex_destroy(&state->mutex);
  736. return ret;
  737. }
  738. static int tb10x_pinctrl_remove(struct platform_device *pdev)
  739. {
  740. struct tb10x_pinctrl *state = platform_get_drvdata(pdev);
  741. mutex_destroy(&state->mutex);
  742. return 0;
  743. }
  744. static const struct of_device_id tb10x_pinctrl_dt_ids[] = {
  745. { .compatible = "abilis,tb10x-iomux" },
  746. { }
  747. };
  748. MODULE_DEVICE_TABLE(of, tb10x_pinctrl_dt_ids);
  749. static struct platform_driver tb10x_pinctrl_pdrv = {
  750. .probe = tb10x_pinctrl_probe,
  751. .remove = tb10x_pinctrl_remove,
  752. .driver = {
  753. .name = "tb10x_pinctrl",
  754. .of_match_table = of_match_ptr(tb10x_pinctrl_dt_ids),
  755. }
  756. };
  757. module_platform_driver(tb10x_pinctrl_pdrv);
  758. MODULE_AUTHOR("Christian Ruppert <christian.ruppert@abilis.com>");
  759. MODULE_LICENSE("GPL");