blob: 4f868e59227e72b016d0015688828384c3cb660b [file] [log] [blame]
Thomas Abraham43b169d2012-09-07 06:07:19 +09001/*
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
21#include <linux/module.h>
22#include <linux/device.h>
23#include <linux/interrupt.h>
24#include <linux/irqdomain.h>
25#include <linux/irq.h>
Catalin Marinasde88cbb2013-01-18 15:31:37 +000026#include <linux/irqchip/chained_irq.h>
Thomas Abraham43b169d2012-09-07 06:07:19 +090027#include <linux/of_irq.h>
28#include <linux/io.h>
29#include <linux/slab.h>
Tomasz Figa19846952013-03-18 22:31:50 +010030#include <linux/spinlock.h>
Thomas Abraham43b169d2012-09-07 06:07:19 +090031#include <linux/err.h>
32
Thomas Abraham43b169d2012-09-07 06:07:19 +090033#include "pinctrl-samsung.h"
34#include "pinctrl-exynos.h"
35
Tomasz Figa499147c2013-03-18 22:31:52 +010036
37static struct samsung_pin_bank_type bank_type_off = {
38 .fld_width = { 4, 1, 2, 2, 2, 2, },
Tomasz Figa43fc9e72013-03-18 22:31:53 +010039 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
Tomasz Figa499147c2013-03-18 22:31:52 +010040};
41
42static struct samsung_pin_bank_type bank_type_alive = {
43 .fld_width = { 4, 1, 2, 2, },
Tomasz Figa43fc9e72013-03-18 22:31:53 +010044 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
Tomasz Figa499147c2013-03-18 22:31:52 +010045};
46
Thomas Abraham43b169d2012-09-07 06:07:19 +090047/* list of external wakeup controllers supported */
48static const struct of_device_id exynos_wkup_irq_ids[] = {
49 { .compatible = "samsung,exynos4210-wakeup-eint", },
Axel Linafa538c2012-11-02 21:46:13 +080050 { }
Thomas Abraham43b169d2012-09-07 06:07:19 +090051};
52
53static void exynos_gpio_irq_unmask(struct irq_data *irqd)
54{
Tomasz Figa595be722012-10-11 10:11:16 +020055 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
56 struct samsung_pinctrl_drv_data *d = bank->drvdata;
57 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +090058 unsigned long mask;
59
60 mask = readl(d->virt_base + reg_mask);
Tomasz Figa595be722012-10-11 10:11:16 +020061 mask &= ~(1 << irqd->hwirq);
Thomas Abraham43b169d2012-09-07 06:07:19 +090062 writel(mask, d->virt_base + reg_mask);
63}
64
65static void exynos_gpio_irq_mask(struct irq_data *irqd)
66{
Tomasz Figa595be722012-10-11 10:11:16 +020067 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
68 struct samsung_pinctrl_drv_data *d = bank->drvdata;
69 unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +090070 unsigned long mask;
71
72 mask = readl(d->virt_base + reg_mask);
Tomasz Figa595be722012-10-11 10:11:16 +020073 mask |= 1 << irqd->hwirq;
Thomas Abraham43b169d2012-09-07 06:07:19 +090074 writel(mask, d->virt_base + reg_mask);
75}
76
77static void exynos_gpio_irq_ack(struct irq_data *irqd)
78{
Tomasz Figa595be722012-10-11 10:11:16 +020079 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
80 struct samsung_pinctrl_drv_data *d = bank->drvdata;
81 unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +090082
Tomasz Figa595be722012-10-11 10:11:16 +020083 writel(1 << irqd->hwirq, d->virt_base + reg_pend);
Thomas Abraham43b169d2012-09-07 06:07:19 +090084}
85
86static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
87{
Tomasz Figa595be722012-10-11 10:11:16 +020088 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
Tomasz Figa499147c2013-03-18 22:31:52 +010089 struct samsung_pin_bank_type *bank_type = bank->type;
Tomasz Figa595be722012-10-11 10:11:16 +020090 struct samsung_pinctrl_drv_data *d = bank->drvdata;
Thomas Abraham43b169d2012-09-07 06:07:19 +090091 struct samsung_pin_ctrl *ctrl = d->ctrl;
Tomasz Figa595be722012-10-11 10:11:16 +020092 unsigned int pin = irqd->hwirq;
93 unsigned int shift = EXYNOS_EINT_CON_LEN * pin;
Thomas Abraham43b169d2012-09-07 06:07:19 +090094 unsigned int con, trig_type;
Tomasz Figa595be722012-10-11 10:11:16 +020095 unsigned long reg_con = ctrl->geint_con + bank->eint_offset;
Tomasz Figa19846952013-03-18 22:31:50 +010096 unsigned long flags;
Tomasz Figaee2f5732012-09-21 07:33:48 +090097 unsigned int mask;
Thomas Abraham43b169d2012-09-07 06:07:19 +090098
99 switch (type) {
100 case IRQ_TYPE_EDGE_RISING:
101 trig_type = EXYNOS_EINT_EDGE_RISING;
102 break;
103 case IRQ_TYPE_EDGE_FALLING:
104 trig_type = EXYNOS_EINT_EDGE_FALLING;
105 break;
106 case IRQ_TYPE_EDGE_BOTH:
107 trig_type = EXYNOS_EINT_EDGE_BOTH;
108 break;
109 case IRQ_TYPE_LEVEL_HIGH:
110 trig_type = EXYNOS_EINT_LEVEL_HIGH;
111 break;
112 case IRQ_TYPE_LEVEL_LOW:
113 trig_type = EXYNOS_EINT_LEVEL_LOW;
114 break;
115 default:
116 pr_err("unsupported external interrupt type\n");
117 return -EINVAL;
118 }
119
120 if (type & IRQ_TYPE_EDGE_BOTH)
121 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
122 else
123 __irq_set_handler_locked(irqd->irq, handle_level_irq);
124
125 con = readl(d->virt_base + reg_con);
126 con &= ~(EXYNOS_EINT_CON_MASK << shift);
127 con |= trig_type << shift;
128 writel(con, d->virt_base + reg_con);
Tomasz Figaee2f5732012-09-21 07:33:48 +0900129
Tomasz Figa43fc9e72013-03-18 22:31:53 +0100130 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
Tomasz Figa499147c2013-03-18 22:31:52 +0100131 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
132 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
Tomasz Figaee2f5732012-09-21 07:33:48 +0900133
Tomasz Figa19846952013-03-18 22:31:50 +0100134 spin_lock_irqsave(&bank->slock, flags);
135
Tomasz Figaee2f5732012-09-21 07:33:48 +0900136 con = readl(d->virt_base + reg_con);
137 con &= ~(mask << shift);
138 con |= EXYNOS_EINT_FUNC << shift;
139 writel(con, d->virt_base + reg_con);
140
Tomasz Figa19846952013-03-18 22:31:50 +0100141 spin_unlock_irqrestore(&bank->slock, flags);
142
Thomas Abraham43b169d2012-09-07 06:07:19 +0900143 return 0;
144}
145
146/*
147 * irq_chip for gpio interrupts.
148 */
149static struct irq_chip exynos_gpio_irq_chip = {
150 .name = "exynos_gpio_irq_chip",
151 .irq_unmask = exynos_gpio_irq_unmask,
152 .irq_mask = exynos_gpio_irq_mask,
153 .irq_ack = exynos_gpio_irq_ack,
154 .irq_set_type = exynos_gpio_irq_set_type,
155};
156
Thomas Abraham43b169d2012-09-07 06:07:19 +0900157static int exynos_gpio_irq_map(struct irq_domain *h, unsigned int virq,
158 irq_hw_number_t hw)
159{
Tomasz Figa595be722012-10-11 10:11:16 +0200160 struct samsung_pin_bank *b = h->host_data;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900161
Tomasz Figa595be722012-10-11 10:11:16 +0200162 irq_set_chip_data(virq, b);
Thomas Abraham43b169d2012-09-07 06:07:19 +0900163 irq_set_chip_and_handler(virq, &exynos_gpio_irq_chip,
164 handle_level_irq);
165 set_irq_flags(virq, IRQF_VALID);
166 return 0;
167}
168
Thomas Abraham43b169d2012-09-07 06:07:19 +0900169/*
170 * irq domain callbacks for external gpio interrupt controller.
171 */
172static const struct irq_domain_ops exynos_gpio_irqd_ops = {
173 .map = exynos_gpio_irq_map,
Thomas Abraham43b169d2012-09-07 06:07:19 +0900174 .xlate = irq_domain_xlate_twocell,
175};
176
177static irqreturn_t exynos_eint_gpio_irq(int irq, void *data)
178{
179 struct samsung_pinctrl_drv_data *d = data;
180 struct samsung_pin_ctrl *ctrl = d->ctrl;
181 struct samsung_pin_bank *bank = ctrl->pin_banks;
182 unsigned int svc, group, pin, virq;
183
184 svc = readl(d->virt_base + ctrl->svc);
185 group = EXYNOS_SVC_GROUP(svc);
186 pin = svc & EXYNOS_SVC_NUM_MASK;
187
188 if (!group)
189 return IRQ_HANDLED;
190 bank += (group - 1);
191
Tomasz Figa595be722012-10-11 10:11:16 +0200192 virq = irq_linear_revmap(bank->irq_domain, pin);
Thomas Abraham43b169d2012-09-07 06:07:19 +0900193 if (!virq)
194 return IRQ_NONE;
195 generic_handle_irq(virq);
196 return IRQ_HANDLED;
197}
198
199/*
200 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
201 * @d: driver data of samsung pinctrl driver.
202 */
203static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
204{
Tomasz Figa595be722012-10-11 10:11:16 +0200205 struct samsung_pin_bank *bank;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900206 struct device *dev = d->dev;
207 unsigned int ret;
Tomasz Figa595be722012-10-11 10:11:16 +0200208 unsigned int i;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900209
210 if (!d->irq) {
211 dev_err(dev, "irq number not available\n");
212 return -EINVAL;
213 }
214
215 ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
216 0, dev_name(dev), d);
217 if (ret) {
218 dev_err(dev, "irq request failed\n");
219 return -ENXIO;
220 }
221
Tomasz Figa595be722012-10-11 10:11:16 +0200222 bank = d->ctrl->pin_banks;
223 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
224 if (bank->eint_type != EINT_TYPE_GPIO)
225 continue;
226 bank->irq_domain = irq_domain_add_linear(bank->of_node,
227 bank->nr_pins, &exynos_gpio_irqd_ops, bank);
228 if (!bank->irq_domain) {
229 dev_err(dev, "gpio irq domain add failed\n");
230 return -ENXIO;
231 }
Thomas Abraham43b169d2012-09-07 06:07:19 +0900232 }
233
234 return 0;
235}
236
237static void exynos_wkup_irq_unmask(struct irq_data *irqd)
238{
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200239 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
240 struct samsung_pinctrl_drv_data *d = b->drvdata;
241 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900242 unsigned long mask;
243
244 mask = readl(d->virt_base + reg_mask);
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200245 mask &= ~(1 << irqd->hwirq);
Thomas Abraham43b169d2012-09-07 06:07:19 +0900246 writel(mask, d->virt_base + reg_mask);
247}
248
249static void exynos_wkup_irq_mask(struct irq_data *irqd)
250{
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200251 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
252 struct samsung_pinctrl_drv_data *d = b->drvdata;
253 unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900254 unsigned long mask;
255
256 mask = readl(d->virt_base + reg_mask);
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200257 mask |= 1 << irqd->hwirq;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900258 writel(mask, d->virt_base + reg_mask);
259}
260
261static void exynos_wkup_irq_ack(struct irq_data *irqd)
262{
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200263 struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
264 struct samsung_pinctrl_drv_data *d = b->drvdata;
265 unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900266
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200267 writel(1 << irqd->hwirq, d->virt_base + pend);
Thomas Abraham43b169d2012-09-07 06:07:19 +0900268}
269
270static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
271{
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200272 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
Tomasz Figa499147c2013-03-18 22:31:52 +0100273 struct samsung_pin_bank_type *bank_type = bank->type;
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200274 struct samsung_pinctrl_drv_data *d = bank->drvdata;
275 unsigned int pin = irqd->hwirq;
276 unsigned long reg_con = d->ctrl->weint_con + bank->eint_offset;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900277 unsigned long shift = EXYNOS_EINT_CON_LEN * pin;
278 unsigned long con, trig_type;
Tomasz Figa19846952013-03-18 22:31:50 +0100279 unsigned long flags;
Tomasz Figa22b9ba02012-10-11 10:11:19 +0200280 unsigned int mask;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900281
282 switch (type) {
283 case IRQ_TYPE_EDGE_RISING:
284 trig_type = EXYNOS_EINT_EDGE_RISING;
285 break;
286 case IRQ_TYPE_EDGE_FALLING:
287 trig_type = EXYNOS_EINT_EDGE_FALLING;
288 break;
289 case IRQ_TYPE_EDGE_BOTH:
290 trig_type = EXYNOS_EINT_EDGE_BOTH;
291 break;
292 case IRQ_TYPE_LEVEL_HIGH:
293 trig_type = EXYNOS_EINT_LEVEL_HIGH;
294 break;
295 case IRQ_TYPE_LEVEL_LOW:
296 trig_type = EXYNOS_EINT_LEVEL_LOW;
297 break;
298 default:
299 pr_err("unsupported external interrupt type\n");
300 return -EINVAL;
301 }
302
303 if (type & IRQ_TYPE_EDGE_BOTH)
304 __irq_set_handler_locked(irqd->irq, handle_edge_irq);
305 else
306 __irq_set_handler_locked(irqd->irq, handle_level_irq);
307
308 con = readl(d->virt_base + reg_con);
309 con &= ~(EXYNOS_EINT_CON_MASK << shift);
310 con |= trig_type << shift;
311 writel(con, d->virt_base + reg_con);
Tomasz Figa22b9ba02012-10-11 10:11:19 +0200312
Tomasz Figa43fc9e72013-03-18 22:31:53 +0100313 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
Tomasz Figa499147c2013-03-18 22:31:52 +0100314 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
315 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
Tomasz Figa22b9ba02012-10-11 10:11:19 +0200316
Tomasz Figa19846952013-03-18 22:31:50 +0100317 spin_lock_irqsave(&bank->slock, flags);
318
Tomasz Figa22b9ba02012-10-11 10:11:19 +0200319 con = readl(d->virt_base + reg_con);
320 con &= ~(mask << shift);
321 con |= EXYNOS_EINT_FUNC << shift;
322 writel(con, d->virt_base + reg_con);
323
Tomasz Figa19846952013-03-18 22:31:50 +0100324 spin_unlock_irqrestore(&bank->slock, flags);
325
Thomas Abraham43b169d2012-09-07 06:07:19 +0900326 return 0;
327}
328
Tomasz Figaad350cd2013-05-17 18:24:27 +0200329static u32 exynos_eint_wake_mask = 0xffffffff;
330
331u32 exynos_get_eint_wake_mask(void)
332{
333 return exynos_eint_wake_mask;
334}
335
336static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on)
337{
338 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
339 unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq);
340
341 pr_info("wake %s for irq %d\n", on ? "enabled" : "disabled", irqd->irq);
342
343 if (!on)
344 exynos_eint_wake_mask |= bit;
345 else
346 exynos_eint_wake_mask &= ~bit;
347
348 return 0;
349}
350
Thomas Abraham43b169d2012-09-07 06:07:19 +0900351/*
352 * irq_chip for wakeup interrupts
353 */
354static struct irq_chip exynos_wkup_irq_chip = {
355 .name = "exynos_wkup_irq_chip",
356 .irq_unmask = exynos_wkup_irq_unmask,
357 .irq_mask = exynos_wkup_irq_mask,
358 .irq_ack = exynos_wkup_irq_ack,
359 .irq_set_type = exynos_wkup_irq_set_type,
Tomasz Figaad350cd2013-05-17 18:24:27 +0200360 .irq_set_wake = exynos_wkup_irq_set_wake,
Thomas Abraham43b169d2012-09-07 06:07:19 +0900361};
362
363/* interrupt handler for wakeup interrupts 0..15 */
364static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
365{
366 struct exynos_weint_data *eintd = irq_get_handler_data(irq);
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200367 struct samsung_pin_bank *bank = eintd->bank;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900368 struct irq_chip *chip = irq_get_chip(irq);
369 int eint_irq;
370
371 chained_irq_enter(chip, desc);
372 chip->irq_mask(&desc->irq_data);
373
374 if (chip->irq_ack)
375 chip->irq_ack(&desc->irq_data);
376
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200377 eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
Thomas Abraham43b169d2012-09-07 06:07:19 +0900378 generic_handle_irq(eint_irq);
379 chip->irq_unmask(&desc->irq_data);
380 chained_irq_exit(chip, desc);
381}
382
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200383static inline void exynos_irq_demux_eint(unsigned long pend,
384 struct irq_domain *domain)
Thomas Abraham43b169d2012-09-07 06:07:19 +0900385{
386 unsigned int irq;
387
388 while (pend) {
389 irq = fls(pend) - 1;
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200390 generic_handle_irq(irq_find_mapping(domain, irq));
Thomas Abraham43b169d2012-09-07 06:07:19 +0900391 pend &= ~(1 << irq);
392 }
393}
394
395/* interrupt handler for wakeup interrupt 16 */
396static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
397{
398 struct irq_chip *chip = irq_get_chip(irq);
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200399 struct exynos_muxed_weint_data *eintd = irq_get_handler_data(irq);
400 struct samsung_pinctrl_drv_data *d = eintd->banks[0]->drvdata;
401 struct samsung_pin_ctrl *ctrl = d->ctrl;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900402 unsigned long pend;
Tomasz Figade590492012-09-21 07:33:55 +0900403 unsigned long mask;
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200404 int i;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900405
406 chained_irq_enter(chip, desc);
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200407
408 for (i = 0; i < eintd->nr_banks; ++i) {
409 struct samsung_pin_bank *b = eintd->banks[i];
410 pend = readl(d->virt_base + ctrl->weint_pend + b->eint_offset);
411 mask = readl(d->virt_base + ctrl->weint_mask + b->eint_offset);
412 exynos_irq_demux_eint(pend & ~mask, b->irq_domain);
413 }
414
Thomas Abraham43b169d2012-09-07 06:07:19 +0900415 chained_irq_exit(chip, desc);
416}
417
418static int exynos_wkup_irq_map(struct irq_domain *h, unsigned int virq,
419 irq_hw_number_t hw)
420{
421 irq_set_chip_and_handler(virq, &exynos_wkup_irq_chip, handle_level_irq);
422 irq_set_chip_data(virq, h->host_data);
423 set_irq_flags(virq, IRQF_VALID);
424 return 0;
425}
426
427/*
428 * irq domain callbacks for external wakeup interrupt controller.
429 */
430static const struct irq_domain_ops exynos_wkup_irqd_ops = {
431 .map = exynos_wkup_irq_map,
432 .xlate = irq_domain_xlate_twocell,
433};
434
435/*
436 * exynos_eint_wkup_init() - setup handling of external wakeup interrupts.
437 * @d: driver data of samsung pinctrl driver.
438 */
439static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
440{
441 struct device *dev = d->dev;
Tomasz Figac3ad0562012-09-21 07:34:01 +0900442 struct device_node *wkup_np = NULL;
443 struct device_node *np;
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200444 struct samsung_pin_bank *bank;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900445 struct exynos_weint_data *weint_data;
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200446 struct exynos_muxed_weint_data *muxed_data;
447 unsigned int muxed_banks = 0;
448 unsigned int i;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900449 int idx, irq;
450
Tomasz Figac3ad0562012-09-21 07:34:01 +0900451 for_each_child_of_node(dev->of_node, np) {
452 if (of_match_node(exynos_wkup_irq_ids, np)) {
453 wkup_np = np;
454 break;
455 }
Thomas Abraham43b169d2012-09-07 06:07:19 +0900456 }
Tomasz Figac3ad0562012-09-21 07:34:01 +0900457 if (!wkup_np)
458 return -ENODEV;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900459
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200460 bank = d->ctrl->pin_banks;
461 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
462 if (bank->eint_type != EINT_TYPE_WKUP)
463 continue;
464
465 bank->irq_domain = irq_domain_add_linear(bank->of_node,
466 bank->nr_pins, &exynos_wkup_irqd_ops, bank);
467 if (!bank->irq_domain) {
468 dev_err(dev, "wkup irq domain add failed\n");
469 return -ENXIO;
470 }
471
472 if (!of_find_property(bank->of_node, "interrupts", NULL)) {
473 bank->eint_type = EINT_TYPE_WKUP_MUX;
474 ++muxed_banks;
475 continue;
476 }
477
478 weint_data = devm_kzalloc(dev, bank->nr_pins
479 * sizeof(*weint_data), GFP_KERNEL);
480 if (!weint_data) {
481 dev_err(dev, "could not allocate memory for weint_data\n");
482 return -ENOMEM;
483 }
484
485 for (idx = 0; idx < bank->nr_pins; ++idx) {
486 irq = irq_of_parse_and_map(bank->of_node, idx);
487 if (!irq) {
488 dev_err(dev, "irq number for eint-%s-%d not found\n",
489 bank->name, idx);
490 continue;
491 }
492 weint_data[idx].irq = idx;
493 weint_data[idx].bank = bank;
494 irq_set_handler_data(irq, &weint_data[idx]);
495 irq_set_chained_handler(irq, exynos_irq_eint0_15);
496 }
Thomas Abraham43b169d2012-09-07 06:07:19 +0900497 }
498
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200499 if (!muxed_banks)
500 return 0;
501
502 irq = irq_of_parse_and_map(wkup_np, 0);
503 if (!irq) {
504 dev_err(dev, "irq number for muxed EINTs not found\n");
505 return 0;
506 }
507
508 muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
509 + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
510 if (!muxed_data) {
511 dev_err(dev, "could not allocate memory for muxed_data\n");
Thomas Abraham43b169d2012-09-07 06:07:19 +0900512 return -ENOMEM;
513 }
514
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200515 irq_set_chained_handler(irq, exynos_irq_demux_eint16_31);
516 irq_set_handler_data(irq, muxed_data);
Thomas Abraham43b169d2012-09-07 06:07:19 +0900517
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200518 bank = d->ctrl->pin_banks;
519 idx = 0;
520 for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) {
521 if (bank->eint_type != EINT_TYPE_WKUP_MUX)
522 continue;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900523
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200524 muxed_data->banks[idx++] = bank;
Thomas Abraham43b169d2012-09-07 06:07:19 +0900525 }
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200526 muxed_data->nr_banks = muxed_banks;
527
Thomas Abraham43b169d2012-09-07 06:07:19 +0900528 return 0;
529}
530
531/* pin banks of exynos4210 pin-controller 0 */
532static struct samsung_pin_bank exynos4210_pin_banks0[] = {
Tomasz Figa1b6056d2012-10-11 10:11:15 +0200533 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
534 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
535 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
536 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
537 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
538 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
539 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
540 EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c),
541 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
542 EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24),
543 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28),
544 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c),
545 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
546 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
547 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
548 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
Thomas Abraham43b169d2012-09-07 06:07:19 +0900549};
550
551/* pin banks of exynos4210 pin-controller 1 */
552static struct samsung_pin_bank exynos4210_pin_banks1[] = {
Tomasz Figa1b6056d2012-10-11 10:11:15 +0200553 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
554 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
555 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
556 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
557 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
558 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
559 EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18),
560 EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c),
561 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
Tomasz Figa40ba6222012-10-11 10:11:09 +0200562 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
563 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
564 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
565 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
566 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
567 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
568 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
Tomasz Figaa04b07c2012-10-11 10:11:18 +0200569 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
570 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
571 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
572 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
Thomas Abraham43b169d2012-09-07 06:07:19 +0900573};
574
575/* pin banks of exynos4210 pin-controller 2 */
576static struct samsung_pin_bank exynos4210_pin_banks2[] = {
Tomasz Figa40ba6222012-10-11 10:11:09 +0200577 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
Thomas Abraham43b169d2012-09-07 06:07:19 +0900578};
579
580/*
581 * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
582 * three gpio/pin-mux/pinconfig controllers.
583 */
584struct samsung_pin_ctrl exynos4210_pin_ctrl[] = {
585 {
586 /* pin-controller instance 0 data */
587 .pin_banks = exynos4210_pin_banks0,
588 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks0),
Thomas Abraham43b169d2012-09-07 06:07:19 +0900589 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
590 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
591 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
592 .svc = EXYNOS_SVC_OFFSET,
593 .eint_gpio_init = exynos_eint_gpio_init,
594 .label = "exynos4210-gpio-ctrl0",
595 }, {
596 /* pin-controller instance 1 data */
597 .pin_banks = exynos4210_pin_banks1,
598 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks1),
Thomas Abraham43b169d2012-09-07 06:07:19 +0900599 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
600 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
601 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
602 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
603 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
604 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
605 .svc = EXYNOS_SVC_OFFSET,
606 .eint_gpio_init = exynos_eint_gpio_init,
607 .eint_wkup_init = exynos_eint_wkup_init,
608 .label = "exynos4210-gpio-ctrl1",
609 }, {
610 /* pin-controller instance 2 data */
611 .pin_banks = exynos4210_pin_banks2,
612 .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
Thomas Abraham43b169d2012-09-07 06:07:19 +0900613 .label = "exynos4210-gpio-ctrl2",
614 },
615};
Tomasz Figa6edc7942012-11-07 08:44:59 +0900616
617/* pin banks of exynos4x12 pin-controller 0 */
618static struct samsung_pin_bank exynos4x12_pin_banks0[] = {
619 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
620 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
621 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
622 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
623 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
624 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
625 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
626 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
627 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
628 EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38),
629 EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c),
630 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x40),
631 EXYNOS_PIN_BANK_EINTG(5, 0x260, "gpj1", 0x44),
632};
633
634/* pin banks of exynos4x12 pin-controller 1 */
635static struct samsung_pin_bank exynos4x12_pin_banks1[] = {
636 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
637 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
638 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
639 EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
640 EXYNOS_PIN_BANK_EINTG(7, 0x0C0, "gpl0", 0x18),
641 EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpl1", 0x1c),
642 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20),
643 EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
644 EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
645 EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
646 EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
647 EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
648 EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"),
649 EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"),
650 EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"),
651 EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy3"),
652 EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "gpy4"),
653 EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "gpy5"),
654 EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "gpy6"),
655 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
656 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
657 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
658 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
659};
660
661/* pin banks of exynos4x12 pin-controller 2 */
662static struct samsung_pin_bank exynos4x12_pin_banks2[] = {
663 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
664};
665
666/* pin banks of exynos4x12 pin-controller 3 */
667static struct samsung_pin_bank exynos4x12_pin_banks3[] = {
668 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
669 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
670 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
671 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv3", 0x0c),
672 EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpv4", 0x10),
673};
674
675/*
676 * Samsung pinctrl driver data for Exynos4x12 SoC. Exynos4x12 SoC includes
677 * four gpio/pin-mux/pinconfig controllers.
678 */
679struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = {
680 {
681 /* pin-controller instance 0 data */
682 .pin_banks = exynos4x12_pin_banks0,
683 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks0),
684 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
685 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
686 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
687 .svc = EXYNOS_SVC_OFFSET,
688 .eint_gpio_init = exynos_eint_gpio_init,
689 .label = "exynos4x12-gpio-ctrl0",
690 }, {
691 /* pin-controller instance 1 data */
692 .pin_banks = exynos4x12_pin_banks1,
693 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks1),
694 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
695 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
696 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
697 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
698 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
699 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
700 .svc = EXYNOS_SVC_OFFSET,
701 .eint_gpio_init = exynos_eint_gpio_init,
702 .eint_wkup_init = exynos_eint_wkup_init,
703 .label = "exynos4x12-gpio-ctrl1",
704 }, {
705 /* pin-controller instance 2 data */
706 .pin_banks = exynos4x12_pin_banks2,
707 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks2),
708 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
709 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
710 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
711 .svc = EXYNOS_SVC_OFFSET,
712 .eint_gpio_init = exynos_eint_gpio_init,
713 .label = "exynos4x12-gpio-ctrl2",
714 }, {
715 /* pin-controller instance 3 data */
716 .pin_banks = exynos4x12_pin_banks3,
717 .nr_banks = ARRAY_SIZE(exynos4x12_pin_banks3),
718 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
719 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
720 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
721 .svc = EXYNOS_SVC_OFFSET,
722 .eint_gpio_init = exynos_eint_gpio_init,
723 .label = "exynos4x12-gpio-ctrl3",
724 },
725};
Thomas Abrahamf67faf42012-12-28 10:37:27 -0800726
727/* pin banks of exynos5250 pin-controller 0 */
728static struct samsung_pin_bank exynos5250_pin_banks0[] = {
729 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
730 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
731 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
732 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
733 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
734 EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
735 EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18),
736 EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c),
737 EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc1", 0x20),
738 EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc2", 0x24),
739 EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc3", 0x28),
740 EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpd0", 0x2c),
741 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x30),
742 EXYNOS_PIN_BANK_EINTG(7, 0x2E0, "gpc4", 0x34),
743 EXYNOS_PIN_BANK_EINTN(6, 0x1A0, "gpy0"),
744 EXYNOS_PIN_BANK_EINTN(4, 0x1C0, "gpy1"),
745 EXYNOS_PIN_BANK_EINTN(6, 0x1E0, "gpy2"),
746 EXYNOS_PIN_BANK_EINTN(8, 0x200, "gpy3"),
747 EXYNOS_PIN_BANK_EINTN(8, 0x220, "gpy4"),
748 EXYNOS_PIN_BANK_EINTN(8, 0x240, "gpy5"),
749 EXYNOS_PIN_BANK_EINTN(8, 0x260, "gpy6"),
750 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
751 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
752 EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
753 EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
754};
755
756/* pin banks of exynos5250 pin-controller 1 */
757static struct samsung_pin_bank exynos5250_pin_banks1[] = {
758 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
759 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
760 EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08),
761 EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf1", 0x0c),
762 EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
763 EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
764 EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
765 EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gph0", 0x1c),
766 EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph1", 0x20),
767};
768
769/* pin banks of exynos5250 pin-controller 2 */
770static struct samsung_pin_bank exynos5250_pin_banks2[] = {
771 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
772 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
773 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
774 EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c),
775 EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10),
776};
777
778/* pin banks of exynos5250 pin-controller 3 */
779static struct samsung_pin_bank exynos5250_pin_banks3[] = {
780 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
781};
782
783/*
784 * Samsung pinctrl driver data for Exynos5250 SoC. Exynos5250 SoC includes
785 * four gpio/pin-mux/pinconfig controllers.
786 */
787struct samsung_pin_ctrl exynos5250_pin_ctrl[] = {
788 {
789 /* pin-controller instance 0 data */
790 .pin_banks = exynos5250_pin_banks0,
791 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks0),
792 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
793 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
794 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
795 .weint_con = EXYNOS_WKUP_ECON_OFFSET,
796 .weint_mask = EXYNOS_WKUP_EMASK_OFFSET,
797 .weint_pend = EXYNOS_WKUP_EPEND_OFFSET,
798 .svc = EXYNOS_SVC_OFFSET,
799 .eint_gpio_init = exynos_eint_gpio_init,
800 .eint_wkup_init = exynos_eint_wkup_init,
801 .label = "exynos5250-gpio-ctrl0",
802 }, {
803 /* pin-controller instance 1 data */
804 .pin_banks = exynos5250_pin_banks1,
805 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks1),
806 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
807 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
808 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
809 .svc = EXYNOS_SVC_OFFSET,
810 .eint_gpio_init = exynos_eint_gpio_init,
811 .label = "exynos5250-gpio-ctrl1",
812 }, {
813 /* pin-controller instance 2 data */
814 .pin_banks = exynos5250_pin_banks2,
815 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks2),
816 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
817 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
818 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
819 .svc = EXYNOS_SVC_OFFSET,
820 .eint_gpio_init = exynos_eint_gpio_init,
821 .label = "exynos5250-gpio-ctrl2",
822 }, {
823 /* pin-controller instance 3 data */
824 .pin_banks = exynos5250_pin_banks3,
825 .nr_banks = ARRAY_SIZE(exynos5250_pin_banks3),
826 .geint_con = EXYNOS_GPIO_ECON_OFFSET,
827 .geint_mask = EXYNOS_GPIO_EMASK_OFFSET,
828 .geint_pend = EXYNOS_GPIO_EPEND_OFFSET,
829 .svc = EXYNOS_SVC_OFFSET,
830 .eint_gpio_init = exynos_eint_gpio_init,
831 .label = "exynos5250-gpio-ctrl3",
832 },
833};