diff options
-rw-r--r-- | drivers/pinctrl/pinctrl-exynos.c | 55 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-exynos.h | 3 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-samsung.h | 1 |
3 files changed, 30 insertions, 29 deletions
diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index 0ea2164bf6d9..bd9f1307a793 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c | |||
@@ -146,7 +146,7 @@ static struct exynos_geint_data *exynos_get_eint_data(irq_hw_number_t hw, | |||
146 | struct samsung_pin_bank *bank = d->ctrl->pin_banks; | 146 | struct samsung_pin_bank *bank = d->ctrl->pin_banks; |
147 | struct exynos_geint_data *eint_data; | 147 | struct exynos_geint_data *eint_data; |
148 | unsigned int nr_banks = d->ctrl->nr_banks, idx; | 148 | unsigned int nr_banks = d->ctrl->nr_banks, idx; |
149 | unsigned int irq_base = 0, eint_offset = 0; | 149 | unsigned int irq_base = 0; |
150 | 150 | ||
151 | if (hw >= d->ctrl->nr_gint) { | 151 | if (hw >= d->ctrl->nr_gint) { |
152 | dev_err(d->dev, "unsupported ext-gpio interrupt\n"); | 152 | dev_err(d->dev, "unsupported ext-gpio interrupt\n"); |
@@ -159,7 +159,6 @@ static struct exynos_geint_data *exynos_get_eint_data(irq_hw_number_t hw, | |||
159 | if ((hw >= irq_base) && (hw < (irq_base + bank->nr_pins))) | 159 | if ((hw >= irq_base) && (hw < (irq_base + bank->nr_pins))) |
160 | break; | 160 | break; |
161 | irq_base += bank->nr_pins; | 161 | irq_base += bank->nr_pins; |
162 | eint_offset += 4; | ||
163 | } | 162 | } |
164 | 163 | ||
165 | if (idx == nr_banks) { | 164 | if (idx == nr_banks) { |
@@ -175,7 +174,7 @@ static struct exynos_geint_data *exynos_get_eint_data(irq_hw_number_t hw, | |||
175 | 174 | ||
176 | eint_data->bank = bank; | 175 | eint_data->bank = bank; |
177 | eint_data->pin = hw - irq_base; | 176 | eint_data->pin = hw - irq_base; |
178 | eint_data->eint_offset = eint_offset; | 177 | eint_data->eint_offset = bank->eint_offset; |
179 | return eint_data; | 178 | return eint_data; |
180 | } | 179 | } |
181 | 180 | ||
@@ -484,35 +483,35 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) | |||
484 | 483 | ||
485 | /* pin banks of exynos4210 pin-controller 0 */ | 484 | /* pin banks of exynos4210 pin-controller 0 */ |
486 | static struct samsung_pin_bank exynos4210_pin_banks0[] = { | 485 | static struct samsung_pin_bank exynos4210_pin_banks0[] = { |
487 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0"), | 486 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), |
488 | EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1"), | 487 | EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), |
489 | EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb"), | 488 | EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), |
490 | EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0"), | 489 | EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c), |
491 | EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1"), | 490 | EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10), |
492 | EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0"), | 491 | EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14), |
493 | EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1"), | 492 | EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18), |
494 | EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0"), | 493 | EXYNOS_PIN_BANK_EINTG(5, 0x0E0, "gpe0", 0x1c), |
495 | EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1"), | 494 | EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20), |
496 | EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2"), | 495 | EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpe2", 0x24), |
497 | EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3"), | 496 | EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe3", 0x28), |
498 | EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4"), | 497 | EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpe4", 0x2c), |
499 | EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0"), | 498 | EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30), |
500 | EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1"), | 499 | EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34), |
501 | EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2"), | 500 | EXYNOS_PIN_BANK_EINTG(8, 0x1C0, "gpf2", 0x38), |
502 | EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3"), | 501 | EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf3", 0x3c), |
503 | }; | 502 | }; |
504 | 503 | ||
505 | /* pin banks of exynos4210 pin-controller 1 */ | 504 | /* pin banks of exynos4210 pin-controller 1 */ |
506 | static struct samsung_pin_bank exynos4210_pin_banks1[] = { | 505 | static struct samsung_pin_bank exynos4210_pin_banks1[] = { |
507 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0"), | 506 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00), |
508 | EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1"), | 507 | EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04), |
509 | EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0"), | 508 | EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08), |
510 | EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1"), | 509 | EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c), |
511 | EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2"), | 510 | EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10), |
512 | EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3"), | 511 | EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14), |
513 | EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0"), | 512 | EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpl0", 0x18), |
514 | EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1"), | 513 | EXYNOS_PIN_BANK_EINTG(3, 0x0E0, "gpl1", 0x1c), |
515 | EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2"), | 514 | EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpl2", 0x20), |
516 | EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"), | 515 | EXYNOS_PIN_BANK_EINTN(6, 0x120, "gpy0"), |
517 | EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"), | 516 | EXYNOS_PIN_BANK_EINTN(4, 0x140, "gpy1"), |
518 | EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"), | 517 | EXYNOS_PIN_BANK_EINTN(6, 0x160, "gpy2"), |
diff --git a/drivers/pinctrl/pinctrl-exynos.h b/drivers/pinctrl/pinctrl-exynos.h index 2de4a2936e9c..5d8e380fbadf 100644 --- a/drivers/pinctrl/pinctrl-exynos.h +++ b/drivers/pinctrl/pinctrl-exynos.h | |||
@@ -59,7 +59,7 @@ | |||
59 | .name = id \ | 59 | .name = id \ |
60 | } | 60 | } |
61 | 61 | ||
62 | #define EXYNOS_PIN_BANK_EINTG(pins, reg, id) \ | 62 | #define EXYNOS_PIN_BANK_EINTG(pins, reg, id, offs) \ |
63 | { \ | 63 | { \ |
64 | .pctl_offset = reg, \ | 64 | .pctl_offset = reg, \ |
65 | .nr_pins = pins, \ | 65 | .nr_pins = pins, \ |
@@ -69,6 +69,7 @@ | |||
69 | .conpdn_width = 2, \ | 69 | .conpdn_width = 2, \ |
70 | .pudpdn_width = 2, \ | 70 | .pudpdn_width = 2, \ |
71 | .eint_type = EINT_TYPE_GPIO, \ | 71 | .eint_type = EINT_TYPE_GPIO, \ |
72 | .eint_offset = offs, \ | ||
72 | .name = id \ | 73 | .name = id \ |
73 | } | 74 | } |
74 | 75 | ||
diff --git a/drivers/pinctrl/pinctrl-samsung.h b/drivers/pinctrl/pinctrl-samsung.h index ea5dadd35913..d77d9bcc5d7d 100644 --- a/drivers/pinctrl/pinctrl-samsung.h +++ b/drivers/pinctrl/pinctrl-samsung.h | |||
@@ -124,6 +124,7 @@ struct samsung_pin_bank { | |||
124 | u8 conpdn_width; | 124 | u8 conpdn_width; |
125 | u8 pudpdn_width; | 125 | u8 pudpdn_width; |
126 | enum eint_type eint_type; | 126 | enum eint_type eint_type; |
127 | u32 eint_offset; | ||
127 | u32 irq_base; | 128 | u32 irq_base; |
128 | char *name; | 129 | char *name; |
129 | struct device_node *of_node; | 130 | struct device_node *of_node; |