aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-exynos.h
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2012-10-11 04:11:18 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-10-15 03:10:12 -0400
commita04b07c0fc4d63e3fb9fea84d48a177ac5bd9164 (patch)
tree38504cfbceac9b3ed6359caded76a626b633fa12 /drivers/pinctrl/pinctrl-exynos.h
parentd3a7b9e3a168df881a0ae3bd0d582f44a5d5aca3 (diff)
pinctrl: samsung: Use per-bank IRQ domain for wake-up interrupts
This patch reworks wake-up interrupt handling in pinctrl-exynos driver, so each pin bank, which provides wake-up interrupts, has its own IRQ domain. Information about whether given pin bank provides wake-up interrupts, how many and whether they are separate or muxed are parsed from device tree. It gives following advantages: - interrupts can be specified in device tree in a more readable way, e.g. : device { /* ... */ interrupt-parent = <&gpx2>; interrupts = <4 0>; /* ... */ }; - the amount and layout of interrupts is not hardcoded in the code anymore, but defined in SoC-specific structure - bank and pin of each wake-up interrupt can be easily identified, to allow operations, such as setting the pin to EINT function, from irq_set_type() callback Signed-off-by: Tomasz Figa <t.figa@samsung.com> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-exynos.h')
-rw-r--r--drivers/pinctrl/pinctrl-exynos.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-exynos.h b/drivers/pinctrl/pinctrl-exynos.h
index f05efa074658..0a708890d8b4 100644
--- a/drivers/pinctrl/pinctrl-exynos.h
+++ b/drivers/pinctrl/pinctrl-exynos.h
@@ -73,13 +73,36 @@
73 .name = id \ 73 .name = id \
74 } 74 }
75 75
76#define EXYNOS_PIN_BANK_EINTW(pins, reg, id, offs) \
77 { \
78 .pctl_offset = reg, \
79 .nr_pins = pins, \
80 .func_width = 4, \
81 .pud_width = 2, \
82 .drv_width = 2, \
83 .eint_type = EINT_TYPE_WKUP, \
84 .eint_offset = offs, \
85 .name = id \
86 }
87
76/** 88/**
77 * struct exynos_weint_data: irq specific data for all the wakeup interrupts 89 * struct exynos_weint_data: irq specific data for all the wakeup interrupts
78 * generated by the external wakeup interrupt controller. 90 * generated by the external wakeup interrupt controller.
79 * @domain: irq domain representing the external wakeup interrupts
80 * @irq: interrupt number within the domain. 91 * @irq: interrupt number within the domain.
92 * @bank: bank responsible for this interrupt
81 */ 93 */
82struct exynos_weint_data { 94struct exynos_weint_data {
83 struct irq_domain *domain; 95 unsigned int irq;
84 u32 irq; 96 struct samsung_pin_bank *bank;
97};
98
99/**
100 * struct exynos_muxed_weint_data: irq specific data for muxed wakeup interrupts
101 * generated by the external wakeup interrupt controller.
102 * @nr_banks: count of banks being part of the mux
103 * @banks: array of banks being part of the mux
104 */
105struct exynos_muxed_weint_data {
106 unsigned int nr_banks;
107 struct samsung_pin_bank *banks[];
85}; 108};