diff options
Diffstat (limited to 'drivers/irqchip/irq-atmel-aic-common.c')
-rw-r--r-- | drivers/irqchip/irq-atmel-aic-common.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index cc4f9d80122e..d111ac779c40 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c | |||
@@ -167,6 +167,32 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) | |||
167 | iounmap(regs); | 167 | iounmap(regs); |
168 | } | 168 | } |
169 | 169 | ||
170 | #define AT91_RTT_MR 0x00 /* Real-time Mode Register */ | ||
171 | #define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */ | ||
172 | #define AT91_RTT_RTTINCIEN (1 << 17) /* Real Time Timer Increment Interrupt Enable */ | ||
173 | |||
174 | void __init aic_common_rtt_irq_fixup(struct device_node *root) | ||
175 | { | ||
176 | struct device_node *np; | ||
177 | void __iomem *regs; | ||
178 | |||
179 | /* | ||
180 | * The at91sam9263 SoC has 2 instances of the RTT block, hence we | ||
181 | * iterate over the DT to find each occurrence. | ||
182 | */ | ||
183 | for_each_compatible_node(np, NULL, "atmel,at91sam9260-rtt") { | ||
184 | regs = of_iomap(np, 0); | ||
185 | if (!regs) | ||
186 | continue; | ||
187 | |||
188 | writel(readl(regs + AT91_RTT_MR) & | ||
189 | ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN), | ||
190 | regs + AT91_RTT_MR); | ||
191 | |||
192 | iounmap(regs); | ||
193 | } | ||
194 | } | ||
195 | |||
170 | void __init aic_common_irq_fixup(const struct of_device_id *matches) | 196 | void __init aic_common_irq_fixup(const struct of_device_id *matches) |
171 | { | 197 | { |
172 | struct device_node *root = of_find_node_by_path("/"); | 198 | struct device_node *root = of_find_node_by_path("/"); |