drivers/irqchip/irq-omap-intc.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-omap-intc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-omap-intc.c- Extension
.c- Size
- 9780 bytes
- Lines
- 394
- 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/kernel.hlinux/module.hlinux/init.hlinux/interrupt.hlinux/io.hasm/exception.hlinux/irqchip.hlinux/irqdomain.hlinux/of.hlinux/of_address.hlinux/of_irq.hlinux/irqchip/irq-omap-intc.h
Detected Declarations
struct omap_intc_regsfunction intc_writelfunction intc_readlfunction omap_intc_save_contextfunction omap_intc_restore_contextfunction omap3_intc_prepare_idlefunction omap3_intc_resume_idlefunction omap_ack_irqfunction omap_mask_ack_irqfunction omap_irq_soft_resetfunction omap_irq_pendingfunction omap3_intc_suspendfunction omap_alloc_gc_offunction omap_alloc_gc_legacyfunction omap_init_irq_offunction omap_init_irq_legacyfunction omap_irq_enable_protectionfunction omap_init_irqfunction of_device_is_compatiblefunction omap_intc_handle_irqfunction sortingfunction intc_of_init
Annotated Snippet
struct omap_intc_regs {
u32 sysconfig;
u32 protection;
u32 idle;
u32 threshold;
u32 ilr[INTCPS_NR_ILR_REGS];
u32 mir[INTCPS_NR_MIR_REGS];
};
static struct omap_intc_regs intc_context;
static struct irq_domain *domain;
static void __iomem *omap_irq_base;
static int omap_nr_pending;
static int omap_nr_irqs;
static void intc_writel(u32 reg, u32 val)
{
writel_relaxed(val, omap_irq_base + reg);
}
static u32 intc_readl(u32 reg)
{
return readl_relaxed(omap_irq_base + reg);
}
void omap_intc_save_context(void)
{
int i;
intc_context.sysconfig =
intc_readl(INTC_SYSCONFIG);
intc_context.protection =
intc_readl(INTC_PROTECTION);
intc_context.idle =
intc_readl(INTC_IDLE);
intc_context.threshold =
intc_readl(INTC_THRESHOLD);
for (i = 0; i < omap_nr_irqs; i++)
intc_context.ilr[i] =
intc_readl((INTC_ILR0 + 0x4 * i));
for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
intc_context.mir[i] =
intc_readl(INTC_MIR0 + (0x20 * i));
}
void omap_intc_restore_context(void)
{
int i;
intc_writel(INTC_SYSCONFIG, intc_context.sysconfig);
intc_writel(INTC_PROTECTION, intc_context.protection);
intc_writel(INTC_IDLE, intc_context.idle);
intc_writel(INTC_THRESHOLD, intc_context.threshold);
for (i = 0; i < omap_nr_irqs; i++)
intc_writel(INTC_ILR0 + 0x4 * i,
intc_context.ilr[i]);
for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
intc_writel(INTC_MIR0 + 0x20 * i,
intc_context.mir[i]);
/* MIRs are saved and restore with other PRCM registers */
}
void omap3_intc_prepare_idle(void)
{
/*
* Disable autoidle as it can stall interrupt controller,
* cf. errata ID i540 for 3430 (all revisions up to 3.1.x)
*/
intc_writel(INTC_SYSCONFIG, 0);
intc_writel(INTC_IDLE, INTC_IDLE_TURBO);
}
void omap3_intc_resume_idle(void)
{
/* Re-enable autoidle */
intc_writel(INTC_SYSCONFIG, 1);
intc_writel(INTC_IDLE, 0);
}
/* XXX: FIQ and additional INTC support (only MPU at the moment) */
static void omap_ack_irq(struct irq_data *d)
{
intc_writel(INTC_CONTROL, 0x1);
}
static void omap_mask_ack_irq(struct irq_data *d)
{
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/interrupt.h`, `linux/io.h`, `asm/exception.h`, `linux/irqchip.h`, `linux/irqdomain.h`.
- Detected declarations: `struct omap_intc_regs`, `function intc_writel`, `function intc_readl`, `function omap_intc_save_context`, `function omap_intc_restore_context`, `function omap3_intc_prepare_idle`, `function omap3_intc_resume_idle`, `function omap_ack_irq`, `function omap_mask_ack_irq`, `function omap_irq_soft_reset`.
- 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.