drivers/irqchip/irq-stm32mp-exti.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-stm32mp-exti.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-stm32mp-exti.c- Extension
.c- Size
- 18300 bytes
- Lines
- 726
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/hwspinlock.hlinux/interrupt.hlinux/io.hlinux/irq.hlinux/irqchip.hlinux/irqdomain.hlinux/mod_devicetable.hlinux/module.hlinux/of_address.hlinux/of_irq.hlinux/platform_device.hlinux/pm.hdt-bindings/interrupt-controller/arm-gic.h
Detected Declarations
struct stm32mp_exti_bankstruct stm32mp_exti_drv_datastruct stm32mp_exti_chip_datastruct stm32mp_exti_host_datafunction stm32mp_exti_convert_typefunction stm32mp_chip_suspendfunction stm32mp_chip_resumefunction stm32mp_exti_write_bitfunction stm32mp_exti_set_bitfunction stm32mp_exti_clr_bitfunction stm32mp_exti_eoifunction stm32mp_exti_maskfunction stm32mp_exti_unmaskfunction stm32mp_exti_set_typefunction stm32mp_exti_set_wakefunction stm32mp_exti_set_affinityfunction stm32mp_exti_suspendfunction stm32mp_exti_resumefunction stm32mp_exti_retriggerfunction stm32mp_exti_domain_allocfunction stm32mp_exti_check_riffunction stm32mp_exti_remove_irqfunction stm32mp_exti_probe
Annotated Snippet
struct stm32mp_exti_bank {
u32 imr_ofst;
u32 rtsr_ofst;
u32 ftsr_ofst;
u32 swier_ofst;
u32 rpr_ofst;
u32 fpr_ofst;
u32 trg_ofst;
u32 seccfgr_ofst;
};
struct stm32mp_exti_drv_data {
const struct stm32mp_exti_bank **exti_banks;
const u8 *desc_irqs;
u32 bank_nr;
};
struct stm32mp_exti_chip_data {
struct stm32mp_exti_host_data *host_data;
const struct stm32mp_exti_bank *reg_bank;
struct raw_spinlock rlock;
u32 wake_active;
u32 mask_cache;
u32 rtsr_cache;
u32 ftsr_cache;
u32 event_reserved;
};
struct stm32mp_exti_host_data {
void __iomem *base;
struct device *dev;
struct stm32mp_exti_chip_data *chips_data;
const struct stm32mp_exti_drv_data *drv_data;
struct hwspinlock *hwlock;
/* skip internal desc_irqs array and get it from DT */
bool dt_has_irqs_desc;
};
static const struct stm32mp_exti_bank stm32mp_exti_b1 = {
.imr_ofst = 0x80,
.rtsr_ofst = 0x00,
.ftsr_ofst = 0x04,
.swier_ofst = 0x08,
.rpr_ofst = 0x0C,
.fpr_ofst = 0x10,
.trg_ofst = 0x3EC,
.seccfgr_ofst = 0x14,
};
static const struct stm32mp_exti_bank stm32mp_exti_b2 = {
.imr_ofst = 0x90,
.rtsr_ofst = 0x20,
.ftsr_ofst = 0x24,
.swier_ofst = 0x28,
.rpr_ofst = 0x2C,
.fpr_ofst = 0x30,
.trg_ofst = 0x3E8,
.seccfgr_ofst = 0x34,
};
static const struct stm32mp_exti_bank stm32mp_exti_b3 = {
.imr_ofst = 0xA0,
.rtsr_ofst = 0x40,
.ftsr_ofst = 0x44,
.swier_ofst = 0x48,
.rpr_ofst = 0x4C,
.fpr_ofst = 0x50,
.trg_ofst = 0x3E4,
.seccfgr_ofst = 0x54,
};
static const struct stm32mp_exti_bank *stm32mp_exti_banks[] = {
&stm32mp_exti_b1,
&stm32mp_exti_b2,
&stm32mp_exti_b3,
};
static struct irq_chip stm32mp_exti_chip;
static struct irq_chip stm32mp_exti_chip_direct;
#define EXTI_INVALID_IRQ U8_MAX
#define STM32MP_DESC_IRQ_SIZE (ARRAY_SIZE(stm32mp_exti_banks) * IRQS_PER_BANK)
/*
* Use some intentionally tricky logic here to initialize the whole array to
* EXTI_INVALID_IRQ, but then override certain fields, requiring us to indicate
* that we "know" that there are overrides in this structure, and we'll need to
* disable that warning from W=1 builds.
*/
__diag_push();
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/hwspinlock.h`, `linux/interrupt.h`, `linux/io.h`, `linux/irq.h`, `linux/irqchip.h`, `linux/irqdomain.h`, `linux/mod_devicetable.h`.
- Detected declarations: `struct stm32mp_exti_bank`, `struct stm32mp_exti_drv_data`, `struct stm32mp_exti_chip_data`, `struct stm32mp_exti_host_data`, `function stm32mp_exti_convert_type`, `function stm32mp_chip_suspend`, `function stm32mp_chip_resume`, `function stm32mp_exti_write_bit`, `function stm32mp_exti_set_bit`, `function stm32mp_exti_clr_bit`.
- Atlas domain: Driver Families / drivers/irqchip.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.