pinctrl-imx7d.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /*
  2. * Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/err.h>
  9. #include <linux/init.h>
  10. #include <linux/io.h>
  11. #include <linux/module.h>
  12. #include <linux/of.h>
  13. #include <linux/of_device.h>
  14. #include <linux/pinctrl/pinctrl.h>
  15. #include "pinctrl-imx.h"
  16. enum imx7d_pads {
  17. MX7D_PAD_RESERVE0 = 0,
  18. MX7D_PAD_RESERVE1 = 1,
  19. MX7D_PAD_RESERVE2 = 2,
  20. MX7D_PAD_RESERVE3 = 3,
  21. MX7D_PAD_RESERVE4 = 4,
  22. MX7D_PAD_GPIO1_IO08 = 5,
  23. MX7D_PAD_GPIO1_IO09 = 6,
  24. MX7D_PAD_GPIO1_IO10 = 7,
  25. MX7D_PAD_GPIO1_IO11 = 8,
  26. MX7D_PAD_GPIO1_IO12 = 9,
  27. MX7D_PAD_GPIO1_IO13 = 10,
  28. MX7D_PAD_GPIO1_IO14 = 11,
  29. MX7D_PAD_GPIO1_IO15 = 12,
  30. MX7D_PAD_EPDC_DATA00 = 13,
  31. MX7D_PAD_EPDC_DATA01 = 14,
  32. MX7D_PAD_EPDC_DATA02 = 15,
  33. MX7D_PAD_EPDC_DATA03 = 16,
  34. MX7D_PAD_EPDC_DATA04 = 17,
  35. MX7D_PAD_EPDC_DATA05 = 18,
  36. MX7D_PAD_EPDC_DATA06 = 19,
  37. MX7D_PAD_EPDC_DATA07 = 20,
  38. MX7D_PAD_EPDC_DATA08 = 21,
  39. MX7D_PAD_EPDC_DATA09 = 22,
  40. MX7D_PAD_EPDC_DATA10 = 23,
  41. MX7D_PAD_EPDC_DATA11 = 24,
  42. MX7D_PAD_EPDC_DATA12 = 25,
  43. MX7D_PAD_EPDC_DATA13 = 26,
  44. MX7D_PAD_EPDC_DATA14 = 27,
  45. MX7D_PAD_EPDC_DATA15 = 28,
  46. MX7D_PAD_EPDC_SDCLK = 29,
  47. MX7D_PAD_EPDC_SDLE = 30,
  48. MX7D_PAD_EPDC_SDOE = 31,
  49. MX7D_PAD_EPDC_SDSHR = 32,
  50. MX7D_PAD_EPDC_SDCE0 = 33,
  51. MX7D_PAD_EPDC_SDCE1 = 34,
  52. MX7D_PAD_EPDC_SDCE2 = 35,
  53. MX7D_PAD_EPDC_SDCE3 = 36,
  54. MX7D_PAD_EPDC_GDCLK = 37,
  55. MX7D_PAD_EPDC_GDOE = 38,
  56. MX7D_PAD_EPDC_GDRL = 39,
  57. MX7D_PAD_EPDC_GDSP = 40,
  58. MX7D_PAD_EPDC_BDR0 = 41,
  59. MX7D_PAD_EPDC_BDR1 = 42,
  60. MX7D_PAD_EPDC_PWR_COM = 43,
  61. MX7D_PAD_EPDC_PWR_STAT = 44,
  62. MX7D_PAD_LCD_CLK = 45,
  63. MX7D_PAD_LCD_ENABLE = 46,
  64. MX7D_PAD_LCD_HSYNC = 47,
  65. MX7D_PAD_LCD_VSYNC = 48,
  66. MX7D_PAD_LCD_RESET = 49,
  67. MX7D_PAD_LCD_DATA00 = 50,
  68. MX7D_PAD_LCD_DATA01 = 51,
  69. MX7D_PAD_LCD_DATA02 = 52,
  70. MX7D_PAD_LCD_DATA03 = 53,
  71. MX7D_PAD_LCD_DATA04 = 54,
  72. MX7D_PAD_LCD_DATA05 = 55,
  73. MX7D_PAD_LCD_DATA06 = 56,
  74. MX7D_PAD_LCD_DATA07 = 57,
  75. MX7D_PAD_LCD_DATA08 = 58,
  76. MX7D_PAD_LCD_DATA09 = 59,
  77. MX7D_PAD_LCD_DATA10 = 60,
  78. MX7D_PAD_LCD_DATA11 = 61,
  79. MX7D_PAD_LCD_DATA12 = 62,
  80. MX7D_PAD_LCD_DATA13 = 63,
  81. MX7D_PAD_LCD_DATA14 = 64,
  82. MX7D_PAD_LCD_DATA15 = 65,
  83. MX7D_PAD_LCD_DATA16 = 66,
  84. MX7D_PAD_LCD_DATA17 = 67,
  85. MX7D_PAD_LCD_DATA18 = 68,
  86. MX7D_PAD_LCD_DATA19 = 69,
  87. MX7D_PAD_LCD_DATA20 = 70,
  88. MX7D_PAD_LCD_DATA21 = 71,
  89. MX7D_PAD_LCD_DATA22 = 72,
  90. MX7D_PAD_LCD_DATA23 = 73,
  91. MX7D_PAD_UART1_RX_DATA = 74,
  92. MX7D_PAD_UART1_TX_DATA = 75,
  93. MX7D_PAD_UART2_RX_DATA = 76,
  94. MX7D_PAD_UART2_TX_DATA = 77,
  95. MX7D_PAD_UART3_RX_DATA = 78,
  96. MX7D_PAD_UART3_TX_DATA = 79,
  97. MX7D_PAD_UART3_RTS_B = 80,
  98. MX7D_PAD_UART3_CTS_B = 81,
  99. MX7D_PAD_I2C1_SCL = 82,
  100. MX7D_PAD_I2C1_SDA = 83,
  101. MX7D_PAD_I2C2_SCL = 84,
  102. MX7D_PAD_I2C2_SDA = 85,
  103. MX7D_PAD_I2C3_SCL = 86,
  104. MX7D_PAD_I2C3_SDA = 87,
  105. MX7D_PAD_I2C4_SCL = 88,
  106. MX7D_PAD_I2C4_SDA = 89,
  107. MX7D_PAD_ECSPI1_SCLK = 90,
  108. MX7D_PAD_ECSPI1_MOSI = 91,
  109. MX7D_PAD_ECSPI1_MISO = 92,
  110. MX7D_PAD_ECSPI1_SS0 = 93,
  111. MX7D_PAD_ECSPI2_SCLK = 94,
  112. MX7D_PAD_ECSPI2_MOSI = 95,
  113. MX7D_PAD_ECSPI2_MISO = 96,
  114. MX7D_PAD_ECSPI2_SS0 = 97,
  115. MX7D_PAD_SD1_CD_B = 98,
  116. MX7D_PAD_SD1_WP = 99,
  117. MX7D_PAD_SD1_RESET_B = 100,
  118. MX7D_PAD_SD1_CLK = 101,
  119. MX7D_PAD_SD1_CMD = 102,
  120. MX7D_PAD_SD1_DATA0 = 103,
  121. MX7D_PAD_SD1_DATA1 = 104,
  122. MX7D_PAD_SD1_DATA2 = 105,
  123. MX7D_PAD_SD1_DATA3 = 106,
  124. MX7D_PAD_SD2_CD_B = 107,
  125. MX7D_PAD_SD2_WP = 108,
  126. MX7D_PAD_SD2_RESET_B = 109,
  127. MX7D_PAD_SD2_CLK = 110,
  128. MX7D_PAD_SD2_CMD = 111,
  129. MX7D_PAD_SD2_DATA0 = 112,
  130. MX7D_PAD_SD2_DATA1 = 113,
  131. MX7D_PAD_SD2_DATA2 = 114,
  132. MX7D_PAD_SD2_DATA3 = 115,
  133. MX7D_PAD_SD3_CLK = 116,
  134. MX7D_PAD_SD3_CMD = 117,
  135. MX7D_PAD_SD3_DATA0 = 118,
  136. MX7D_PAD_SD3_DATA1 = 119,
  137. MX7D_PAD_SD3_DATA2 = 120,
  138. MX7D_PAD_SD3_DATA3 = 121,
  139. MX7D_PAD_SD3_DATA4 = 122,
  140. MX7D_PAD_SD3_DATA5 = 123,
  141. MX7D_PAD_SD3_DATA6 = 124,
  142. MX7D_PAD_SD3_DATA7 = 125,
  143. MX7D_PAD_SD3_STROBE = 126,
  144. MX7D_PAD_SD3_RESET_B = 127,
  145. MX7D_PAD_SAI1_RX_DATA = 128,
  146. MX7D_PAD_SAI1_TX_BCLK = 129,
  147. MX7D_PAD_SAI1_TX_SYNC = 130,
  148. MX7D_PAD_SAI1_TX_DATA = 131,
  149. MX7D_PAD_SAI1_RX_SYNC = 132,
  150. MX7D_PAD_SAI1_RX_BCLK = 133,
  151. MX7D_PAD_SAI1_MCLK = 134,
  152. MX7D_PAD_SAI2_TX_SYNC = 135,
  153. MX7D_PAD_SAI2_TX_BCLK = 136,
  154. MX7D_PAD_SAI2_RX_DATA = 137,
  155. MX7D_PAD_SAI2_TX_DATA = 138,
  156. MX7D_PAD_ENET1_RGMII_RD0 = 139,
  157. MX7D_PAD_ENET1_RGMII_RD1 = 140,
  158. MX7D_PAD_ENET1_RGMII_RD2 = 141,
  159. MX7D_PAD_ENET1_RGMII_RD3 = 142,
  160. MX7D_PAD_ENET1_RGMII_RX_CTL = 143,
  161. MX7D_PAD_ENET1_RGMII_RXC = 144,
  162. MX7D_PAD_ENET1_RGMII_TD0 = 145,
  163. MX7D_PAD_ENET1_RGMII_TD1 = 146,
  164. MX7D_PAD_ENET1_RGMII_TD2 = 147,
  165. MX7D_PAD_ENET1_RGMII_TD3 = 148,
  166. MX7D_PAD_ENET1_RGMII_TX_CTL = 149,
  167. MX7D_PAD_ENET1_RGMII_TXC = 150,
  168. MX7D_PAD_ENET1_TX_CLK = 151,
  169. MX7D_PAD_ENET1_RX_CLK = 152,
  170. MX7D_PAD_ENET1_CRS = 153,
  171. MX7D_PAD_ENET1_COL = 154,
  172. };
  173. enum imx7d_lpsr_pads {
  174. MX7D_PAD_GPIO1_IO00 = 0,
  175. MX7D_PAD_GPIO1_IO01 = 1,
  176. MX7D_PAD_GPIO1_IO02 = 2,
  177. MX7D_PAD_GPIO1_IO03 = 3,
  178. MX7D_PAD_GPIO1_IO04 = 4,
  179. MX7D_PAD_GPIO1_IO05 = 5,
  180. MX7D_PAD_GPIO1_IO06 = 6,
  181. MX7D_PAD_GPIO1_IO07 = 7,
  182. };
  183. /* Pad names for the pinmux subsystem */
  184. static const struct pinctrl_pin_desc imx7d_pinctrl_pads[] = {
  185. IMX_PINCTRL_PIN(MX7D_PAD_RESERVE0),
  186. IMX_PINCTRL_PIN(MX7D_PAD_RESERVE1),
  187. IMX_PINCTRL_PIN(MX7D_PAD_RESERVE2),
  188. IMX_PINCTRL_PIN(MX7D_PAD_RESERVE3),
  189. IMX_PINCTRL_PIN(MX7D_PAD_RESERVE4),
  190. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO08),
  191. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO09),
  192. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO10),
  193. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO11),
  194. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO12),
  195. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO13),
  196. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO14),
  197. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO15),
  198. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA00),
  199. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA01),
  200. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA02),
  201. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA03),
  202. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA04),
  203. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA05),
  204. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA06),
  205. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA07),
  206. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA08),
  207. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA09),
  208. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA10),
  209. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA11),
  210. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA12),
  211. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA13),
  212. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA14),
  213. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_DATA15),
  214. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDCLK),
  215. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDLE),
  216. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDOE),
  217. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDSHR),
  218. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDCE0),
  219. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDCE1),
  220. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDCE2),
  221. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_SDCE3),
  222. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_GDCLK),
  223. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_GDOE),
  224. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_GDRL),
  225. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_GDSP),
  226. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_BDR0),
  227. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_BDR1),
  228. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_PWR_COM),
  229. IMX_PINCTRL_PIN(MX7D_PAD_EPDC_PWR_STAT),
  230. IMX_PINCTRL_PIN(MX7D_PAD_LCD_CLK),
  231. IMX_PINCTRL_PIN(MX7D_PAD_LCD_ENABLE),
  232. IMX_PINCTRL_PIN(MX7D_PAD_LCD_HSYNC),
  233. IMX_PINCTRL_PIN(MX7D_PAD_LCD_VSYNC),
  234. IMX_PINCTRL_PIN(MX7D_PAD_LCD_RESET),
  235. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA00),
  236. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA01),
  237. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA02),
  238. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA03),
  239. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA04),
  240. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA05),
  241. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA06),
  242. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA07),
  243. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA08),
  244. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA09),
  245. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA10),
  246. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA11),
  247. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA12),
  248. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA13),
  249. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA14),
  250. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA15),
  251. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA16),
  252. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA17),
  253. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA18),
  254. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA19),
  255. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA20),
  256. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA21),
  257. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA22),
  258. IMX_PINCTRL_PIN(MX7D_PAD_LCD_DATA23),
  259. IMX_PINCTRL_PIN(MX7D_PAD_UART1_RX_DATA),
  260. IMX_PINCTRL_PIN(MX7D_PAD_UART1_TX_DATA),
  261. IMX_PINCTRL_PIN(MX7D_PAD_UART2_RX_DATA),
  262. IMX_PINCTRL_PIN(MX7D_PAD_UART2_TX_DATA),
  263. IMX_PINCTRL_PIN(MX7D_PAD_UART3_RX_DATA),
  264. IMX_PINCTRL_PIN(MX7D_PAD_UART3_TX_DATA),
  265. IMX_PINCTRL_PIN(MX7D_PAD_UART3_RTS_B),
  266. IMX_PINCTRL_PIN(MX7D_PAD_UART3_CTS_B),
  267. IMX_PINCTRL_PIN(MX7D_PAD_I2C1_SCL),
  268. IMX_PINCTRL_PIN(MX7D_PAD_I2C1_SDA),
  269. IMX_PINCTRL_PIN(MX7D_PAD_I2C2_SCL),
  270. IMX_PINCTRL_PIN(MX7D_PAD_I2C2_SDA),
  271. IMX_PINCTRL_PIN(MX7D_PAD_I2C3_SCL),
  272. IMX_PINCTRL_PIN(MX7D_PAD_I2C3_SDA),
  273. IMX_PINCTRL_PIN(MX7D_PAD_I2C4_SCL),
  274. IMX_PINCTRL_PIN(MX7D_PAD_I2C4_SDA),
  275. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI1_SCLK),
  276. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI1_MOSI),
  277. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI1_MISO),
  278. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI1_SS0),
  279. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI2_SCLK),
  280. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI2_MOSI),
  281. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI2_MISO),
  282. IMX_PINCTRL_PIN(MX7D_PAD_ECSPI2_SS0),
  283. IMX_PINCTRL_PIN(MX7D_PAD_SD1_CD_B),
  284. IMX_PINCTRL_PIN(MX7D_PAD_SD1_WP),
  285. IMX_PINCTRL_PIN(MX7D_PAD_SD1_RESET_B),
  286. IMX_PINCTRL_PIN(MX7D_PAD_SD1_CLK),
  287. IMX_PINCTRL_PIN(MX7D_PAD_SD1_CMD),
  288. IMX_PINCTRL_PIN(MX7D_PAD_SD1_DATA0),
  289. IMX_PINCTRL_PIN(MX7D_PAD_SD1_DATA1),
  290. IMX_PINCTRL_PIN(MX7D_PAD_SD1_DATA2),
  291. IMX_PINCTRL_PIN(MX7D_PAD_SD1_DATA3),
  292. IMX_PINCTRL_PIN(MX7D_PAD_SD2_CD_B),
  293. IMX_PINCTRL_PIN(MX7D_PAD_SD2_WP),
  294. IMX_PINCTRL_PIN(MX7D_PAD_SD2_RESET_B),
  295. IMX_PINCTRL_PIN(MX7D_PAD_SD2_CLK),
  296. IMX_PINCTRL_PIN(MX7D_PAD_SD2_CMD),
  297. IMX_PINCTRL_PIN(MX7D_PAD_SD2_DATA0),
  298. IMX_PINCTRL_PIN(MX7D_PAD_SD2_DATA1),
  299. IMX_PINCTRL_PIN(MX7D_PAD_SD2_DATA2),
  300. IMX_PINCTRL_PIN(MX7D_PAD_SD2_DATA3),
  301. IMX_PINCTRL_PIN(MX7D_PAD_SD3_CLK),
  302. IMX_PINCTRL_PIN(MX7D_PAD_SD3_CMD),
  303. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA0),
  304. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA1),
  305. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA2),
  306. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA3),
  307. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA4),
  308. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA5),
  309. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA6),
  310. IMX_PINCTRL_PIN(MX7D_PAD_SD3_DATA7),
  311. IMX_PINCTRL_PIN(MX7D_PAD_SD3_STROBE),
  312. IMX_PINCTRL_PIN(MX7D_PAD_SD3_RESET_B),
  313. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_RX_DATA),
  314. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_TX_BCLK),
  315. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_TX_SYNC),
  316. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_TX_DATA),
  317. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_RX_SYNC),
  318. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_RX_BCLK),
  319. IMX_PINCTRL_PIN(MX7D_PAD_SAI1_MCLK),
  320. IMX_PINCTRL_PIN(MX7D_PAD_SAI2_TX_SYNC),
  321. IMX_PINCTRL_PIN(MX7D_PAD_SAI2_TX_BCLK),
  322. IMX_PINCTRL_PIN(MX7D_PAD_SAI2_RX_DATA),
  323. IMX_PINCTRL_PIN(MX7D_PAD_SAI2_TX_DATA),
  324. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_RD0),
  325. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_RD1),
  326. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_RD2),
  327. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_RD3),
  328. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_RX_CTL),
  329. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_RXC),
  330. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_TD0),
  331. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_TD1),
  332. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_TD2),
  333. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_TD3),
  334. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_TX_CTL),
  335. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RGMII_TXC),
  336. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_TX_CLK),
  337. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_RX_CLK),
  338. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_CRS),
  339. IMX_PINCTRL_PIN(MX7D_PAD_ENET1_COL),
  340. };
  341. /* Pad names for the pinmux subsystem */
  342. static const struct pinctrl_pin_desc imx7d_lpsr_pinctrl_pads[] = {
  343. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO00),
  344. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO01),
  345. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO02),
  346. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO03),
  347. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO04),
  348. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO05),
  349. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO06),
  350. IMX_PINCTRL_PIN(MX7D_PAD_GPIO1_IO07),
  351. };
  352. static struct imx_pinctrl_soc_info imx7d_pinctrl_info = {
  353. .pins = imx7d_pinctrl_pads,
  354. .npins = ARRAY_SIZE(imx7d_pinctrl_pads),
  355. };
  356. static struct imx_pinctrl_soc_info imx7d_lpsr_pinctrl_info = {
  357. .pins = imx7d_lpsr_pinctrl_pads,
  358. .npins = ARRAY_SIZE(imx7d_lpsr_pinctrl_pads),
  359. .flags = ZERO_OFFSET_VALID,
  360. };
  361. static struct of_device_id imx7d_pinctrl_of_match[] = {
  362. { .compatible = "fsl,imx7d-iomuxc", .data = &imx7d_pinctrl_info, },
  363. { .compatible = "fsl,imx7d-iomuxc-lpsr", .data = &imx7d_lpsr_pinctrl_info },
  364. { /* sentinel */ }
  365. };
  366. static int imx7d_pinctrl_probe(struct platform_device *pdev)
  367. {
  368. const struct of_device_id *match;
  369. struct imx_pinctrl_soc_info *pinctrl_info;
  370. match = of_match_device(imx7d_pinctrl_of_match, &pdev->dev);
  371. if (!match)
  372. return -ENODEV;
  373. pinctrl_info = (struct imx_pinctrl_soc_info *) match->data;
  374. return imx_pinctrl_probe(pdev, pinctrl_info);
  375. }
  376. static struct platform_driver imx7d_pinctrl_driver = {
  377. .driver = {
  378. .name = "imx7d-pinctrl",
  379. .of_match_table = of_match_ptr(imx7d_pinctrl_of_match),
  380. },
  381. .probe = imx7d_pinctrl_probe,
  382. .remove = imx_pinctrl_remove,
  383. };
  384. static int __init imx7d_pinctrl_init(void)
  385. {
  386. return platform_driver_register(&imx7d_pinctrl_driver);
  387. }
  388. arch_initcall(imx7d_pinctrl_init);
  389. static void __exit imx7d_pinctrl_exit(void)
  390. {
  391. platform_driver_unregister(&imx7d_pinctrl_driver);
  392. }
  393. module_exit(imx7d_pinctrl_exit);
  394. MODULE_AUTHOR("Anson Huang <Anson.Huang@freescale.com>");
  395. MODULE_DESCRIPTION("Freescale imx7d pinctrl driver");
  396. MODULE_LICENSE("GPL v2");