pinctrl-exynos.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  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/module.h>
  21. #include <linux/device.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/irqdomain.h>
  24. #include <linux/irq.h>
  25. #include <linux/of_irq.h>
  26. #include <linux/io.h>
  27. #include <linux/slab.h>
  28. #include <linux/err.h>
  29. #include <asm/mach/irq.h>
  30. #include "pinctrl-samsung.h"
  31. #include "pinctrl-exynos.h"
  32. /* list of external wakeup controllers supported */
  33. static const struct of_device_id exynos_wkup_irq_ids[] = {
  34. { .compatible = "samsung,exynos4210-wakeup-eint", },
  35. };
  36. static void exynos_gpio_irq_unmask(struct irq_data *irqd)
  37. {
  38. struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
  39. struct samsung_pinctrl_drv_data *d = bank->drvdata;
  40. unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
  41. unsigned long mask;
  42. mask = readl(d->virt_base + reg_mask);
  43. mask &= ~(1 << irqd->hwirq);
  44. writel(mask, d->virt_base + reg_mask);
  45. }
  46. static void exynos_gpio_irq_mask(struct irq_data *irqd)
  47. {
  48. struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
  49. struct samsung_pinctrl_drv_data *d = bank->drvdata;
  50. unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
  51. unsigned long mask;
  52. mask = readl(d->virt_base + reg_mask);
  53. mask |= 1 << irqd->hwirq;
  54. writel(mask, d->virt_base + reg_mask);
  55. }
  56. static void exynos_gpio_irq_ack(struct irq_data *irqd)
  57. {
  58. struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
  59. struct samsung_pinctrl_drv_data *d = bank->drvdata;
  60. unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
  61. writel(1 << irqd->hwirq, d->virt_base + reg_pend);
  62. }
  63. static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
  64. {
  65. struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
  66. struct samsung_pinctrl_drv_data *d = bank->drvdata;
  67. struct samsung_pin_ctrl *ctrl = d->ctrl;
  68. unsigned int pin = irqd->hwirq;
  69. unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
  70. unsigned int con, trig_type;
  71. unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
  72. unsigned int mask;
  73. switch (type) {
  74. case IRQ_TYPE_EDGE_RISING:
  75. trig_type = EXYNOS_EINT_EDGE_RISING;
  76. break;
  77. case IRQ_TYPE_EDGE_FALLING:
  78. trig_type = EXYNOS_EINT_EDGE_FALLING;
  79. break;
  80. case IRQ_TYPE_EDGE_BOTH:
  81. trig_type = EXYNOS_EINT_EDGE_BOTH;
  82. break;
  83. case IRQ_TYPE_LEVEL_HIGH:
  84. trig_type = EXYNOS_EINT_LEVEL_HIGH;
  85. break;
  86. case IRQ_TYPE_LEVEL_LOW:
  87. trig_type = EXYNOS_EINT_LEVEL_LOW;
  88. break;
  89. default:
  90. pr_err("unsupported external interrupt type\n");
  91. return -EINVAL;
  92. }
  93. if (type & IRQ_TYPE_EDGE_BOTH)
  94. __irq_set_handler_locked(irqd->irq, handle_edge_irq);
  95. else
  96. __irq_set_handler_locked(irqd->irq, handle_level_irq);
  97. con = readl(d->virt_base + reg_con);
  98. con &= ~(EXYNOS_EINT_CON_MASK << shift);
  99. con |= trig_type << shift;
  100. writel(con, d->virt_base + reg_con);
  101. reg_con = bank->pctl_offset;
  102. shift = pin * bank->func_width;
  103. mask = (1 << bank->func_width) - 1;
  104. con = readl(d->virt_base + reg_con);
  105. con &= ~(mask << shift);
  106. con |= EXYNOS_EINT_FUNC << shift;
  107. writel(con, d->virt_base + reg_con);
  108. return 0;
  109. }
  110. /*
  111. * irq_chip for gpio interrupts.
  112. */
  113. static struct irq_chip exynos_gpio_irq_chip = {
  114. .name = "exynos_gpio_irq_chip",
  115. .irq_unmask = exynos_gpio_irq_unmask,
  116. .irq_mask = exynos_gpio_irq_mask,
  117. .irq_ack = exynos_gpio_irq_ack,
  118. .irq_set_type = exynos_gpio_irq_set_type,
  119. };
  120. static int exynos_gpio_irq_map(struct irq_domain *h, unsigned int virq,
  121. irq_hw_number_t hw)
  122. {
  123. struct samsung_pin_bank *b = h->host_data;
  124. irq_set_chip_data(virq, b);
  125. irq_set_chip_and_handler(virq, &exynos_gpio_irq_chip,
  126. handle_level_irq);
  127. set_irq_flags(virq, IRQF_VALID);
  128. return 0;
  129. }
  130. /*
  131. * irq domain callbacks for external gpio interrupt controller.
  132. */
  133. static const struct irq_domain_ops exynos_gpio_irqd_ops = {
  134. .map = exynos_gpio_irq_map,
  135. .xlate = irq_domain_xlate_twocell,
  136. };
  137. static irqreturn_t exynos_eint_gpio_irq(int irq, void *data)
  138. {
  139. struct samsung_pinctrl_drv_data *d = data;
  140. struct samsung_pin_ctrl *ctrl = d->ctrl;
  141. struct samsung_pin_bank *bank = ctrl->pin_banks;
  142. unsigned int svc, group, pin, virq;
  143. svc = readl(d->virt_base + ctrl->svc);
  144. group = EXYNOS_SVC_GROUP(svc);
  145. pin = svc & EXYNOS_SVC_NUM_MASK;
  146. if (!group)
  147. return IRQ_HANDLED;
  148. bank += (group - 1);
  149. virq = irq_linear_revmap(bank->irq_domain, pin);
  150. if (!virq)
  151. return IRQ_NONE;
  152. generic_handle_irq(virq);
  153. return IRQ_HANDLED;
  154. }
  155. /*
  156. * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
  157. * @d: driver data of samsung pinctrl driver.
  158. */
  159. static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
  160. {
  161. struct samsung_pin_bank *bank;
  162. struct device *dev = d->dev;
  163. unsigned int ret;
  164. unsigned int i;
  165. if (!d->irq) {
  166. dev_err(dev, "irq number not available\n");
  167. return -EINVAL;
  168. }
  169. ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
  170. 0, dev_name(dev), d);
  171. if (ret) {
  172. dev_err(dev, "irq request failed\n");
  173. return -ENXIO;
  174. }
  175. bank = d->ctrl->pin_banks;
  176. for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
  177. if (bank->eint_type != EINT_TYPE_GPIO)
  178. continue;
  179. bank->irq_domain = irq_domain_add_linear(bank->of_node,
  180. bank->nr_pins, &exynos_gpio_irqd_ops, bank);
  181. if (!bank->irq_domain) {
  182. dev_err(dev, "gpio irq domain add failed\n");
  183. return -ENXIO;
  184. }
  185. }
  186. return 0;
  187. }
  188. static void exynos_wkup_irq_unmask(struct irq_data *irqd)
  189. {
  190. struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
  191. struct samsung_pinctrl_drv_data *d = b->drvdata;
  192. unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
  193. unsigned long mask;
  194. mask = readl(d->virt_base + reg_mask);
  195. mask &= ~(1 << irqd->hwirq);
  196. writel(mask, d->virt_base + reg_mask);
  197. }
  198. static void exynos_wkup_irq_mask(struct irq_data *irqd)
  199. {
  200. struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
  201. struct samsung_pinctrl_drv_data *d = b->drvdata;
  202. unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
  203. unsigned long mask;
  204. mask = readl(d->virt_base + reg_mask);
  205. mask |= 1 << irqd->hwirq;
  206. writel(mask, d->virt_base + reg_mask);
  207. }
  208. static void exynos_wkup_irq_ack(struct irq_data *irqd)
  209. {
  210. struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
  211. struct samsung_pinctrl_drv_data *d = b->drvdata;
  212. unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
  213. writel(1 << irqd->hwirq, d->virt_base + pend);
  214. }
  215. static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
  216. {
  217. struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
  218. struct samsung_pinctrl_drv_data *d = bank->drvdata;
  219. unsigned int pin = irqd->hwirq;
  220. unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
  221. unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
  222. unsigned long con, trig_type;
  223. switch (type) {
  224. case IRQ_TYPE_EDGE_RISING:
  225. trig_type = EXYNOS_EINT_EDGE_RISING;
  226. break;
  227. case IRQ_TYPE_EDGE_FALLING:
  228. trig_type = EXYNOS_EINT_EDGE_FALLING;
  229. break;
  230. case IRQ_TYPE_EDGE_BOTH:
  231. trig_type = EXYNOS_EINT_EDGE_BOTH;
  232. break;
  233. case IRQ_TYPE_LEVEL_HIGH:
  234. trig_type = EXYNOS_EINT_LEVEL_HIGH;
  235. break;
  236. case IRQ_TYPE_LEVEL_LOW:
  237. trig_type = EXYNOS_EINT_LEVEL_LOW;
  238. break;
  239. default:
  240. pr_err("unsupported external interrupt type\n");
  241. return -EINVAL;
  242. }
  243. if (type & IRQ_TYPE_EDGE_BOTH)
  244. __irq_set_handler_locked(irqd->irq, handle_edge_irq);
  245. else
  246. __irq_set_handler_locked(irqd->irq, handle_level_irq);
  247. con = readl(d->virt_base + reg_con);
  248. con &= ~(EXYNOS_EINT_CON_MASK << shift);
  249. con |= trig_type << shift;
  250. writel(con, d->virt_base + reg_con);
  251. return 0;
  252. }
  253. /*
  254. * irq_chip for wakeup interrupts
  255. */
  256. static struct irq_chip exynos_wkup_irq_chip = {
  257. .name = "exynos_wkup_irq_chip",
  258. .irq_unmask = exynos_wkup_irq_unmask,
  259. .irq_mask = exynos_wkup_irq_mask,
  260. .irq_ack = exynos_wkup_irq_ack,
  261. .irq_set_type = exynos_wkup_irq_set_type,
  262. };
  263. /* interrupt handler for wakeup interrupts 0..15 */
  264. static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
  265. {
  266. struct exynos_weint_data *eintd = irq_get_handler_data(irq);
  267. struct samsung_pin_bank *bank = eintd->bank;
  268. struct irq_chip *chip = irq_get_chip(irq);
  269. int eint_irq;
  270. chained_irq_enter(chip, desc);
  271. chip->irq_mask(&desc->irq_data);
  272. if (chip->irq_ack)
  273. chip->irq_ack(&desc->irq_data);
  274. eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
  275. generic_handle_irq(eint_irq);
  276. chip->irq_unmask(&desc->irq_data);
  277. chained_irq_exit(chip, desc);
  278. }
  279. static inline void exynos_irq_demux_eint(unsigned long pend,
  280. struct irq_domain *domain)
  281. {
  282. unsigned int irq;
  283. while (pend) {
  284. irq = fls(pend) - 1;
  285. generic_handle_irq(irq_find_mapping(domain, irq));
  286. pend &= ~(1 << irq);
  287. }
  288. }
  289. /* interrupt handler for wakeup interrupt 16 */
  290. static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
  291. {
  292. struct irq_chip *chip = irq_get_chip(irq);
  293. struct exynos_muxed_weint_data *eintd = irq_get_handler_data(irq);
  294. struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata;
  295. struct samsung_pin_ctrl *ctrl = d->ctrl;
  296. unsigned long pend;
  297. unsigned long mask;
  298. int i;
  299. chained_irq_enter(chip, desc);
  300. for (i = 0; i < eintd->nr_banks; ++i) {
  301. struct samsung_pin_bank *b = eintd->banks[i];
  302. pend = readl(d->virt_base + ctrl->weint_pend + b->eint_offset);
  303. mask = readl(d->virt_base + ctrl->weint_mask + b->eint_offset);
  304. exynos_irq_demux_eint(pend & ~mask, b->irq_domain);
  305. }
  306. chained_irq_exit(chip, desc);
  307. }
  308. static int exynos_wkup_irq_map(struct irq_domain *h, unsigned int virq,
  309. irq_hw_number_t hw)
  310. {
  311. irq_set_chip_and_handler(virq, &exynos_wkup_irq_chip, handle_level_irq);
  312. irq_set_chip_data(virq, h->host_data);
  313. set_irq_flags(virq, IRQF_VALID);
  314. return 0;
  315. }
  316. /*
  317. * irq domain callbacks for external wakeup interrupt controller.
  318. */
  319. static const struct irq_domain_ops exynos_wkup_irqd_ops = {
  320. .map = exynos_wkup_irq_map,
  321. .xlate = irq_domain_xlate_twocell,
  322. };
  323. /*
  324. * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
  325. * @d: driver data of samsung pinctrl driver.
  326. */
  327. static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
  328. {
  329. struct device *dev = d->dev;
  330. struct device_node *wkup_np = NULL;
  331. struct device_node *np;
  332. struct samsung_pin_bank *bank;
  333. struct exynos_weint_data *weint_data;
  334. struct exynos_muxed_weint_data *muxed_data;
  335. unsigned int muxed_banks = 0;
  336. unsigned int i;
  337. int idx, irq;
  338. for_each_child_of_node(dev->of_node, np) {
  339. if (of_match_node(exynos_wkup_irq_ids, np)) {
  340. wkup_np = np;
  341. break;
  342. }
  343. }
  344. if (!wkup_np)
  345. return -ENODEV;
  346. bank = d->ctrl->pin_banks;
  347. for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
  348. if (bank->eint_type != EINT_TYPE_WKUP)
  349. continue;
  350. bank->irq_domain = irq_domain_add_linear(bank->of_node,
  351. bank->nr_pins, &exynos_wkup_irqd_ops, bank);
  352. if (!bank->irq_domain) {
  353. dev_err(dev, "wkup irq domain add failed\n");
  354. return -ENXIO;
  355. }
  356. if (!of_find_property(bank->of_node, "interrupts", NULL)) {
  357. bank->eint_type = EINT_TYPE_WKUP_MUX;
  358. ++muxed_banks;
  359. continue;
  360. }
  361. weint_data = devm_kzalloc(dev, bank->nr_pins
  362. * sizeof(*weint_data), GFP_KERNEL);
  363. if (!weint_data) {
  364. dev_err(dev, "could not allocate memory for weint_data\n");
  365. return -ENOMEM;
  366. }
  367. for (idx = 0; idx < bank->nr_pins; ++idx) {
  368. irq = irq_of_parse_and_map(bank->of_node, idx);
  369. if (!irq) {
  370. dev_err(dev, "irq number for eint-%s-%d not found\n",
  371. bank->name, idx);
  372. continue;
  373. }
  374. weint_data[idx].irq = idx;
  375. weint_data[idx].bank = bank;
  376. irq_set_handler_data(irq, &weint_data[idx]);
  377. irq_set_chained_handler(irq, exynos_irq_eint0_15);
  378. }
  379. }
  380. if (!muxed_banks)
  381. return 0;
  382. irq = irq_of_parse_and_map(wkup_np, 0);
  383. if (!irq) {
  384. dev_err(dev, "irq number for muxed EINTs not found\n");
  385. return 0;
  386. }
  387. muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
  388. + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
  389. if (!muxed_data) {
  390. dev_err(dev, "could not allocate memory for muxed_data\n");
  391. return -ENOMEM;
  392. }
  393. irq_set_chained_handler(irq, exynos_irq_demux_eint16_31);
  394. irq_set_handler_data(irq, muxed_data);
  395. bank = d->ctrl->pin_banks;
  396. idx = 0;
  397. for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
  398. if (bank->eint_type != EINT_TYPE_WKUP_MUX)
  399. continue;
  400. muxed_data->banks[idx++] = bank;
  401. }
  402. muxed_data->nr_banks = muxed_banks;
  403. return 0;
  404. }
  405. /* pin banks of exynos4210 pin-controller 0 */
  406. static struct samsung_pin_bank exynos4210_pin_banks0[] = {
  407. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
  408. EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
  409. EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
  410. EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
  411. EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
  412. EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
  413. EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
  414. EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
  415. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
  416. EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
  417. EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
  418. EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
  419. EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
  420. EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
  421. EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
  422. EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
  423. };
  424. /* pin banks of exynos4210 pin-controller 1 */
  425. static struct samsung_pin_bank exynos4210_pin_banks1[] = {
  426. EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
  427. EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
  428. EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
  429. EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
  430. EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
  431. EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
  432. EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
  433. EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
  434. EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
  435. EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
  436. EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
  437. EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
  438. EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
  439. EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
  440. EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
  441. EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
  442. EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
  443. EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
  444. EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
  445. EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
  446. };
  447. /* pin banks of exynos4210 pin-controller 2 */
  448. static struct samsung_pin_bank exynos4210_pin_banks2[] = {
  449. EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
  450. };
  451. /*
  452. * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
  453. * three gpio/pin-mux/pinconfig controllers.
  454. */
  455. struct samsung_pin_ctrl exynos4210_pin_ctrl[] = {
  456. {
  457. /* pin-controller instance 0 data */
  458. .pin_banks = exynos4210_pin_banks0,
  459. .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
  460. .geint_con = EXYNOS_GPIO_ECON_OFFSET,
  461. .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
  462. .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
  463. .svc = EXYNOS_SVC_OFFSET,
  464. .eint_gpio_init = exynos_eint_gpio_init,
  465. .label = "exynos4210-gpio-ctrl0",
  466. }, {
  467. /* pin-controller instance 1 data */
  468. .pin_banks = exynos4210_pin_banks1,
  469. .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
  470. .geint_con = EXYNOS_GPIO_ECON_OFFSET,
  471. .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
  472. .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
  473. .weint_con = EXYNOS_WKUP_ECON_OFFSET,
  474. .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
  475. .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
  476. .svc = EXYNOS_SVC_OFFSET,
  477. .eint_gpio_init = exynos_eint_gpio_init,
  478. .eint_wkup_init = exynos_eint_wkup_init,
  479. .label = "exynos4210-gpio-ctrl1",
  480. }, {
  481. /* pin-controller instance 2 data */
  482. .pin_banks = exynos4210_pin_banks2,
  483. .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
  484. .label = "exynos4210-gpio-ctrl2",
  485. },
  486. };