drivers/bus/arm-integrator-lm.c
Source file repositories/reference/linux-study-clean/drivers/bus/arm-integrator-lm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bus/arm-integrator-lm.c- Extension
.c- Size
- 3200 bytes
- Lines
- 130
- Domain
- Driver Families
- Bucket
- drivers/bus
- 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/module.hlinux/err.hlinux/io.hlinux/of.hlinux/of_address.hlinux/of_platform.hlinux/init.hlinux/slab.hlinux/platform_device.hlinux/bitops.hlinux/mfd/syscon.hlinux/regmap.h
Detected Declarations
function Copyrightfunction integrator_ap_lm_probe
Annotated Snippet
if (ret) {
dev_info(dev, "no valid address on child\n");
continue;
}
/* First populate the syscon then any devices */
if (res.start == base) {
dev_info(dev, "populate module @0x%08x from DT\n",
base);
ret = of_platform_default_populate(child, NULL, dev);
if (ret) {
dev_err(dev, "failed to populate module\n");
of_node_put(child);
return ret;
}
}
}
return 0;
}
static const struct of_device_id integrator_ap_syscon_match[] = {
{ .compatible = "arm,integrator-ap-syscon"},
{ },
};
static int integrator_ap_lm_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *syscon;
static struct regmap *map;
u32 val;
int ret;
int i;
/* Look up the system controller */
syscon = of_find_matching_node(NULL, integrator_ap_syscon_match);
if (!syscon) {
dev_err(dev,
"could not find Integrator/AP system controller\n");
return -ENODEV;
}
map = syscon_node_to_regmap(syscon);
of_node_put(syscon);
if (IS_ERR(map)) {
dev_err(dev,
"could not find Integrator/AP system controller\n");
return PTR_ERR(map);
}
ret = regmap_read(map, INTEGRATOR_SC_DEC_OFFSET, &val);
if (ret) {
dev_err(dev, "could not read from Integrator/AP syscon\n");
return ret;
}
/* Loop over the connected modules */
for (i = 0; i < 4; i++) {
if (!(val & BIT(4 + i)))
continue;
dev_info(dev, "detected module in slot %d\n", i);
ret = integrator_lm_populate(i, dev);
if (ret)
return ret;
}
return 0;
}
static const struct of_device_id integrator_ap_lm_match[] = {
{ .compatible = "arm,integrator-ap-lm"},
{ },
};
static struct platform_driver integrator_ap_lm_driver = {
.probe = integrator_ap_lm_probe,
.driver = {
.name = "integratorap-lm",
.of_match_table = integrator_ap_lm_match,
},
};
module_platform_driver(integrator_ap_lm_driver);
MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
MODULE_DESCRIPTION("Integrator AP Logical Module driver");
Annotation
- Immediate include surface: `linux/module.h`, `linux/err.h`, `linux/io.h`, `linux/of.h`, `linux/of_address.h`, `linux/of_platform.h`, `linux/init.h`, `linux/slab.h`.
- Detected declarations: `function Copyright`, `function integrator_ap_lm_probe`.
- Atlas domain: Driver Families / drivers/bus.
- 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.