pinctrl-spear3xx.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /*
  2. * Driver for the ST Microelectronics SPEAr3xx pinmux
  3. *
  4. * Copyright (C) 2012 ST Microelectronics
  5. * Viresh Kumar <viresh.kumar@st.com>
  6. *
  7. * This file is licensed under the terms of the GNU General Public
  8. * License version 2. This program is licensed "as is" without any
  9. * warranty of any kind, whether express or implied.
  10. */
  11. #include <linux/pinctrl/pinctrl.h>
  12. #include "pinctrl-spear3xx.h"
  13. /* pins */
  14. static const struct pinctrl_pin_desc spear3xx_pins[] = {
  15. PINCTRL_PIN(0, "PLGPIO0"),
  16. PINCTRL_PIN(1, "PLGPIO1"),
  17. PINCTRL_PIN(2, "PLGPIO2"),
  18. PINCTRL_PIN(3, "PLGPIO3"),
  19. PINCTRL_PIN(4, "PLGPIO4"),
  20. PINCTRL_PIN(5, "PLGPIO5"),
  21. PINCTRL_PIN(6, "PLGPIO6"),
  22. PINCTRL_PIN(7, "PLGPIO7"),
  23. PINCTRL_PIN(8, "PLGPIO8"),
  24. PINCTRL_PIN(9, "PLGPIO9"),
  25. PINCTRL_PIN(10, "PLGPIO10"),
  26. PINCTRL_PIN(11, "PLGPIO11"),
  27. PINCTRL_PIN(12, "PLGPIO12"),
  28. PINCTRL_PIN(13, "PLGPIO13"),
  29. PINCTRL_PIN(14, "PLGPIO14"),
  30. PINCTRL_PIN(15, "PLGPIO15"),
  31. PINCTRL_PIN(16, "PLGPIO16"),
  32. PINCTRL_PIN(17, "PLGPIO17"),
  33. PINCTRL_PIN(18, "PLGPIO18"),
  34. PINCTRL_PIN(19, "PLGPIO19"),
  35. PINCTRL_PIN(20, "PLGPIO20"),
  36. PINCTRL_PIN(21, "PLGPIO21"),
  37. PINCTRL_PIN(22, "PLGPIO22"),
  38. PINCTRL_PIN(23, "PLGPIO23"),
  39. PINCTRL_PIN(24, "PLGPIO24"),
  40. PINCTRL_PIN(25, "PLGPIO25"),
  41. PINCTRL_PIN(26, "PLGPIO26"),
  42. PINCTRL_PIN(27, "PLGPIO27"),
  43. PINCTRL_PIN(28, "PLGPIO28"),
  44. PINCTRL_PIN(29, "PLGPIO29"),
  45. PINCTRL_PIN(30, "PLGPIO30"),
  46. PINCTRL_PIN(31, "PLGPIO31"),
  47. PINCTRL_PIN(32, "PLGPIO32"),
  48. PINCTRL_PIN(33, "PLGPIO33"),
  49. PINCTRL_PIN(34, "PLGPIO34"),
  50. PINCTRL_PIN(35, "PLGPIO35"),
  51. PINCTRL_PIN(36, "PLGPIO36"),
  52. PINCTRL_PIN(37, "PLGPIO37"),
  53. PINCTRL_PIN(38, "PLGPIO38"),
  54. PINCTRL_PIN(39, "PLGPIO39"),
  55. PINCTRL_PIN(40, "PLGPIO40"),
  56. PINCTRL_PIN(41, "PLGPIO41"),
  57. PINCTRL_PIN(42, "PLGPIO42"),
  58. PINCTRL_PIN(43, "PLGPIO43"),
  59. PINCTRL_PIN(44, "PLGPIO44"),
  60. PINCTRL_PIN(45, "PLGPIO45"),
  61. PINCTRL_PIN(46, "PLGPIO46"),
  62. PINCTRL_PIN(47, "PLGPIO47"),
  63. PINCTRL_PIN(48, "PLGPIO48"),
  64. PINCTRL_PIN(49, "PLGPIO49"),
  65. PINCTRL_PIN(50, "PLGPIO50"),
  66. PINCTRL_PIN(51, "PLGPIO51"),
  67. PINCTRL_PIN(52, "PLGPIO52"),
  68. PINCTRL_PIN(53, "PLGPIO53"),
  69. PINCTRL_PIN(54, "PLGPIO54"),
  70. PINCTRL_PIN(55, "PLGPIO55"),
  71. PINCTRL_PIN(56, "PLGPIO56"),
  72. PINCTRL_PIN(57, "PLGPIO57"),
  73. PINCTRL_PIN(58, "PLGPIO58"),
  74. PINCTRL_PIN(59, "PLGPIO59"),
  75. PINCTRL_PIN(60, "PLGPIO60"),
  76. PINCTRL_PIN(61, "PLGPIO61"),
  77. PINCTRL_PIN(62, "PLGPIO62"),
  78. PINCTRL_PIN(63, "PLGPIO63"),
  79. PINCTRL_PIN(64, "PLGPIO64"),
  80. PINCTRL_PIN(65, "PLGPIO65"),
  81. PINCTRL_PIN(66, "PLGPIO66"),
  82. PINCTRL_PIN(67, "PLGPIO67"),
  83. PINCTRL_PIN(68, "PLGPIO68"),
  84. PINCTRL_PIN(69, "PLGPIO69"),
  85. PINCTRL_PIN(70, "PLGPIO70"),
  86. PINCTRL_PIN(71, "PLGPIO71"),
  87. PINCTRL_PIN(72, "PLGPIO72"),
  88. PINCTRL_PIN(73, "PLGPIO73"),
  89. PINCTRL_PIN(74, "PLGPIO74"),
  90. PINCTRL_PIN(75, "PLGPIO75"),
  91. PINCTRL_PIN(76, "PLGPIO76"),
  92. PINCTRL_PIN(77, "PLGPIO77"),
  93. PINCTRL_PIN(78, "PLGPIO78"),
  94. PINCTRL_PIN(79, "PLGPIO79"),
  95. PINCTRL_PIN(80, "PLGPIO80"),
  96. PINCTRL_PIN(81, "PLGPIO81"),
  97. PINCTRL_PIN(82, "PLGPIO82"),
  98. PINCTRL_PIN(83, "PLGPIO83"),
  99. PINCTRL_PIN(84, "PLGPIO84"),
  100. PINCTRL_PIN(85, "PLGPIO85"),
  101. PINCTRL_PIN(86, "PLGPIO86"),
  102. PINCTRL_PIN(87, "PLGPIO87"),
  103. PINCTRL_PIN(88, "PLGPIO88"),
  104. PINCTRL_PIN(89, "PLGPIO89"),
  105. PINCTRL_PIN(90, "PLGPIO90"),
  106. PINCTRL_PIN(91, "PLGPIO91"),
  107. PINCTRL_PIN(92, "PLGPIO92"),
  108. PINCTRL_PIN(93, "PLGPIO93"),
  109. PINCTRL_PIN(94, "PLGPIO94"),
  110. PINCTRL_PIN(95, "PLGPIO95"),
  111. PINCTRL_PIN(96, "PLGPIO96"),
  112. PINCTRL_PIN(97, "PLGPIO97"),
  113. PINCTRL_PIN(98, "PLGPIO98"),
  114. PINCTRL_PIN(99, "PLGPIO99"),
  115. PINCTRL_PIN(100, "PLGPIO100"),
  116. PINCTRL_PIN(101, "PLGPIO101"),
  117. };
  118. /* firda_pins */
  119. static const unsigned firda_pins[] = { 0, 1 };
  120. static struct spear_muxreg firda_muxreg[] = {
  121. {
  122. .reg = -1,
  123. .mask = PMX_FIRDA_MASK,
  124. .val = PMX_FIRDA_MASK,
  125. },
  126. };
  127. static struct spear_modemux firda_modemux[] = {
  128. {
  129. .modes = ~0,
  130. .muxregs = firda_muxreg,
  131. .nmuxregs = ARRAY_SIZE(firda_muxreg),
  132. },
  133. };
  134. struct spear_pingroup spear3xx_firda_pingroup = {
  135. .name = "firda_grp",
  136. .pins = firda_pins,
  137. .npins = ARRAY_SIZE(firda_pins),
  138. .modemuxs = firda_modemux,
  139. .nmodemuxs = ARRAY_SIZE(firda_modemux),
  140. };
  141. static const char *const firda_grps[] = { "firda_grp" };
  142. struct spear_function spear3xx_firda_function = {
  143. .name = "firda",
  144. .groups = firda_grps,
  145. .ngroups = ARRAY_SIZE(firda_grps),
  146. };
  147. /* i2c_pins */
  148. static const unsigned i2c_pins[] = { 4, 5 };
  149. static struct spear_muxreg i2c_muxreg[] = {
  150. {
  151. .reg = -1,
  152. .mask = PMX_I2C_MASK,
  153. .val = PMX_I2C_MASK,
  154. },
  155. };
  156. static struct spear_modemux i2c_modemux[] = {
  157. {
  158. .modes = ~0,
  159. .muxregs = i2c_muxreg,
  160. .nmuxregs = ARRAY_SIZE(i2c_muxreg),
  161. },
  162. };
  163. struct spear_pingroup spear3xx_i2c_pingroup = {
  164. .name = "i2c0_grp",
  165. .pins = i2c_pins,
  166. .npins = ARRAY_SIZE(i2c_pins),
  167. .modemuxs = i2c_modemux,
  168. .nmodemuxs = ARRAY_SIZE(i2c_modemux),
  169. };
  170. static const char *const i2c_grps[] = { "i2c0_grp" };
  171. struct spear_function spear3xx_i2c_function = {
  172. .name = "i2c0",
  173. .groups = i2c_grps,
  174. .ngroups = ARRAY_SIZE(i2c_grps),
  175. };
  176. /* ssp_cs_pins */
  177. static const unsigned ssp_cs_pins[] = { 34, 35, 36 };
  178. static struct spear_muxreg ssp_cs_muxreg[] = {
  179. {
  180. .reg = -1,
  181. .mask = PMX_SSP_CS_MASK,
  182. .val = PMX_SSP_CS_MASK,
  183. },
  184. };
  185. static struct spear_modemux ssp_cs_modemux[] = {
  186. {
  187. .modes = ~0,
  188. .muxregs = ssp_cs_muxreg,
  189. .nmuxregs = ARRAY_SIZE(ssp_cs_muxreg),
  190. },
  191. };
  192. struct spear_pingroup spear3xx_ssp_cs_pingroup = {
  193. .name = "ssp_cs_grp",
  194. .pins = ssp_cs_pins,
  195. .npins = ARRAY_SIZE(ssp_cs_pins),
  196. .modemuxs = ssp_cs_modemux,
  197. .nmodemuxs = ARRAY_SIZE(ssp_cs_modemux),
  198. };
  199. static const char *const ssp_cs_grps[] = { "ssp_cs_grp" };
  200. struct spear_function spear3xx_ssp_cs_function = {
  201. .name = "ssp_cs",
  202. .groups = ssp_cs_grps,
  203. .ngroups = ARRAY_SIZE(ssp_cs_grps),
  204. };
  205. /* ssp_pins */
  206. static const unsigned ssp_pins[] = { 6, 7, 8, 9 };
  207. static struct spear_muxreg ssp_muxreg[] = {
  208. {
  209. .reg = -1,
  210. .mask = PMX_SSP_MASK,
  211. .val = PMX_SSP_MASK,
  212. },
  213. };
  214. static struct spear_modemux ssp_modemux[] = {
  215. {
  216. .modes = ~0,
  217. .muxregs = ssp_muxreg,
  218. .nmuxregs = ARRAY_SIZE(ssp_muxreg),
  219. },
  220. };
  221. struct spear_pingroup spear3xx_ssp_pingroup = {
  222. .name = "ssp0_grp",
  223. .pins = ssp_pins,
  224. .npins = ARRAY_SIZE(ssp_pins),
  225. .modemuxs = ssp_modemux,
  226. .nmodemuxs = ARRAY_SIZE(ssp_modemux),
  227. };
  228. static const char *const ssp_grps[] = { "ssp0_grp" };
  229. struct spear_function spear3xx_ssp_function = {
  230. .name = "ssp0",
  231. .groups = ssp_grps,
  232. .ngroups = ARRAY_SIZE(ssp_grps),
  233. };
  234. /* mii_pins */
  235. static const unsigned mii_pins[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
  236. 21, 22, 23, 24, 25, 26, 27 };
  237. static struct spear_muxreg mii_muxreg[] = {
  238. {
  239. .reg = -1,
  240. .mask = PMX_MII_MASK,
  241. .val = PMX_MII_MASK,
  242. },
  243. };
  244. static struct spear_modemux mii_modemux[] = {
  245. {
  246. .modes = ~0,
  247. .muxregs = mii_muxreg,
  248. .nmuxregs = ARRAY_SIZE(mii_muxreg),
  249. },
  250. };
  251. struct spear_pingroup spear3xx_mii_pingroup = {
  252. .name = "mii0_grp",
  253. .pins = mii_pins,
  254. .npins = ARRAY_SIZE(mii_pins),
  255. .modemuxs = mii_modemux,
  256. .nmodemuxs = ARRAY_SIZE(mii_modemux),
  257. };
  258. static const char *const mii_grps[] = { "mii0_grp" };
  259. struct spear_function spear3xx_mii_function = {
  260. .name = "mii0",
  261. .groups = mii_grps,
  262. .ngroups = ARRAY_SIZE(mii_grps),
  263. };
  264. /* gpio0_pin0_pins */
  265. static const unsigned gpio0_pin0_pins[] = { 28 };
  266. static struct spear_muxreg gpio0_pin0_muxreg[] = {
  267. {
  268. .reg = -1,
  269. .mask = PMX_GPIO_PIN0_MASK,
  270. .val = PMX_GPIO_PIN0_MASK,
  271. },
  272. };
  273. static struct spear_modemux gpio0_pin0_modemux[] = {
  274. {
  275. .modes = ~0,
  276. .muxregs = gpio0_pin0_muxreg,
  277. .nmuxregs = ARRAY_SIZE(gpio0_pin0_muxreg),
  278. },
  279. };
  280. struct spear_pingroup spear3xx_gpio0_pin0_pingroup = {
  281. .name = "gpio0_pin0_grp",
  282. .pins = gpio0_pin0_pins,
  283. .npins = ARRAY_SIZE(gpio0_pin0_pins),
  284. .modemuxs = gpio0_pin0_modemux,
  285. .nmodemuxs = ARRAY_SIZE(gpio0_pin0_modemux),
  286. };
  287. /* gpio0_pin1_pins */
  288. static const unsigned gpio0_pin1_pins[] = { 29 };
  289. static struct spear_muxreg gpio0_pin1_muxreg[] = {
  290. {
  291. .reg = -1,
  292. .mask = PMX_GPIO_PIN1_MASK,
  293. .val = PMX_GPIO_PIN1_MASK,
  294. },
  295. };
  296. static struct spear_modemux gpio0_pin1_modemux[] = {
  297. {
  298. .modes = ~0,
  299. .muxregs = gpio0_pin1_muxreg,
  300. .nmuxregs = ARRAY_SIZE(gpio0_pin1_muxreg),
  301. },
  302. };
  303. struct spear_pingroup spear3xx_gpio0_pin1_pingroup = {
  304. .name = "gpio0_pin1_grp",
  305. .pins = gpio0_pin1_pins,
  306. .npins = ARRAY_SIZE(gpio0_pin1_pins),
  307. .modemuxs = gpio0_pin1_modemux,
  308. .nmodemuxs = ARRAY_SIZE(gpio0_pin1_modemux),
  309. };
  310. /* gpio0_pin2_pins */
  311. static const unsigned gpio0_pin2_pins[] = { 30 };
  312. static struct spear_muxreg gpio0_pin2_muxreg[] = {
  313. {
  314. .reg = -1,
  315. .mask = PMX_GPIO_PIN2_MASK,
  316. .val = PMX_GPIO_PIN2_MASK,
  317. },
  318. };
  319. static struct spear_modemux gpio0_pin2_modemux[] = {
  320. {
  321. .modes = ~0,
  322. .muxregs = gpio0_pin2_muxreg,
  323. .nmuxregs = ARRAY_SIZE(gpio0_pin2_muxreg),
  324. },
  325. };
  326. struct spear_pingroup spear3xx_gpio0_pin2_pingroup = {
  327. .name = "gpio0_pin2_grp",
  328. .pins = gpio0_pin2_pins,
  329. .npins = ARRAY_SIZE(gpio0_pin2_pins),
  330. .modemuxs = gpio0_pin2_modemux,
  331. .nmodemuxs = ARRAY_SIZE(gpio0_pin2_modemux),
  332. };
  333. /* gpio0_pin3_pins */
  334. static const unsigned gpio0_pin3_pins[] = { 31 };
  335. static struct spear_muxreg gpio0_pin3_muxreg[] = {
  336. {
  337. .reg = -1,
  338. .mask = PMX_GPIO_PIN3_MASK,
  339. .val = PMX_GPIO_PIN3_MASK,
  340. },
  341. };
  342. static struct spear_modemux gpio0_pin3_modemux[] = {
  343. {
  344. .modes = ~0,
  345. .muxregs = gpio0_pin3_muxreg,
  346. .nmuxregs = ARRAY_SIZE(gpio0_pin3_muxreg),
  347. },
  348. };
  349. struct spear_pingroup spear3xx_gpio0_pin3_pingroup = {
  350. .name = "gpio0_pin3_grp",
  351. .pins = gpio0_pin3_pins,
  352. .npins = ARRAY_SIZE(gpio0_pin3_pins),
  353. .modemuxs = gpio0_pin3_modemux,
  354. .nmodemuxs = ARRAY_SIZE(gpio0_pin3_modemux),
  355. };
  356. /* gpio0_pin4_pins */
  357. static const unsigned gpio0_pin4_pins[] = { 32 };
  358. static struct spear_muxreg gpio0_pin4_muxreg[] = {
  359. {
  360. .reg = -1,
  361. .mask = PMX_GPIO_PIN4_MASK,
  362. .val = PMX_GPIO_PIN4_MASK,
  363. },
  364. };
  365. static struct spear_modemux gpio0_pin4_modemux[] = {
  366. {
  367. .modes = ~0,
  368. .muxregs = gpio0_pin4_muxreg,
  369. .nmuxregs = ARRAY_SIZE(gpio0_pin4_muxreg),
  370. },
  371. };
  372. struct spear_pingroup spear3xx_gpio0_pin4_pingroup = {
  373. .name = "gpio0_pin4_grp",
  374. .pins = gpio0_pin4_pins,
  375. .npins = ARRAY_SIZE(gpio0_pin4_pins),
  376. .modemuxs = gpio0_pin4_modemux,
  377. .nmodemuxs = ARRAY_SIZE(gpio0_pin4_modemux),
  378. };
  379. /* gpio0_pin5_pins */
  380. static const unsigned gpio0_pin5_pins[] = { 33 };
  381. static struct spear_muxreg gpio0_pin5_muxreg[] = {
  382. {
  383. .reg = -1,
  384. .mask = PMX_GPIO_PIN5_MASK,
  385. .val = PMX_GPIO_PIN5_MASK,
  386. },
  387. };
  388. static struct spear_modemux gpio0_pin5_modemux[] = {
  389. {
  390. .modes = ~0,
  391. .muxregs = gpio0_pin5_muxreg,
  392. .nmuxregs = ARRAY_SIZE(gpio0_pin5_muxreg),
  393. },
  394. };
  395. struct spear_pingroup spear3xx_gpio0_pin5_pingroup = {
  396. .name = "gpio0_pin5_grp",
  397. .pins = gpio0_pin5_pins,
  398. .npins = ARRAY_SIZE(gpio0_pin5_pins),
  399. .modemuxs = gpio0_pin5_modemux,
  400. .nmodemuxs = ARRAY_SIZE(gpio0_pin5_modemux),
  401. };
  402. static const char *const gpio0_grps[] = { "gpio0_pin0_grp", "gpio0_pin1_grp",
  403. "gpio0_pin2_grp", "gpio0_pin3_grp", "gpio0_pin4_grp", "gpio0_pin5_grp",
  404. };
  405. struct spear_function spear3xx_gpio0_function = {
  406. .name = "gpio0",
  407. .groups = gpio0_grps,
  408. .ngroups = ARRAY_SIZE(gpio0_grps),
  409. };
  410. /* uart0_ext_pins */
  411. static const unsigned uart0_ext_pins[] = { 37, 38, 39, 40, 41, 42 };
  412. static struct spear_muxreg uart0_ext_muxreg[] = {
  413. {
  414. .reg = -1,
  415. .mask = PMX_UART0_MODEM_MASK,
  416. .val = PMX_UART0_MODEM_MASK,
  417. },
  418. };
  419. static struct spear_modemux uart0_ext_modemux[] = {
  420. {
  421. .modes = ~0,
  422. .muxregs = uart0_ext_muxreg,
  423. .nmuxregs = ARRAY_SIZE(uart0_ext_muxreg),
  424. },
  425. };
  426. struct spear_pingroup spear3xx_uart0_ext_pingroup = {
  427. .name = "uart0_ext_grp",
  428. .pins = uart0_ext_pins,
  429. .npins = ARRAY_SIZE(uart0_ext_pins),
  430. .modemuxs = uart0_ext_modemux,
  431. .nmodemuxs = ARRAY_SIZE(uart0_ext_modemux),
  432. };
  433. static const char *const uart0_ext_grps[] = { "uart0_ext_grp" };
  434. struct spear_function spear3xx_uart0_ext_function = {
  435. .name = "uart0_ext",
  436. .groups = uart0_ext_grps,
  437. .ngroups = ARRAY_SIZE(uart0_ext_grps),
  438. };
  439. /* uart0_pins */
  440. static const unsigned uart0_pins[] = { 2, 3 };
  441. static struct spear_muxreg uart0_muxreg[] = {
  442. {
  443. .reg = -1,
  444. .mask = PMX_UART0_MASK,
  445. .val = PMX_UART0_MASK,
  446. },
  447. };
  448. static struct spear_modemux uart0_modemux[] = {
  449. {
  450. .modes = ~0,
  451. .muxregs = uart0_muxreg,
  452. .nmuxregs = ARRAY_SIZE(uart0_muxreg),
  453. },
  454. };
  455. struct spear_pingroup spear3xx_uart0_pingroup = {
  456. .name = "uart0_grp",
  457. .pins = uart0_pins,
  458. .npins = ARRAY_SIZE(uart0_pins),
  459. .modemuxs = uart0_modemux,
  460. .nmodemuxs = ARRAY_SIZE(uart0_modemux),
  461. };
  462. static const char *const uart0_grps[] = { "uart0_grp" };
  463. struct spear_function spear3xx_uart0_function = {
  464. .name = "uart0",
  465. .groups = uart0_grps,
  466. .ngroups = ARRAY_SIZE(uart0_grps),
  467. };
  468. /* timer_0_1_pins */
  469. static const unsigned timer_0_1_pins[] = { 43, 44, 47, 48 };
  470. static struct spear_muxreg timer_0_1_muxreg[] = {
  471. {
  472. .reg = -1,
  473. .mask = PMX_TIMER_0_1_MASK,
  474. .val = PMX_TIMER_0_1_MASK,
  475. },
  476. };
  477. static struct spear_modemux timer_0_1_modemux[] = {
  478. {
  479. .modes = ~0,
  480. .muxregs = timer_0_1_muxreg,
  481. .nmuxregs = ARRAY_SIZE(timer_0_1_muxreg),
  482. },
  483. };
  484. struct spear_pingroup spear3xx_timer_0_1_pingroup = {
  485. .name = "timer_0_1_grp",
  486. .pins = timer_0_1_pins,
  487. .npins = ARRAY_SIZE(timer_0_1_pins),
  488. .modemuxs = timer_0_1_modemux,
  489. .nmodemuxs = ARRAY_SIZE(timer_0_1_modemux),
  490. };
  491. static const char *const timer_0_1_grps[] = { "timer_0_1_grp" };
  492. struct spear_function spear3xx_timer_0_1_function = {
  493. .name = "timer_0_1",
  494. .groups = timer_0_1_grps,
  495. .ngroups = ARRAY_SIZE(timer_0_1_grps),
  496. };
  497. /* timer_2_3_pins */
  498. static const unsigned timer_2_3_pins[] = { 45, 46, 49, 50 };
  499. static struct spear_muxreg timer_2_3_muxreg[] = {
  500. {
  501. .reg = -1,
  502. .mask = PMX_TIMER_2_3_MASK,
  503. .val = PMX_TIMER_2_3_MASK,
  504. },
  505. };
  506. static struct spear_modemux timer_2_3_modemux[] = {
  507. {
  508. .modes = ~0,
  509. .muxregs = timer_2_3_muxreg,
  510. .nmuxregs = ARRAY_SIZE(timer_2_3_muxreg),
  511. },
  512. };
  513. struct spear_pingroup spear3xx_timer_2_3_pingroup = {
  514. .name = "timer_2_3_grp",
  515. .pins = timer_2_3_pins,
  516. .npins = ARRAY_SIZE(timer_2_3_pins),
  517. .modemuxs = timer_2_3_modemux,
  518. .nmodemuxs = ARRAY_SIZE(timer_2_3_modemux),
  519. };
  520. static const char *const timer_2_3_grps[] = { "timer_2_3_grp" };
  521. struct spear_function spear3xx_timer_2_3_function = {
  522. .name = "timer_2_3",
  523. .groups = timer_2_3_grps,
  524. .ngroups = ARRAY_SIZE(timer_2_3_grps),
  525. };
  526. struct spear_pinctrl_machdata spear3xx_machdata = {
  527. .pins = spear3xx_pins,
  528. .npins = ARRAY_SIZE(spear3xx_pins),
  529. };