drivers/irqchip/irq-meson-gpio.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-meson-gpio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-meson-gpio.c- Extension
.c- Size
- 20448 bytes
- Lines
- 727
- 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/io.hlinux/module.hlinux/irq.hlinux/irqdomain.hlinux/irqchip.hlinux/of.hlinux/of_address.h
Detected Declarations
struct meson_gpio_irq_controllerstruct irq_ctl_opsstruct meson_gpio_irq_paramsstruct meson_gpio_irq_controllerfunction meson_gpio_irq_update_bitsfunction meson_gpio_irq_init_dummyfunction meson_a1_gpio_irq_sel_pinfunction meson_a1_gpio_irq_initfunction meson_gpio_irq_request_channelfunction meson_gpio_irq_get_channel_idxfunction meson_gpio_irq_release_channelfunction meson8_gpio_irq_set_typefunction meson_a9_ao_gpio_irq_set_typefunction meson_s4_gpio_irq_set_typefunction meson_gpio_irq_type_outputfunction meson_gpio_irq_set_typefunction meson_gpio_irq_domain_translatefunction meson_gpio_irq_allocate_gic_irqfunction meson_gpio_irq_domain_allocfunction meson_gpio_irq_domain_freefunction meson_gpio_irq_parse_dtfunction meson_gpio_irq_probe
Annotated Snippet
struct irq_ctl_ops {
void (*gpio_irq_sel_pin)(struct meson_gpio_irq_controller *ctl,
unsigned int channel, unsigned long hwirq);
void (*gpio_irq_init)(struct meson_gpio_irq_controller *ctl);
int (*gpio_irq_set_type)(struct meson_gpio_irq_controller *ctl,
unsigned int type, u32 *channel_hwirq);
};
struct meson_gpio_irq_params {
unsigned int nr_hwirq;
unsigned int nr_channels;
bool support_edge_both;
unsigned int edge_both_offset;
unsigned int edge_single_offset;
unsigned int edge_pol_reg;
unsigned int pol_low_offset;
unsigned int pin_sel_mask;
struct irq_ctl_ops ops;
};
#define INIT_MESON_COMMON(irqs, init, sel, type) \
.nr_hwirq = irqs, \
.ops = { \
.gpio_irq_init = init, \
.gpio_irq_sel_pin = sel, \
.gpio_irq_set_type = type, \
},
#define INIT_MESON8_COMMON_DATA(irqs) \
INIT_MESON_COMMON(irqs, meson_gpio_irq_init_dummy, \
meson8_gpio_irq_sel_pin, \
meson8_gpio_irq_set_type) \
.edge_single_offset = 0, \
.pol_low_offset = 16, \
.pin_sel_mask = 0xff, \
.nr_channels = 8, \
#define INIT_MESON_A1_COMMON_DATA(irqs) \
INIT_MESON_COMMON(irqs, meson_a1_gpio_irq_init, \
meson_a1_gpio_irq_sel_pin, \
meson8_gpio_irq_set_type) \
.support_edge_both = true, \
.edge_both_offset = 16, \
.edge_single_offset = 8, \
.pol_low_offset = 0, \
.pin_sel_mask = 0x7f, \
.nr_channels = 8, \
#define INIT_MESON_A4_AO_COMMON_DATA(irqs) \
INIT_MESON_COMMON(irqs, meson_a1_gpio_irq_init, \
meson_a1_gpio_irq_sel_pin, \
meson_s4_gpio_irq_set_type) \
.support_edge_both = true, \
.edge_both_offset = 0, \
.edge_single_offset = 12, \
.edge_pol_reg = 0x8, \
.pol_low_offset = 0, \
.pin_sel_mask = 0xff, \
.nr_channels = 2, \
#define INIT_MESON_A9_AO_COMMON_DATA(irqs) \
INIT_MESON_COMMON(irqs, meson_a1_gpio_irq_init, \
meson_a1_gpio_irq_sel_pin, \
meson_a9_ao_gpio_irq_set_type) \
.support_edge_both = true, \
.edge_both_offset = 0, \
.edge_single_offset = 0, \
.edge_pol_reg = 0x2c, \
.pol_low_offset = 0, \
.pin_sel_mask = 0xff, \
.nr_channels = 20, \
#define INIT_MESON_S4_COMMON_DATA(irqs) \
INIT_MESON_COMMON(irqs, meson_a1_gpio_irq_init, \
meson_a1_gpio_irq_sel_pin, \
meson_s4_gpio_irq_set_type) \
.support_edge_both = true, \
.edge_both_offset = 0, \
.edge_single_offset = 12, \
.edge_pol_reg = 0x1c, \
.pol_low_offset = 0, \
.pin_sel_mask = 0xff, \
.nr_channels = 12, \
static const struct meson_gpio_irq_params meson8_params = {
INIT_MESON8_COMMON_DATA(134)
};
static const struct meson_gpio_irq_params meson8b_params = {
INIT_MESON8_COMMON_DATA(119)
Annotation
- Immediate include surface: `linux/io.h`, `linux/module.h`, `linux/irq.h`, `linux/irqdomain.h`, `linux/irqchip.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `struct meson_gpio_irq_controller`, `struct irq_ctl_ops`, `struct meson_gpio_irq_params`, `struct meson_gpio_irq_controller`, `function meson_gpio_irq_update_bits`, `function meson_gpio_irq_init_dummy`, `function meson_a1_gpio_irq_sel_pin`, `function meson_a1_gpio_irq_init`, `function meson_gpio_irq_request_channel`, `function meson_gpio_irq_get_channel_idx`.
- 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.