drivers/irqchip/irq-atmel-aic5.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-atmel-aic5.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-atmel-aic5.c- Extension
.c- Size
- 11022 bytes
- Lines
- 405
- Domain
- Driver Families
- Bucket
- drivers/irqchip
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/module.hlinux/mm.hlinux/bitmap.hlinux/types.hlinux/irq.hlinux/irqchip.hlinux/of.hlinux/of_address.hlinux/of_irq.hlinux/irqdomain.hlinux/err.hlinux/slab.hlinux/io.hasm/exception.hasm/mach/irq.hirq-atmel-aic-common.h
Detected Declarations
function aic5_handlefunction aic5_maskfunction aic5_unmaskfunction aic5_retriggerfunction aic5_set_typefunction aic5_suspendfunction aic5_resumefunction aic5_pm_shutdownfunction aic5_hw_initfunction aic5_irq_domain_xlatefunction sama5d3_aic_irq_fixupfunction sam9x60_aic_irq_fixupfunction aic5_of_initfunction sama5d2_aic5_of_initfunction sama5d3_aic5_of_initfunction sama5d4_aic5_of_initfunction sam9x60_aic5_of_initfunction sam9x7_aic5_of_init
Annotated Snippet
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/bitmap.h>
#include <linux/types.h>
#include <linux/irq.h>
#include <linux/irqchip.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/irqdomain.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <asm/exception.h>
#include <asm/mach/irq.h>
#include "irq-atmel-aic-common.h"
/* Number of irq lines managed by AIC */
#define NR_AIC5_IRQS 128
#define AT91_AIC5_SSR 0x0
#define AT91_AIC5_INTSEL_MSK (0x7f << 0)
#define AT91_AIC5_SMR 0x4
#define AT91_AIC5_SVR 0x8
#define AT91_AIC5_IVR 0x10
#define AT91_AIC5_FVR 0x14
#define AT91_AIC5_ISR 0x18
#define AT91_AIC5_IPR0 0x20
#define AT91_AIC5_IPR1 0x24
#define AT91_AIC5_IPR2 0x28
#define AT91_AIC5_IPR3 0x2c
#define AT91_AIC5_IMR 0x30
#define AT91_AIC5_CISR 0x34
#define AT91_AIC5_IECR 0x40
#define AT91_AIC5_IDCR 0x44
#define AT91_AIC5_ICCR 0x48
#define AT91_AIC5_ISCR 0x4c
#define AT91_AIC5_EOICR 0x38
#define AT91_AIC5_SPU 0x3c
#define AT91_AIC5_DCR 0x6c
#define AT91_AIC5_FFER 0x50
#define AT91_AIC5_FFDR 0x54
#define AT91_AIC5_FFSR 0x58
static struct irq_domain *aic5_domain;
static void __exception_irq_entry aic5_handle(struct pt_regs *regs)
{
struct irq_chip_generic *bgc = irq_get_domain_generic_chip(aic5_domain, 0);
u32 irqnr;
u32 irqstat;
irqnr = irq_reg_readl(bgc, AT91_AIC5_IVR);
irqstat = irq_reg_readl(bgc, AT91_AIC5_ISR);
if (!irqstat)
irq_reg_writel(bgc, 0, AT91_AIC5_EOICR);
else
generic_handle_domain_irq(aic5_domain, irqnr);
}
static void aic5_mask(struct irq_data *d)
{
struct irq_domain *domain = d->domain;
struct irq_chip_generic *bgc = irq_get_domain_generic_chip(domain, 0);
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
/*
* Disable interrupt on AIC5. We always take the lock of the
* first irq chip as all chips share the same registers.
*/
guard(raw_spinlock)(&bgc->lock);
irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR);
irq_reg_writel(gc, 1, AT91_AIC5_IDCR);
gc->mask_cache &= ~d->mask;
}
static void aic5_unmask(struct irq_data *d)
{
struct irq_domain *domain = d->domain;
struct irq_chip_generic *bgc = irq_get_domain_generic_chip(domain, 0);
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `linux/mm.h`, `linux/bitmap.h`, `linux/types.h`, `linux/irq.h`, `linux/irqchip.h`, `linux/of.h`.
- Detected declarations: `function aic5_handle`, `function aic5_mask`, `function aic5_unmask`, `function aic5_retrigger`, `function aic5_set_type`, `function aic5_suspend`, `function aic5_resume`, `function aic5_pm_shutdown`, `function aic5_hw_init`, `function aic5_irq_domain_xlate`.
- Atlas domain: Driver Families / drivers/irqchip.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.