diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2014-07-10 14:25:40 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-07-17 09:38:54 -0400 |
commit | 3d61467f9bab36aee786f762730b73565dbef3bf (patch) | |
tree | 233f2998088b3e660005aafc68b2c06bf289d9c1 /drivers/irqchip/irq-atmel-aic-common.c | |
parent | b2f579b58e93ded5916fb69a28cfc86e0ab951a6 (diff) |
irqchip: atmel-aic: Implement RTC irq fixup
Provide an implementation to fix RTC irqs before enabling the irqchip.
This was previously done in arch/arm/mach-at91/sysirq_mask.c but as we're
trying to use standard implementation (IRQCHIP_DECLARE and automatic call
of irqchip_init within arch/arm/kernel/irq.c) we need to do those fixups
in the irqchip driver.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Link: https://lkml.kernel.org/r/1405016741-2407-3-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip/irq-atmel-aic-common.c')
-rw-r--r-- | drivers/irqchip/irq-atmel-aic-common.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index 4705bdbc6e7b..6ae3cdee0681 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c | |||
@@ -139,6 +139,34 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain) | |||
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | #define AT91_RTC_IDR 0x24 | ||
143 | #define AT91_RTC_IMR 0x28 | ||
144 | #define AT91_RTC_IRQ_MASK 0x1f | ||
145 | |||
146 | void __init aic_common_rtc_irq_fixup(struct device_node *root) | ||
147 | { | ||
148 | struct device_node *np; | ||
149 | void __iomem *regs; | ||
150 | |||
151 | np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); | ||
152 | if (!np) | ||
153 | np = of_find_compatible_node(root, NULL, | ||
154 | "atmel,at91sam9x5-rtc"); | ||
155 | |||
156 | if (!np) | ||
157 | return; | ||
158 | |||
159 | regs = of_iomap(np, 0); | ||
160 | of_node_put(np); | ||
161 | |||
162 | if (!regs) | ||
163 | return; | ||
164 | |||
165 | writel(AT91_RTC_IRQ_MASK, regs + AT91_RTC_IDR); | ||
166 | |||
167 | iounmap(regs); | ||
168 | } | ||
169 | |||
142 | void __init aic_common_irq_fixup(const struct of_device_id *matches) | 170 | void __init aic_common_irq_fixup(const struct of_device_id *matches) |
143 | { | 171 | { |
144 | struct device_node *root = of_find_node_by_path("/"); | 172 | struct device_node *root = of_find_node_by_path("/"); |