drivers/acpi/arm64/amba.c
Source file repositories/reference/linux-study-clean/drivers/acpi/arm64/amba.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/arm64/amba.c- Extension
.c- Size
- 2752 bytes
- Lines
- 118
- Domain
- Driver Families
- Bucket
- drivers/acpi
- 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/acpi.hlinux/amba/bus.hlinux/clkdev.hlinux/clk-provider.hlinux/device.hlinux/err.hlinux/ioport.hlinux/kernel.hlinux/module.hinit.h
Detected Declarations
function amba_register_dummy_clkfunction amba_handler_attachfunction list_for_each_entryfunction acpi_amba_init
Annotated Snippet
switch (resource_type(rentry->res)) {
case IORESOURCE_MEM:
if (!address_found) {
dev->res = *rentry->res;
dev->res.name = dev_name(&dev->dev);
address_found = true;
}
break;
case IORESOURCE_IRQ:
if (irq_no < AMBA_NR_IRQS)
dev->irq[irq_no++] = rentry->res->start;
break;
default:
dev_warn(&adev->dev, "Invalid resource\n");
break;
}
}
acpi_dev_free_resource_list(&resource_list);
/*
* If the ACPI node has a parent and that parent has a physical device
* attached to it, that physical device should be the parent of
* the amba device we are about to create.
*/
if (parent)
dev->dev.parent = acpi_get_first_physical_node(parent);
device_set_node(&dev->dev, acpi_fwnode_handle(adev));
ret = amba_device_add(dev, &iomem_resource);
if (ret) {
dev_err(&adev->dev, "%s(): amba_device_add() failed (%d)\n",
__func__, ret);
goto err_free;
}
return 1;
err_free:
amba_device_put(dev);
return ret;
}
static struct acpi_scan_handler amba_handler = {
.ids = amba_id_list,
.attach = amba_handler_attach,
};
void __init acpi_amba_init(void)
{
amba_register_dummy_clk();
acpi_scan_add_handler(&amba_handler);
}
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/amba/bus.h`, `linux/clkdev.h`, `linux/clk-provider.h`, `linux/device.h`, `linux/err.h`, `linux/ioport.h`, `linux/kernel.h`.
- Detected declarations: `function amba_register_dummy_clk`, `function amba_handler_attach`, `function list_for_each_entry`, `function acpi_amba_init`.
- Atlas domain: Driver Families / drivers/acpi.
- 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.