1b1479ebbSBoris BREZILLON /* 2b1479ebbSBoris BREZILLON * Atmel AT91 AIC5 (Advanced Interrupt Controller) driver 3b1479ebbSBoris BREZILLON * 4b1479ebbSBoris BREZILLON * Copyright (C) 2004 SAN People 5b1479ebbSBoris BREZILLON * Copyright (C) 2004 ATMEL 6b1479ebbSBoris BREZILLON * Copyright (C) Rick Bronson 7b1479ebbSBoris BREZILLON * Copyright (C) 2014 Free Electrons 8b1479ebbSBoris BREZILLON * 9b1479ebbSBoris BREZILLON * Author: Boris BREZILLON <boris.brezillon@free-electrons.com> 10b1479ebbSBoris BREZILLON * 11b1479ebbSBoris BREZILLON * This file is licensed under the terms of the GNU General Public 12b1479ebbSBoris BREZILLON * License version 2. This program is licensed "as is" without any 13b1479ebbSBoris BREZILLON * warranty of any kind, whether express or implied. 14b1479ebbSBoris BREZILLON */ 15b1479ebbSBoris BREZILLON 16b1479ebbSBoris BREZILLON #include <linux/init.h> 17b1479ebbSBoris BREZILLON #include <linux/module.h> 18b1479ebbSBoris BREZILLON #include <linux/mm.h> 19b1479ebbSBoris BREZILLON #include <linux/bitmap.h> 20b1479ebbSBoris BREZILLON #include <linux/types.h> 21b1479ebbSBoris BREZILLON #include <linux/irq.h> 22b1479ebbSBoris BREZILLON #include <linux/of.h> 23b1479ebbSBoris BREZILLON #include <linux/of_address.h> 24b1479ebbSBoris BREZILLON #include <linux/of_irq.h> 25b1479ebbSBoris BREZILLON #include <linux/irqdomain.h> 26b1479ebbSBoris BREZILLON #include <linux/err.h> 27b1479ebbSBoris BREZILLON #include <linux/slab.h> 28b1479ebbSBoris BREZILLON #include <linux/io.h> 29b1479ebbSBoris BREZILLON 30b1479ebbSBoris BREZILLON #include <asm/exception.h> 31b1479ebbSBoris BREZILLON #include <asm/mach/irq.h> 32b1479ebbSBoris BREZILLON 33b1479ebbSBoris BREZILLON #include "irq-atmel-aic-common.h" 34b1479ebbSBoris BREZILLON #include "irqchip.h" 35b1479ebbSBoris BREZILLON 36b1479ebbSBoris BREZILLON /* Number of irq lines managed by AIC */ 37b1479ebbSBoris BREZILLON #define NR_AIC5_IRQS 128 38b1479ebbSBoris BREZILLON 39b1479ebbSBoris BREZILLON #define AT91_AIC5_SSR 0x0 40b1479ebbSBoris BREZILLON #define AT91_AIC5_INTSEL_MSK (0x7f << 0) 41b1479ebbSBoris BREZILLON 42b1479ebbSBoris BREZILLON #define AT91_AIC5_SMR 0x4 43b1479ebbSBoris BREZILLON 44b1479ebbSBoris BREZILLON #define AT91_AIC5_SVR 0x8 45b1479ebbSBoris BREZILLON #define AT91_AIC5_IVR 0x10 46b1479ebbSBoris BREZILLON #define AT91_AIC5_FVR 0x14 47b1479ebbSBoris BREZILLON #define AT91_AIC5_ISR 0x18 48b1479ebbSBoris BREZILLON 49b1479ebbSBoris BREZILLON #define AT91_AIC5_IPR0 0x20 50b1479ebbSBoris BREZILLON #define AT91_AIC5_IPR1 0x24 51b1479ebbSBoris BREZILLON #define AT91_AIC5_IPR2 0x28 52b1479ebbSBoris BREZILLON #define AT91_AIC5_IPR3 0x2c 53b1479ebbSBoris BREZILLON #define AT91_AIC5_IMR 0x30 54b1479ebbSBoris BREZILLON #define AT91_AIC5_CISR 0x34 55b1479ebbSBoris BREZILLON 56b1479ebbSBoris BREZILLON #define AT91_AIC5_IECR 0x40 57b1479ebbSBoris BREZILLON #define AT91_AIC5_IDCR 0x44 58b1479ebbSBoris BREZILLON #define AT91_AIC5_ICCR 0x48 59b1479ebbSBoris BREZILLON #define AT91_AIC5_ISCR 0x4c 60b1479ebbSBoris BREZILLON #define AT91_AIC5_EOICR 0x38 61b1479ebbSBoris BREZILLON #define AT91_AIC5_SPU 0x3c 62b1479ebbSBoris BREZILLON #define AT91_AIC5_DCR 0x6c 63b1479ebbSBoris BREZILLON 64b1479ebbSBoris BREZILLON #define AT91_AIC5_FFER 0x50 65b1479ebbSBoris BREZILLON #define AT91_AIC5_FFDR 0x54 66b1479ebbSBoris BREZILLON #define AT91_AIC5_FFSR 0x58 67b1479ebbSBoris BREZILLON 68b1479ebbSBoris BREZILLON static struct irq_domain *aic5_domain; 69b1479ebbSBoris BREZILLON 70b1479ebbSBoris BREZILLON static asmlinkage void __exception_irq_entry 71b1479ebbSBoris BREZILLON aic5_handle(struct pt_regs *regs) 72b1479ebbSBoris BREZILLON { 73b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = aic5_domain->gc; 74b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = dgc->gc[0]; 75b1479ebbSBoris BREZILLON u32 irqnr; 76b1479ebbSBoris BREZILLON u32 irqstat; 77b1479ebbSBoris BREZILLON 78*332fd7c4SKevin Cernekee irqnr = irq_reg_readl(gc, AT91_AIC5_IVR); 79*332fd7c4SKevin Cernekee irqstat = irq_reg_readl(gc, AT91_AIC5_ISR); 80b1479ebbSBoris BREZILLON 81b1479ebbSBoris BREZILLON if (!irqstat) 82*332fd7c4SKevin Cernekee irq_reg_writel(gc, 0, AT91_AIC5_EOICR); 83b1479ebbSBoris BREZILLON else 8431b7b6a8SMarc Zyngier handle_domain_irq(aic5_domain, irqnr, regs); 85b1479ebbSBoris BREZILLON } 86b1479ebbSBoris BREZILLON 87b1479ebbSBoris BREZILLON static void aic5_mask(struct irq_data *d) 88b1479ebbSBoris BREZILLON { 89b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 90b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 91b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = dgc->gc[0]; 92b1479ebbSBoris BREZILLON 93b1479ebbSBoris BREZILLON /* Disable interrupt on AIC5 */ 94b1479ebbSBoris BREZILLON irq_gc_lock(gc); 95*332fd7c4SKevin Cernekee irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR); 96*332fd7c4SKevin Cernekee irq_reg_writel(gc, 1, AT91_AIC5_IDCR); 97b1479ebbSBoris BREZILLON gc->mask_cache &= ~d->mask; 98b1479ebbSBoris BREZILLON irq_gc_unlock(gc); 99b1479ebbSBoris BREZILLON } 100b1479ebbSBoris BREZILLON 101b1479ebbSBoris BREZILLON static void aic5_unmask(struct irq_data *d) 102b1479ebbSBoris BREZILLON { 103b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 104b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 105b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = dgc->gc[0]; 106b1479ebbSBoris BREZILLON 107b1479ebbSBoris BREZILLON /* Enable interrupt on AIC5 */ 108b1479ebbSBoris BREZILLON irq_gc_lock(gc); 109*332fd7c4SKevin Cernekee irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR); 110*332fd7c4SKevin Cernekee irq_reg_writel(gc, 1, AT91_AIC5_IECR); 111b1479ebbSBoris BREZILLON gc->mask_cache |= d->mask; 112b1479ebbSBoris BREZILLON irq_gc_unlock(gc); 113b1479ebbSBoris BREZILLON } 114b1479ebbSBoris BREZILLON 115b1479ebbSBoris BREZILLON static int aic5_retrigger(struct irq_data *d) 116b1479ebbSBoris BREZILLON { 117b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 118b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 119b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = dgc->gc[0]; 120b1479ebbSBoris BREZILLON 121b1479ebbSBoris BREZILLON /* Enable interrupt on AIC5 */ 122b1479ebbSBoris BREZILLON irq_gc_lock(gc); 123*332fd7c4SKevin Cernekee irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR); 124*332fd7c4SKevin Cernekee irq_reg_writel(gc, 1, AT91_AIC5_ISCR); 125b1479ebbSBoris BREZILLON irq_gc_unlock(gc); 126b1479ebbSBoris BREZILLON 127b1479ebbSBoris BREZILLON return 0; 128b1479ebbSBoris BREZILLON } 129b1479ebbSBoris BREZILLON 130b1479ebbSBoris BREZILLON static int aic5_set_type(struct irq_data *d, unsigned type) 131b1479ebbSBoris BREZILLON { 132b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 133b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 134b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = dgc->gc[0]; 135b1479ebbSBoris BREZILLON unsigned int smr; 136b1479ebbSBoris BREZILLON int ret; 137b1479ebbSBoris BREZILLON 138b1479ebbSBoris BREZILLON irq_gc_lock(gc); 139*332fd7c4SKevin Cernekee irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR); 140*332fd7c4SKevin Cernekee smr = irq_reg_readl(gc, AT91_AIC5_SMR); 141b1479ebbSBoris BREZILLON ret = aic_common_set_type(d, type, &smr); 142b1479ebbSBoris BREZILLON if (!ret) 143*332fd7c4SKevin Cernekee irq_reg_writel(gc, smr, AT91_AIC5_SMR); 144b1479ebbSBoris BREZILLON irq_gc_unlock(gc); 145b1479ebbSBoris BREZILLON 146b1479ebbSBoris BREZILLON return ret; 147b1479ebbSBoris BREZILLON } 148b1479ebbSBoris BREZILLON 149b1479ebbSBoris BREZILLON #ifdef CONFIG_PM 150b1479ebbSBoris BREZILLON static void aic5_suspend(struct irq_data *d) 151b1479ebbSBoris BREZILLON { 152b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 153b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 154b1479ebbSBoris BREZILLON struct irq_chip_generic *bgc = dgc->gc[0]; 155b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 156b1479ebbSBoris BREZILLON int i; 157b1479ebbSBoris BREZILLON u32 mask; 158b1479ebbSBoris BREZILLON 159b1479ebbSBoris BREZILLON irq_gc_lock(bgc); 160b1479ebbSBoris BREZILLON for (i = 0; i < dgc->irqs_per_chip; i++) { 161b1479ebbSBoris BREZILLON mask = 1 << i; 162b1479ebbSBoris BREZILLON if ((mask & gc->mask_cache) == (mask & gc->wake_active)) 163b1479ebbSBoris BREZILLON continue; 164b1479ebbSBoris BREZILLON 165*332fd7c4SKevin Cernekee irq_reg_writel(bgc, i + gc->irq_base, AT91_AIC5_SSR); 166b1479ebbSBoris BREZILLON if (mask & gc->wake_active) 167*332fd7c4SKevin Cernekee irq_reg_writel(bgc, 1, AT91_AIC5_IECR); 168b1479ebbSBoris BREZILLON else 169*332fd7c4SKevin Cernekee irq_reg_writel(bgc, 1, AT91_AIC5_IDCR); 170b1479ebbSBoris BREZILLON } 171b1479ebbSBoris BREZILLON irq_gc_unlock(bgc); 172b1479ebbSBoris BREZILLON } 173b1479ebbSBoris BREZILLON 174b1479ebbSBoris BREZILLON static void aic5_resume(struct irq_data *d) 175b1479ebbSBoris BREZILLON { 176b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 177b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 178b1479ebbSBoris BREZILLON struct irq_chip_generic *bgc = dgc->gc[0]; 179b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 180b1479ebbSBoris BREZILLON int i; 181b1479ebbSBoris BREZILLON u32 mask; 182b1479ebbSBoris BREZILLON 183b1479ebbSBoris BREZILLON irq_gc_lock(bgc); 184b1479ebbSBoris BREZILLON for (i = 0; i < dgc->irqs_per_chip; i++) { 185b1479ebbSBoris BREZILLON mask = 1 << i; 186b1479ebbSBoris BREZILLON if ((mask & gc->mask_cache) == (mask & gc->wake_active)) 187b1479ebbSBoris BREZILLON continue; 188b1479ebbSBoris BREZILLON 189*332fd7c4SKevin Cernekee irq_reg_writel(bgc, i + gc->irq_base, AT91_AIC5_SSR); 190b1479ebbSBoris BREZILLON if (mask & gc->mask_cache) 191*332fd7c4SKevin Cernekee irq_reg_writel(bgc, 1, AT91_AIC5_IECR); 192b1479ebbSBoris BREZILLON else 193*332fd7c4SKevin Cernekee irq_reg_writel(bgc, 1, AT91_AIC5_IDCR); 194b1479ebbSBoris BREZILLON } 195b1479ebbSBoris BREZILLON irq_gc_unlock(bgc); 196b1479ebbSBoris BREZILLON } 197b1479ebbSBoris BREZILLON 198b1479ebbSBoris BREZILLON static void aic5_pm_shutdown(struct irq_data *d) 199b1479ebbSBoris BREZILLON { 200b1479ebbSBoris BREZILLON struct irq_domain *domain = d->domain; 201b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = domain->gc; 202b1479ebbSBoris BREZILLON struct irq_chip_generic *bgc = dgc->gc[0]; 203b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 204b1479ebbSBoris BREZILLON int i; 205b1479ebbSBoris BREZILLON 206b1479ebbSBoris BREZILLON irq_gc_lock(bgc); 207b1479ebbSBoris BREZILLON for (i = 0; i < dgc->irqs_per_chip; i++) { 208*332fd7c4SKevin Cernekee irq_reg_writel(bgc, i + gc->irq_base, AT91_AIC5_SSR); 209*332fd7c4SKevin Cernekee irq_reg_writel(bgc, 1, AT91_AIC5_IDCR); 210*332fd7c4SKevin Cernekee irq_reg_writel(bgc, 1, AT91_AIC5_ICCR); 211b1479ebbSBoris BREZILLON } 212b1479ebbSBoris BREZILLON irq_gc_unlock(bgc); 213b1479ebbSBoris BREZILLON } 214b1479ebbSBoris BREZILLON #else 215b1479ebbSBoris BREZILLON #define aic5_suspend NULL 216b1479ebbSBoris BREZILLON #define aic5_resume NULL 217b1479ebbSBoris BREZILLON #define aic5_pm_shutdown NULL 218b1479ebbSBoris BREZILLON #endif /* CONFIG_PM */ 219b1479ebbSBoris BREZILLON 220b1479ebbSBoris BREZILLON static void __init aic5_hw_init(struct irq_domain *domain) 221b1479ebbSBoris BREZILLON { 222b1479ebbSBoris BREZILLON struct irq_chip_generic *gc = irq_get_domain_generic_chip(domain, 0); 223b1479ebbSBoris BREZILLON int i; 224b1479ebbSBoris BREZILLON 225b1479ebbSBoris BREZILLON /* 226b1479ebbSBoris BREZILLON * Perform 8 End Of Interrupt Command to make sure AIC 227b1479ebbSBoris BREZILLON * will not Lock out nIRQ 228b1479ebbSBoris BREZILLON */ 229b1479ebbSBoris BREZILLON for (i = 0; i < 8; i++) 230*332fd7c4SKevin Cernekee irq_reg_writel(gc, 0, AT91_AIC5_EOICR); 231b1479ebbSBoris BREZILLON 232b1479ebbSBoris BREZILLON /* 233b1479ebbSBoris BREZILLON * Spurious Interrupt ID in Spurious Vector Register. 234b1479ebbSBoris BREZILLON * When there is no current interrupt, the IRQ Vector Register 235b1479ebbSBoris BREZILLON * reads the value stored in AIC_SPU 236b1479ebbSBoris BREZILLON */ 237*332fd7c4SKevin Cernekee irq_reg_writel(gc, 0xffffffff, AT91_AIC5_SPU); 238b1479ebbSBoris BREZILLON 239b1479ebbSBoris BREZILLON /* No debugging in AIC: Debug (Protect) Control Register */ 240*332fd7c4SKevin Cernekee irq_reg_writel(gc, 0, AT91_AIC5_DCR); 241b1479ebbSBoris BREZILLON 242b1479ebbSBoris BREZILLON /* Disable and clear all interrupts initially */ 243b1479ebbSBoris BREZILLON for (i = 0; i < domain->revmap_size; i++) { 244*332fd7c4SKevin Cernekee irq_reg_writel(gc, i, AT91_AIC5_SSR); 245*332fd7c4SKevin Cernekee irq_reg_writel(gc, i, AT91_AIC5_SVR); 246*332fd7c4SKevin Cernekee irq_reg_writel(gc, 1, AT91_AIC5_IDCR); 247*332fd7c4SKevin Cernekee irq_reg_writel(gc, 1, AT91_AIC5_ICCR); 248b1479ebbSBoris BREZILLON } 249b1479ebbSBoris BREZILLON } 250b1479ebbSBoris BREZILLON 251b1479ebbSBoris BREZILLON static int aic5_irq_domain_xlate(struct irq_domain *d, 252b1479ebbSBoris BREZILLON struct device_node *ctrlr, 253b1479ebbSBoris BREZILLON const u32 *intspec, unsigned int intsize, 254b1479ebbSBoris BREZILLON irq_hw_number_t *out_hwirq, 255b1479ebbSBoris BREZILLON unsigned int *out_type) 256b1479ebbSBoris BREZILLON { 257b1479ebbSBoris BREZILLON struct irq_domain_chip_generic *dgc = d->gc; 258b1479ebbSBoris BREZILLON struct irq_chip_generic *gc; 259b1479ebbSBoris BREZILLON unsigned smr; 260b1479ebbSBoris BREZILLON int ret; 261b1479ebbSBoris BREZILLON 262b1479ebbSBoris BREZILLON if (!dgc) 263b1479ebbSBoris BREZILLON return -EINVAL; 264b1479ebbSBoris BREZILLON 265b1479ebbSBoris BREZILLON ret = aic_common_irq_domain_xlate(d, ctrlr, intspec, intsize, 266b1479ebbSBoris BREZILLON out_hwirq, out_type); 267b1479ebbSBoris BREZILLON if (ret) 268b1479ebbSBoris BREZILLON return ret; 269b1479ebbSBoris BREZILLON 270b1479ebbSBoris BREZILLON gc = dgc->gc[0]; 271b1479ebbSBoris BREZILLON 272b1479ebbSBoris BREZILLON irq_gc_lock(gc); 273*332fd7c4SKevin Cernekee irq_reg_writel(gc, *out_hwirq, AT91_AIC5_SSR); 274*332fd7c4SKevin Cernekee smr = irq_reg_readl(gc, AT91_AIC5_SMR); 275b1479ebbSBoris BREZILLON ret = aic_common_set_priority(intspec[2], &smr); 276b1479ebbSBoris BREZILLON if (!ret) 277*332fd7c4SKevin Cernekee irq_reg_writel(gc, intspec[2] | smr, AT91_AIC5_SMR); 278b1479ebbSBoris BREZILLON irq_gc_unlock(gc); 279b1479ebbSBoris BREZILLON 280b1479ebbSBoris BREZILLON return ret; 281b1479ebbSBoris BREZILLON } 282b1479ebbSBoris BREZILLON 283b1479ebbSBoris BREZILLON static const struct irq_domain_ops aic5_irq_ops = { 284b1479ebbSBoris BREZILLON .map = irq_map_generic_chip, 285b1479ebbSBoris BREZILLON .xlate = aic5_irq_domain_xlate, 286b1479ebbSBoris BREZILLON }; 287b1479ebbSBoris BREZILLON 2886704d12dSBoris BREZILLON static void __init sama5d3_aic_irq_fixup(struct device_node *root) 2896704d12dSBoris BREZILLON { 2906704d12dSBoris BREZILLON aic_common_rtc_irq_fixup(root); 2916704d12dSBoris BREZILLON } 2926704d12dSBoris BREZILLON 2936704d12dSBoris BREZILLON static const struct of_device_id __initdata aic5_irq_fixups[] = { 2946704d12dSBoris BREZILLON { .compatible = "atmel,sama5d3", .data = sama5d3_aic_irq_fixup }, 29520afdeb8SAlexandre Belloni { .compatible = "atmel,sama5d4", .data = sama5d3_aic_irq_fixup }, 2966704d12dSBoris BREZILLON { /* sentinel */ }, 2976704d12dSBoris BREZILLON }; 2986704d12dSBoris BREZILLON 299b1479ebbSBoris BREZILLON static int __init aic5_of_init(struct device_node *node, 300b1479ebbSBoris BREZILLON struct device_node *parent, 301b1479ebbSBoris BREZILLON int nirqs) 302b1479ebbSBoris BREZILLON { 303b1479ebbSBoris BREZILLON struct irq_chip_generic *gc; 304b1479ebbSBoris BREZILLON struct irq_domain *domain; 305b1479ebbSBoris BREZILLON int nchips; 306b1479ebbSBoris BREZILLON int i; 307b1479ebbSBoris BREZILLON 308b1479ebbSBoris BREZILLON if (nirqs > NR_AIC5_IRQS) 309b1479ebbSBoris BREZILLON return -EINVAL; 310b1479ebbSBoris BREZILLON 311b1479ebbSBoris BREZILLON if (aic5_domain) 312b1479ebbSBoris BREZILLON return -EEXIST; 313b1479ebbSBoris BREZILLON 314b1479ebbSBoris BREZILLON domain = aic_common_of_init(node, &aic5_irq_ops, "atmel-aic5", 315b1479ebbSBoris BREZILLON nirqs); 316b1479ebbSBoris BREZILLON if (IS_ERR(domain)) 317b1479ebbSBoris BREZILLON return PTR_ERR(domain); 318b1479ebbSBoris BREZILLON 3196704d12dSBoris BREZILLON aic_common_irq_fixup(aic5_irq_fixups); 3206704d12dSBoris BREZILLON 321b1479ebbSBoris BREZILLON aic5_domain = domain; 322b1479ebbSBoris BREZILLON nchips = aic5_domain->revmap_size / 32; 323b1479ebbSBoris BREZILLON for (i = 0; i < nchips; i++) { 324b1479ebbSBoris BREZILLON gc = irq_get_domain_generic_chip(domain, i * 32); 325b1479ebbSBoris BREZILLON 326b1479ebbSBoris BREZILLON gc->chip_types[0].regs.eoi = AT91_AIC5_EOICR; 327b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_mask = aic5_mask; 328b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_unmask = aic5_unmask; 329b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_retrigger = aic5_retrigger; 330b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_set_type = aic5_set_type; 331b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_suspend = aic5_suspend; 332b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_resume = aic5_resume; 333b1479ebbSBoris BREZILLON gc->chip_types[0].chip.irq_pm_shutdown = aic5_pm_shutdown; 334b1479ebbSBoris BREZILLON } 335b1479ebbSBoris BREZILLON 336b1479ebbSBoris BREZILLON aic5_hw_init(domain); 337b1479ebbSBoris BREZILLON set_handle_irq(aic5_handle); 338b1479ebbSBoris BREZILLON 339b1479ebbSBoris BREZILLON return 0; 340b1479ebbSBoris BREZILLON } 341b1479ebbSBoris BREZILLON 3420cae165fSAlexandre Belloni #define NR_SAMA5D3_IRQS 48 343b1479ebbSBoris BREZILLON 344b1479ebbSBoris BREZILLON static int __init sama5d3_aic5_of_init(struct device_node *node, 345b1479ebbSBoris BREZILLON struct device_node *parent) 346b1479ebbSBoris BREZILLON { 347b1479ebbSBoris BREZILLON return aic5_of_init(node, parent, NR_SAMA5D3_IRQS); 348b1479ebbSBoris BREZILLON } 349b1479ebbSBoris BREZILLON IRQCHIP_DECLARE(sama5d3_aic5, "atmel,sama5d3-aic", sama5d3_aic5_of_init); 35020afdeb8SAlexandre Belloni 35120afdeb8SAlexandre Belloni #define NR_SAMA5D4_IRQS 68 35220afdeb8SAlexandre Belloni 35320afdeb8SAlexandre Belloni static int __init sama5d4_aic5_of_init(struct device_node *node, 35420afdeb8SAlexandre Belloni struct device_node *parent) 35520afdeb8SAlexandre Belloni { 35620afdeb8SAlexandre Belloni return aic5_of_init(node, parent, NR_SAMA5D4_IRQS); 35720afdeb8SAlexandre Belloni } 35820afdeb8SAlexandre Belloni IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init); 359