pinctrl-exynos-arm.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. /*
  2. * Exynos specific support for Samsung pinctrl/gpiolib driver with eint support.
  3. *
  4. * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  5. * http://www.samsung.com
  6. * Copyright (c) 2012 Linaro Ltd
  7. * http://www.linaro.org
  8. *
  9. * Author: Thomas Abraham <thomas.ab@samsung.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This file contains the Samsung Exynos specific information required by the
  17. * the Samsung pinctrl/gpiolib driver. It also includes the implementation of
  18. * external gpio and wakeup interrupt support.
  19. */
  20. #include <linux/device.h>
  21. #include <linux/of_address.h>
  22. #include <linux/slab.h>
  23. #include <linux/err.h>
  24. #include <linux/soc/samsung/exynos-regs-pmu.h>
  25. #include "pinctrl-samsung.h"
  26. #include "pinctrl-exynos.h"
  27. static const struct samsung_pin_bank_type bank_type_off = {
  28. .fld_width = { 4, 1, 2, 2, 2, 2, },
  29. .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
  30. };
  31. static const struct samsung_pin_bank_type bank_type_alive = {
  32. .fld_width = { 4, 1, 2, 2, },
  33. .reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
  34. };
  35. /* Retention control for S5PV210 are located at the end of clock controller */
  36. #define S5P_OTHERS 0xE000
  37. #define S5P_OTHERS_RET_IO (1 << 31)
  38. #define S5P_OTHERS_RET_CF (1 << 30)
  39. #define S5P_OTHERS_RET_MMC (1 << 29)
  40. #define S5P_OTHERS_RET_UART (1 << 28)
  41. static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata)
  42. {
  43. void __iomem *clk_base = (void __iomem *)drvdata->retention_ctrl->priv;
  44. u32 tmp;
  45. tmp = __raw_readl(clk_base + S5P_OTHERS);
  46. tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF | S5P_OTHERS_RET_MMC |
  47. S5P_OTHERS_RET_UART);
  48. __raw_writel(tmp, clk_base + S5P_OTHERS);
  49. }
  50. static struct samsung_retention_ctrl *
  51. s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata,
  52. const struct samsung_retention_data *data)
  53. {
  54. struct samsung_retention_ctrl *ctrl;
  55. struct device_node *np;
  56. void __iomem *clk_base;
  57. ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL);
  58. if (!ctrl)
  59. return ERR_PTR(-ENOMEM);
  60. np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock");
  61. if (!np) {
  62. pr_err("%s: failed to find clock controller DT node\n",
  63. __func__);
  64. return ERR_PTR(-ENODEV);
  65. }
  66. clk_base = of_iomap(np, 0);
  67. of_node_put(np);
  68. if (!clk_base) {
  69. pr_err("%s: failed to map clock registers\n", __func__);
  70. return ERR_PTR(-EINVAL);
  71. }
  72. ctrl->priv = (void __force *)clk_base;
  73. ctrl->disable = s5pv210_retention_disable;
  74. return ctrl;
  75. }
  76. static const struct samsung_retention_data s5pv210_retention_data __initconst = {
  77. .init = s5pv210_retention_init,
  78. };
  79. /* pin banks of s5pv210 pin-controller */
  80. static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = {
  81. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  82. EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
  83. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
  84. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
  85. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
  86. EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
  87. EXYNOS_PIN_BANK_EINTG(6, 0x0c0, "gpd1", 0x18),
  88. EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe0", 0x1c),
  89. EXYNOS_PIN_BANK_EINTG(5, 0x100, "gpe1", 0x20),
  90. EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpf0", 0x24),
  91. EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28),
  92. EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c),
  93. EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30),
  94. EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34),
  95. EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38),
  96. EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c),
  97. EXYNOS_PIN_BANK_EINTG(7, 0x200, "gpg3", 0x40),
  98. EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x44),
  99. EXYNOS_PIN_BANK_EINTG(6, 0x260, "gpj1", 0x48),
  100. EXYNOS_PIN_BANK_EINTG(8, 0x280, "gpj2", 0x4c),
  101. EXYNOS_PIN_BANK_EINTG(8, 0x2a0, "gpj3", 0x50),
  102. EXYNOS_PIN_BANK_EINTG(5, 0x2c0, "gpj4", 0x54),
  103. EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"),
  104. EXYNOS_PIN_BANK_EINTN(8, 0x2e0, "mp01"),
  105. EXYNOS_PIN_BANK_EINTN(4, 0x300, "mp02"),
  106. EXYNOS_PIN_BANK_EINTN(8, 0x320, "mp03"),
  107. EXYNOS_PIN_BANK_EINTN(8, 0x340, "mp04"),
  108. EXYNOS_PIN_BANK_EINTN(8, 0x360, "mp05"),
  109. EXYNOS_PIN_BANK_EINTN(8, 0x380, "mp06"),
  110. EXYNOS_PIN_BANK_EINTN(8, 0x3a0, "mp07"),
  111. EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gph0", 0x00),
  112. EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gph1", 0x04),
  113. EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gph2", 0x08),
  114. EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gph3", 0x0c),
  115. };
  116. static const struct samsung_pin_ctrl s5pv210_pin_ctrl[] __initconst = {
  117. {
  118. /* pin-controller instance 0 data */
  119. .pin_banks = s5pv210_pin_bank,
  120. .nr_banks = ARRAY_SIZE(s5pv210_pin_bank),
  121. .eint_gpio_init = exynos_eint_gpio_init,
  122. .eint_wkup_init = exynos_eint_wkup_init,
  123. .suspend = exynos_pinctrl_suspend,
  124. .resume = exynos_pinctrl_resume,
  125. .retention_data = &s5pv210_retention_data,
  126. },
  127. };
  128. const struct samsung_pinctrl_of_match_data s5pv210_of_data __initconst = {
  129. .ctrl = s5pv210_pin_ctrl,
  130. .num_ctrl = ARRAY_SIZE(s5pv210_pin_ctrl),
  131. };
  132. /* Pad retention control code for accessing PMU regmap */
  133. static atomic_t exynos_shared_retention_refcnt;
  134. /* pin banks of exynos3250 pin-controller 0 */
  135. static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = {
  136. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  137. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  138. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
  139. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
  140. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
  141. EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
  142. EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18),
  143. };
  144. /* pin banks of exynos3250 pin-controller 1 */
  145. static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst = {
  146. EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"),
  147. EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"),
  148. EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"),
  149. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpk0", 0x08),
  150. EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
  151. EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
  152. EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpl0", 0x18),
  153. EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
  154. EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
  155. EXYNOS_PIN_BANK_EINTG(5, 0x2a0, "gpm2", 0x2c),
  156. EXYNOS_PIN_BANK_EINTG(8, 0x2c0, "gpm3", 0x30),
  157. EXYNOS_PIN_BANK_EINTG(8, 0x2e0, "gpm4", 0x34),
  158. EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00),
  159. EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04),
  160. EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08),
  161. EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
  162. };
  163. /*
  164. * PMU pad retention groups for Exynos3250 doesn't match pin banks, so handle
  165. * them all together
  166. */
  167. static const u32 exynos3250_retention_regs[] = {
  168. S5P_PAD_RET_MAUDIO_OPTION,
  169. S5P_PAD_RET_GPIO_OPTION,
  170. S5P_PAD_RET_UART_OPTION,
  171. S5P_PAD_RET_MMCA_OPTION,
  172. S5P_PAD_RET_MMCB_OPTION,
  173. S5P_PAD_RET_EBIA_OPTION,
  174. S5P_PAD_RET_EBIB_OPTION,
  175. S5P_PAD_RET_MMC2_OPTION,
  176. S5P_PAD_RET_SPI_OPTION,
  177. };
  178. static const struct samsung_retention_data exynos3250_retention_data __initconst = {
  179. .regs = exynos3250_retention_regs,
  180. .nr_regs = ARRAY_SIZE(exynos3250_retention_regs),
  181. .value = EXYNOS_WAKEUP_FROM_LOWPWR,
  182. .refcnt = &exynos_shared_retention_refcnt,
  183. .init = exynos_retention_init,
  184. };
  185. /*
  186. * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes
  187. * two gpio/pin-mux/pinconfig controllers.
  188. */
  189. static const struct samsung_pin_ctrl exynos3250_pin_ctrl[] __initconst = {
  190. {
  191. /* pin-controller instance 0 data */
  192. .pin_banks = exynos3250_pin_banks0,
  193. .nr_banks = ARRAY_SIZE(exynos3250_pin_banks0),
  194. .eint_gpio_init = exynos_eint_gpio_init,
  195. .suspend = exynos_pinctrl_suspend,
  196. .resume = exynos_pinctrl_resume,
  197. .retention_data = &exynos3250_retention_data,
  198. }, {
  199. /* pin-controller instance 1 data */
  200. .pin_banks = exynos3250_pin_banks1,
  201. .nr_banks = ARRAY_SIZE(exynos3250_pin_banks1),
  202. .eint_gpio_init = exynos_eint_gpio_init,
  203. .eint_wkup_init = exynos_eint_wkup_init,
  204. .suspend = exynos_pinctrl_suspend,
  205. .resume = exynos_pinctrl_resume,
  206. .retention_data = &exynos3250_retention_data,
  207. },
  208. };
  209. const struct samsung_pinctrl_of_match_data exynos3250_of_data __initconst = {
  210. .ctrl = exynos3250_pin_ctrl,
  211. .num_ctrl = ARRAY_SIZE(exynos3250_pin_ctrl),
  212. };
  213. /* pin banks of exynos4210 pin-controller 0 */
  214. static const struct samsung_pin_bank_data exynos4210_pin_banks0[] __initconst = {
  215. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  216. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  217. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
  218. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
  219. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
  220. EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
  221. EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
  222. EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
  223. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
  224. EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
  225. EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
  226. EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
  227. EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
  228. EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
  229. EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
  230. EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
  231. };
  232. /* pin banks of exynos4210 pin-controller 1 */
  233. static const struct samsung_pin_bank_data exynos4210_pin_banks1[] __initconst = {
  234. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
  235. EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
  236. EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
  237. EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
  238. EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
  239. EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
  240. EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
  241. EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
  242. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
  243. EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
  244. EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
  245. EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
  246. EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
  247. EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
  248. EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
  249. EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
  250. EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
  251. EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
  252. EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
  253. EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
  254. };
  255. /* pin banks of exynos4210 pin-controller 2 */
  256. static const struct samsung_pin_bank_data exynos4210_pin_banks2[] __initconst = {
  257. EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
  258. };
  259. /* PMU pad retention groups registers for Exynos4 (without audio) */
  260. static const u32 exynos4_retention_regs[] = {
  261. S5P_PAD_RET_GPIO_OPTION,
  262. S5P_PAD_RET_UART_OPTION,
  263. S5P_PAD_RET_MMCA_OPTION,
  264. S5P_PAD_RET_MMCB_OPTION,
  265. S5P_PAD_RET_EBIA_OPTION,
  266. S5P_PAD_RET_EBIB_OPTION,
  267. };
  268. static const struct samsung_retention_data exynos4_retention_data __initconst = {
  269. .regs = exynos4_retention_regs,
  270. .nr_regs = ARRAY_SIZE(exynos4_retention_regs),
  271. .value = EXYNOS_WAKEUP_FROM_LOWPWR,
  272. .refcnt = &exynos_shared_retention_refcnt,
  273. .init = exynos_retention_init,
  274. };
  275. /* PMU retention control for audio pins can be tied to audio pin bank */
  276. static const u32 exynos4_audio_retention_regs[] = {
  277. S5P_PAD_RET_MAUDIO_OPTION,
  278. };
  279. static const struct samsung_retention_data exynos4_audio_retention_data __initconst = {
  280. .regs = exynos4_audio_retention_regs,
  281. .nr_regs = ARRAY_SIZE(exynos4_audio_retention_regs),
  282. .value = EXYNOS_WAKEUP_FROM_LOWPWR,
  283. .init = exynos_retention_init,
  284. };
  285. /*
  286. * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
  287. * three gpio/pin-mux/pinconfig controllers.
  288. */
  289. static const struct samsung_pin_ctrl exynos4210_pin_ctrl[] __initconst = {
  290. {
  291. /* pin-controller instance 0 data */
  292. .pin_banks = exynos4210_pin_banks0,
  293. .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
  294. .eint_gpio_init = exynos_eint_gpio_init,
  295. .suspend = exynos_pinctrl_suspend,
  296. .resume = exynos_pinctrl_resume,
  297. .retention_data = &exynos4_retention_data,
  298. }, {
  299. /* pin-controller instance 1 data */
  300. .pin_banks = exynos4210_pin_banks1,
  301. .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
  302. .eint_gpio_init = exynos_eint_gpio_init,
  303. .eint_wkup_init = exynos_eint_wkup_init,
  304. .suspend = exynos_pinctrl_suspend,
  305. .resume = exynos_pinctrl_resume,
  306. .retention_data = &exynos4_retention_data,
  307. }, {
  308. /* pin-controller instance 2 data */
  309. .pin_banks = exynos4210_pin_banks2,
  310. .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
  311. .retention_data = &exynos4_audio_retention_data,
  312. },
  313. };
  314. const struct samsung_pinctrl_of_match_data exynos4210_of_data __initconst = {
  315. .ctrl = exynos4210_pin_ctrl,
  316. .num_ctrl = ARRAY_SIZE(exynos4210_pin_ctrl),
  317. };
  318. /* pin banks of exynos4x12 pin-controller 0 */
  319. static const struct samsung_pin_bank_data exynos4x12_pin_banks0[] __initconst = {
  320. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  321. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  322. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
  323. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
  324. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
  325. EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
  326. EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
  327. EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
  328. EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
  329. EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
  330. EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
  331. EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
  332. EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
  333. };
  334. /* pin banks of exynos4x12 pin-controller 1 */
  335. static const struct samsung_pin_bank_data exynos4x12_pin_banks1[] __initconst = {
  336. EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
  337. EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
  338. EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
  339. EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
  340. EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
  341. EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
  342. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
  343. EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
  344. EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
  345. EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
  346. EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
  347. EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
  348. EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
  349. EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
  350. EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
  351. EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
  352. EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
  353. EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
  354. EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
  355. EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
  356. EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
  357. EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
  358. EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
  359. };
  360. /* pin banks of exynos4x12 pin-controller 2 */
  361. static const struct samsung_pin_bank_data exynos4x12_pin_banks2[] __initconst = {
  362. EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
  363. };
  364. /* pin banks of exynos4x12 pin-controller 3 */
  365. static const struct samsung_pin_bank_data exynos4x12_pin_banks3[] __initconst = {
  366. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
  367. EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
  368. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
  369. EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
  370. EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
  371. };
  372. /*
  373. * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
  374. * four gpio/pin-mux/pinconfig controllers.
  375. */
  376. static const struct samsung_pin_ctrl exynos4x12_pin_ctrl[] __initconst = {
  377. {
  378. /* pin-controller instance 0 data */
  379. .pin_banks = exynos4x12_pin_banks0,
  380. .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks0),
  381. .eint_gpio_init = exynos_eint_gpio_init,
  382. .suspend = exynos_pinctrl_suspend,
  383. .resume = exynos_pinctrl_resume,
  384. .retention_data = &exynos4_retention_data,
  385. }, {
  386. /* pin-controller instance 1 data */
  387. .pin_banks = exynos4x12_pin_banks1,
  388. .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks1),
  389. .eint_gpio_init = exynos_eint_gpio_init,
  390. .eint_wkup_init = exynos_eint_wkup_init,
  391. .suspend = exynos_pinctrl_suspend,
  392. .resume = exynos_pinctrl_resume,
  393. .retention_data = &exynos4_retention_data,
  394. }, {
  395. /* pin-controller instance 2 data */
  396. .pin_banks = exynos4x12_pin_banks2,
  397. .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks2),
  398. .eint_gpio_init = exynos_eint_gpio_init,
  399. .suspend = exynos_pinctrl_suspend,
  400. .resume = exynos_pinctrl_resume,
  401. .retention_data = &exynos4_audio_retention_data,
  402. }, {
  403. /* pin-controller instance 3 data */
  404. .pin_banks = exynos4x12_pin_banks3,
  405. .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks3),
  406. .eint_gpio_init = exynos_eint_gpio_init,
  407. .suspend = exynos_pinctrl_suspend,
  408. .resume = exynos_pinctrl_resume,
  409. },
  410. };
  411. const struct samsung_pinctrl_of_match_data exynos4x12_of_data __initconst = {
  412. .ctrl = exynos4x12_pin_ctrl,
  413. .num_ctrl = ARRAY_SIZE(exynos4x12_pin_ctrl),
  414. };
  415. /* pin banks of exynos5250 pin-controller 0 */
  416. static const struct samsung_pin_bank_data exynos5250_pin_banks0[] __initconst = {
  417. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  418. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  419. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
  420. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
  421. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
  422. EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
  423. EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
  424. EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
  425. EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc1", 0x20),
  426. EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc2", 0x24),
  427. EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc3", 0x28),
  428. EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpd0", 0x2c),
  429. EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x30),
  430. EXYNOS_PIN_BANK_EINTG(7, 0x2E0, "gpc4", 0x34),
  431. EXYNOS_PIN_BANK_EINTN(6, 0x1A0, "gpy0"),
  432. EXYNOS_PIN_BANK_EINTN(4, 0x1C0, "gpy1"),
  433. EXYNOS_PIN_BANK_EINTN(6, 0x1E0, "gpy2"),
  434. EXYNOS_PIN_BANK_EINTN(8, 0x200, "gpy3"),
  435. EXYNOS_PIN_BANK_EINTN(8, 0x220, "gpy4"),
  436. EXYNOS_PIN_BANK_EINTN(8, 0x240, "gpy5"),
  437. EXYNOS_PIN_BANK_EINTN(8, 0x260, "gpy6"),
  438. EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
  439. EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
  440. EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
  441. EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
  442. };
  443. /* pin banks of exynos5250 pin-controller 1 */
  444. static const struct samsung_pin_bank_data exynos5250_pin_banks1[] __initconst = {
  445. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
  446. EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
  447. EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08),
  448. EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf1", 0x0c),
  449. EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
  450. EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
  451. EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
  452. EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gph0", 0x1c),
  453. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph1", 0x20),
  454. };
  455. /* pin banks of exynos5250 pin-controller 2 */
  456. static const struct samsung_pin_bank_data exynos5250_pin_banks2[] __initconst = {
  457. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
  458. EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
  459. EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
  460. EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
  461. EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
  462. };
  463. /* pin banks of exynos5250 pin-controller 3 */
  464. static const struct samsung_pin_bank_data exynos5250_pin_banks3[] __initconst = {
  465. EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
  466. };
  467. /*
  468. * Samsung pinctrl driver data for Exynos5250 SoC. Exynos5250 SoC includes
  469. * four gpio/pin-mux/pinconfig controllers.
  470. */
  471. static const struct samsung_pin_ctrl exynos5250_pin_ctrl[] __initconst = {
  472. {
  473. /* pin-controller instance 0 data */
  474. .pin_banks = exynos5250_pin_banks0,
  475. .nr_banks = ARRAY_SIZE(exynos5250_pin_banks0),
  476. .eint_gpio_init = exynos_eint_gpio_init,
  477. .eint_wkup_init = exynos_eint_wkup_init,
  478. .suspend = exynos_pinctrl_suspend,
  479. .resume = exynos_pinctrl_resume,
  480. .retention_data = &exynos4_retention_data,
  481. }, {
  482. /* pin-controller instance 1 data */
  483. .pin_banks = exynos5250_pin_banks1,
  484. .nr_banks = ARRAY_SIZE(exynos5250_pin_banks1),
  485. .eint_gpio_init = exynos_eint_gpio_init,
  486. .suspend = exynos_pinctrl_suspend,
  487. .resume = exynos_pinctrl_resume,
  488. .retention_data = &exynos4_retention_data,
  489. }, {
  490. /* pin-controller instance 2 data */
  491. .pin_banks = exynos5250_pin_banks2,
  492. .nr_banks = ARRAY_SIZE(exynos5250_pin_banks2),
  493. .eint_gpio_init = exynos_eint_gpio_init,
  494. .suspend = exynos_pinctrl_suspend,
  495. .resume = exynos_pinctrl_resume,
  496. }, {
  497. /* pin-controller instance 3 data */
  498. .pin_banks = exynos5250_pin_banks3,
  499. .nr_banks = ARRAY_SIZE(exynos5250_pin_banks3),
  500. .eint_gpio_init = exynos_eint_gpio_init,
  501. .suspend = exynos_pinctrl_suspend,
  502. .resume = exynos_pinctrl_resume,
  503. .retention_data = &exynos4_audio_retention_data,
  504. },
  505. };
  506. const struct samsung_pinctrl_of_match_data exynos5250_of_data __initconst = {
  507. .ctrl = exynos5250_pin_ctrl,
  508. .num_ctrl = ARRAY_SIZE(exynos5250_pin_ctrl),
  509. };
  510. /* pin banks of exynos5260 pin-controller 0 */
  511. static const struct samsung_pin_bank_data exynos5260_pin_banks0[] __initconst = {
  512. EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpa0", 0x00),
  513. EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpa1", 0x04),
  514. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
  515. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
  516. EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpb1", 0x10),
  517. EXYNOS_PIN_BANK_EINTG(5, 0x0a0, "gpb2", 0x14),
  518. EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpb3", 0x18),
  519. EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpb4", 0x1c),
  520. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpb5", 0x20),
  521. EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpd0", 0x24),
  522. EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpd1", 0x28),
  523. EXYNOS_PIN_BANK_EINTG(5, 0x160, "gpd2", 0x2c),
  524. EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpe0", 0x30),
  525. EXYNOS_PIN_BANK_EINTG(5, 0x1a0, "gpe1", 0x34),
  526. EXYNOS_PIN_BANK_EINTG(4, 0x1c0, "gpf0", 0x38),
  527. EXYNOS_PIN_BANK_EINTG(8, 0x1e0, "gpf1", 0x3c),
  528. EXYNOS_PIN_BANK_EINTG(2, 0x200, "gpk0", 0x40),
  529. EXYNOS_PIN_BANK_EINTW(8, 0xc00, "gpx0", 0x00),
  530. EXYNOS_PIN_BANK_EINTW(8, 0xc20, "gpx1", 0x04),
  531. EXYNOS_PIN_BANK_EINTW(8, 0xc40, "gpx2", 0x08),
  532. EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
  533. };
  534. /* pin banks of exynos5260 pin-controller 1 */
  535. static const struct samsung_pin_bank_data exynos5260_pin_banks1[] __initconst = {
  536. EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpc0", 0x00),
  537. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpc1", 0x04),
  538. EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
  539. EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
  540. EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpc4", 0x10),
  541. };
  542. /* pin banks of exynos5260 pin-controller 2 */
  543. static const struct samsung_pin_bank_data exynos5260_pin_banks2[] __initconst = {
  544. EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
  545. EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
  546. };
  547. /*
  548. * Samsung pinctrl driver data for Exynos5260 SoC. Exynos5260 SoC includes
  549. * three gpio/pin-mux/pinconfig controllers.
  550. */
  551. static const struct samsung_pin_ctrl exynos5260_pin_ctrl[] __initconst = {
  552. {
  553. /* pin-controller instance 0 data */
  554. .pin_banks = exynos5260_pin_banks0,
  555. .nr_banks = ARRAY_SIZE(exynos5260_pin_banks0),
  556. .eint_gpio_init = exynos_eint_gpio_init,
  557. .eint_wkup_init = exynos_eint_wkup_init,
  558. }, {
  559. /* pin-controller instance 1 data */
  560. .pin_banks = exynos5260_pin_banks1,
  561. .nr_banks = ARRAY_SIZE(exynos5260_pin_banks1),
  562. .eint_gpio_init = exynos_eint_gpio_init,
  563. }, {
  564. /* pin-controller instance 2 data */
  565. .pin_banks = exynos5260_pin_banks2,
  566. .nr_banks = ARRAY_SIZE(exynos5260_pin_banks2),
  567. .eint_gpio_init = exynos_eint_gpio_init,
  568. },
  569. };
  570. const struct samsung_pinctrl_of_match_data exynos5260_of_data __initconst = {
  571. .ctrl = exynos5260_pin_ctrl,
  572. .num_ctrl = ARRAY_SIZE(exynos5260_pin_ctrl),
  573. };
  574. /* pin banks of exynos5410 pin-controller 0 */
  575. static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = {
  576. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  577. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  578. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
  579. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
  580. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
  581. EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
  582. EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
  583. EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
  584. EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc3", 0x20),
  585. EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc1", 0x24),
  586. EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc2", 0x28),
  587. EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x2c),
  588. EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpe0", 0x30),
  589. EXYNOS_PIN_BANK_EINTG(2, 0x1C0, "gpe1", 0x34),
  590. EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf0", 0x38),
  591. EXYNOS_PIN_BANK_EINTG(8, 0x200, "gpf1", 0x3c),
  592. EXYNOS_PIN_BANK_EINTG(8, 0x220, "gpg0", 0x40),
  593. EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpg1", 0x44),
  594. EXYNOS_PIN_BANK_EINTG(2, 0x260, "gpg2", 0x48),
  595. EXYNOS_PIN_BANK_EINTG(4, 0x280, "gph0", 0x4c),
  596. EXYNOS_PIN_BANK_EINTG(8, 0x2A0, "gph1", 0x50),
  597. EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"),
  598. EXYNOS_PIN_BANK_EINTN(8, 0x2C0, "gpm7"),
  599. EXYNOS_PIN_BANK_EINTN(6, 0x2E0, "gpy0"),
  600. EXYNOS_PIN_BANK_EINTN(4, 0x300, "gpy1"),
  601. EXYNOS_PIN_BANK_EINTN(6, 0x320, "gpy2"),
  602. EXYNOS_PIN_BANK_EINTN(8, 0x340, "gpy3"),
  603. EXYNOS_PIN_BANK_EINTN(8, 0x360, "gpy4"),
  604. EXYNOS_PIN_BANK_EINTN(8, 0x380, "gpy5"),
  605. EXYNOS_PIN_BANK_EINTN(8, 0x3A0, "gpy6"),
  606. EXYNOS_PIN_BANK_EINTN(8, 0x3C0, "gpy7"),
  607. EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
  608. EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
  609. EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
  610. EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
  611. };
  612. /* pin banks of exynos5410 pin-controller 1 */
  613. static const struct samsung_pin_bank_data exynos5410_pin_banks1[] __initconst = {
  614. EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpj0", 0x00),
  615. EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpj1", 0x04),
  616. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpj2", 0x08),
  617. EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpj3", 0x0c),
  618. EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpj4", 0x10),
  619. EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpk0", 0x14),
  620. EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpk1", 0x18),
  621. EXYNOS_PIN_BANK_EINTG(8, 0x0E0, "gpk2", 0x1c),
  622. EXYNOS_PIN_BANK_EINTG(7, 0x100, "gpk3", 0x20),
  623. };
  624. /* pin banks of exynos5410 pin-controller 2 */
  625. static const struct samsung_pin_bank_data exynos5410_pin_banks2[] __initconst = {
  626. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
  627. EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
  628. EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
  629. EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
  630. EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
  631. };
  632. /* pin banks of exynos5410 pin-controller 3 */
  633. static const struct samsung_pin_bank_data exynos5410_pin_banks3[] __initconst = {
  634. EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
  635. };
  636. /*
  637. * Samsung pinctrl driver data for Exynos5410 SoC. Exynos5410 SoC includes
  638. * four gpio/pin-mux/pinconfig controllers.
  639. */
  640. static const struct samsung_pin_ctrl exynos5410_pin_ctrl[] __initconst = {
  641. {
  642. /* pin-controller instance 0 data */
  643. .pin_banks = exynos5410_pin_banks0,
  644. .nr_banks = ARRAY_SIZE(exynos5410_pin_banks0),
  645. .eint_gpio_init = exynos_eint_gpio_init,
  646. .eint_wkup_init = exynos_eint_wkup_init,
  647. .suspend = exynos_pinctrl_suspend,
  648. .resume = exynos_pinctrl_resume,
  649. }, {
  650. /* pin-controller instance 1 data */
  651. .pin_banks = exynos5410_pin_banks1,
  652. .nr_banks = ARRAY_SIZE(exynos5410_pin_banks1),
  653. .eint_gpio_init = exynos_eint_gpio_init,
  654. .suspend = exynos_pinctrl_suspend,
  655. .resume = exynos_pinctrl_resume,
  656. }, {
  657. /* pin-controller instance 2 data */
  658. .pin_banks = exynos5410_pin_banks2,
  659. .nr_banks = ARRAY_SIZE(exynos5410_pin_banks2),
  660. .eint_gpio_init = exynos_eint_gpio_init,
  661. .suspend = exynos_pinctrl_suspend,
  662. .resume = exynos_pinctrl_resume,
  663. }, {
  664. /* pin-controller instance 3 data */
  665. .pin_banks = exynos5410_pin_banks3,
  666. .nr_banks = ARRAY_SIZE(exynos5410_pin_banks3),
  667. .eint_gpio_init = exynos_eint_gpio_init,
  668. .suspend = exynos_pinctrl_suspend,
  669. .resume = exynos_pinctrl_resume,
  670. },
  671. };
  672. const struct samsung_pinctrl_of_match_data exynos5410_of_data __initconst = {
  673. .ctrl = exynos5410_pin_ctrl,
  674. .num_ctrl = ARRAY_SIZE(exynos5410_pin_ctrl),
  675. };
  676. /* pin banks of exynos5420 pin-controller 0 */
  677. static const struct samsung_pin_bank_data exynos5420_pin_banks0[] __initconst = {
  678. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00),
  679. EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
  680. EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
  681. EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
  682. EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
  683. };
  684. /* pin banks of exynos5420 pin-controller 1 */
  685. static const struct samsung_pin_bank_data exynos5420_pin_banks1[] __initconst = {
  686. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpc0", 0x00),
  687. EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc1", 0x04),
  688. EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
  689. EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
  690. EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpc4", 0x10),
  691. EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpd1", 0x14),
  692. EXYNOS_PIN_BANK_EINTN(6, 0x0C0, "gpy0"),
  693. EXYNOS_PIN_BANK_EINTN(4, 0x0E0, "gpy1"),
  694. EXYNOS_PIN_BANK_EINTN(6, 0x100, "gpy2"),
  695. EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpy3"),
  696. EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpy4"),
  697. EXYNOS_PIN_BANK_EINTN(8, 0x160, "gpy5"),
  698. EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy6"),
  699. };
  700. /* pin banks of exynos5420 pin-controller 2 */
  701. static const struct samsung_pin_bank_data exynos5420_pin_banks2[] __initconst = {
  702. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
  703. EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
  704. EXYNOS_PIN_BANK_EINTG(6, 0x040, "gpf0", 0x08),
  705. EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpf1", 0x0c),
  706. EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
  707. EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
  708. EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
  709. EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gpj4", 0x1c),
  710. };
  711. /* pin banks of exynos5420 pin-controller 3 */
  712. static const struct samsung_pin_bank_data exynos5420_pin_banks3[] __initconst = {
  713. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  714. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  715. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
  716. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
  717. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
  718. EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
  719. EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpb3", 0x18),
  720. EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpb4", 0x1c),
  721. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph0", 0x20),
  722. };
  723. /* pin banks of exynos5420 pin-controller 4 */
  724. static const struct samsung_pin_bank_data exynos5420_pin_banks4[] __initconst = {
  725. EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
  726. };
  727. /* PMU pad retention groups registers for Exynos5420 (without audio) */
  728. static const u32 exynos5420_retention_regs[] = {
  729. EXYNOS_PAD_RET_DRAM_OPTION,
  730. EXYNOS_PAD_RET_JTAG_OPTION,
  731. EXYNOS5420_PAD_RET_GPIO_OPTION,
  732. EXYNOS5420_PAD_RET_UART_OPTION,
  733. EXYNOS5420_PAD_RET_MMCA_OPTION,
  734. EXYNOS5420_PAD_RET_MMCB_OPTION,
  735. EXYNOS5420_PAD_RET_MMCC_OPTION,
  736. EXYNOS5420_PAD_RET_HSI_OPTION,
  737. EXYNOS_PAD_RET_EBIA_OPTION,
  738. EXYNOS_PAD_RET_EBIB_OPTION,
  739. EXYNOS5420_PAD_RET_SPI_OPTION,
  740. EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION,
  741. };
  742. static const struct samsung_retention_data exynos5420_retention_data __initconst = {
  743. .regs = exynos5420_retention_regs,
  744. .nr_regs = ARRAY_SIZE(exynos5420_retention_regs),
  745. .value = EXYNOS_WAKEUP_FROM_LOWPWR,
  746. .refcnt = &exynos_shared_retention_refcnt,
  747. .init = exynos_retention_init,
  748. };
  749. /*
  750. * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes
  751. * four gpio/pin-mux/pinconfig controllers.
  752. */
  753. static const struct samsung_pin_ctrl exynos5420_pin_ctrl[] __initconst = {
  754. {
  755. /* pin-controller instance 0 data */
  756. .pin_banks = exynos5420_pin_banks0,
  757. .nr_banks = ARRAY_SIZE(exynos5420_pin_banks0),
  758. .eint_gpio_init = exynos_eint_gpio_init,
  759. .eint_wkup_init = exynos_eint_wkup_init,
  760. .retention_data = &exynos5420_retention_data,
  761. }, {
  762. /* pin-controller instance 1 data */
  763. .pin_banks = exynos5420_pin_banks1,
  764. .nr_banks = ARRAY_SIZE(exynos5420_pin_banks1),
  765. .eint_gpio_init = exynos_eint_gpio_init,
  766. .retention_data = &exynos5420_retention_data,
  767. }, {
  768. /* pin-controller instance 2 data */
  769. .pin_banks = exynos5420_pin_banks2,
  770. .nr_banks = ARRAY_SIZE(exynos5420_pin_banks2),
  771. .eint_gpio_init = exynos_eint_gpio_init,
  772. .retention_data = &exynos5420_retention_data,
  773. }, {
  774. /* pin-controller instance 3 data */
  775. .pin_banks = exynos5420_pin_banks3,
  776. .nr_banks = ARRAY_SIZE(exynos5420_pin_banks3),
  777. .eint_gpio_init = exynos_eint_gpio_init,
  778. .retention_data = &exynos5420_retention_data,
  779. }, {
  780. /* pin-controller instance 4 data */
  781. .pin_banks = exynos5420_pin_banks4,
  782. .nr_banks = ARRAY_SIZE(exynos5420_pin_banks4),
  783. .eint_gpio_init = exynos_eint_gpio_init,
  784. .retention_data = &exynos4_audio_retention_data,
  785. },
  786. };
  787. const struct samsung_pinctrl_of_match_data exynos5420_of_data __initconst = {
  788. .ctrl = exynos5420_pin_ctrl,
  789. .num_ctrl = ARRAY_SIZE(exynos5420_pin_ctrl),
  790. };