drivers/irqchip/irq-sl28cpld.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-sl28cpld.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-sl28cpld.c- Extension
.c- Size
- 2310 bytes
- Lines
- 95
- 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.
- 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/interrupt.hlinux/kernel.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/property.hlinux/regmap.h
Detected Declarations
struct sl28cpld_intcfunction sl28cpld_intc_probe
Annotated Snippet
struct sl28cpld_intc {
struct regmap *regmap;
struct regmap_irq_chip chip;
struct regmap_irq_chip_data *irq_data;
};
static int sl28cpld_intc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct sl28cpld_intc *irqchip;
int irq;
u32 base;
int ret;
if (!dev->parent)
return -ENODEV;
irqchip = devm_kzalloc(dev, sizeof(*irqchip), GFP_KERNEL);
if (!irqchip)
return -ENOMEM;
irqchip->regmap = dev_get_regmap(dev->parent, NULL);
if (!irqchip->regmap)
return -ENODEV;
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
ret = device_property_read_u32(&pdev->dev, "reg", &base);
if (ret)
return -EINVAL;
irqchip->chip.name = "sl28cpld-intc";
irqchip->chip.irqs = sl28cpld_irqs;
irqchip->chip.num_irqs = ARRAY_SIZE(sl28cpld_irqs);
irqchip->chip.num_regs = 1;
irqchip->chip.status_base = base + INTC_IP;
irqchip->chip.unmask_base = base + INTC_IE;
irqchip->chip.ack_base = base + INTC_IP;
return devm_regmap_add_irq_chip_fwnode(dev, dev_fwnode(dev),
irqchip->regmap, irq,
IRQF_SHARED | IRQF_ONESHOT, 0,
&irqchip->chip,
&irqchip->irq_data);
}
static const struct of_device_id sl28cpld_intc_of_match[] = {
{ .compatible = "kontron,sl28cpld-intc" },
{}
};
MODULE_DEVICE_TABLE(of, sl28cpld_intc_of_match);
static struct platform_driver sl28cpld_intc_driver = {
.probe = sl28cpld_intc_probe,
.driver = {
.name = "sl28cpld-intc",
.of_match_table = sl28cpld_intc_of_match,
}
};
module_platform_driver(sl28cpld_intc_driver);
MODULE_DESCRIPTION("sl28cpld Interrupt Controller Driver");
MODULE_AUTHOR("Michael Walle <michael@walle.cc>");
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/kernel.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/property.h`, `linux/regmap.h`.
- Detected declarations: `struct sl28cpld_intc`, `function sl28cpld_intc_probe`.
- 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.