drivers/bus/tegra-aconnect.c
Source file repositories/reference/linux-study-clean/drivers/bus/tegra-aconnect.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bus/tegra-aconnect.c- Extension
.c- Size
- 3008 bytes
- Lines
- 117
- 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.
- 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/clk.hlinux/module.hlinux/of_platform.hlinux/platform_device.hlinux/pm_runtime.h
Detected Declarations
struct tegra_aconnectfunction tegra_aconnect_probefunction tegra_aconnect_removefunction tegra_aconnect_runtime_resumefunction tegra_aconnect_runtime_suspend
Annotated Snippet
struct tegra_aconnect {
struct clk *ape_clk;
struct clk *apb2ape_clk;
};
static int tegra_aconnect_probe(struct platform_device *pdev)
{
struct tegra_aconnect *aconnect;
if (!pdev->dev.of_node)
return -EINVAL;
aconnect = devm_kzalloc(&pdev->dev, sizeof(struct tegra_aconnect),
GFP_KERNEL);
if (!aconnect)
return -ENOMEM;
aconnect->ape_clk = devm_clk_get(&pdev->dev, "ape");
if (IS_ERR(aconnect->ape_clk))
return dev_err_probe(&pdev->dev, PTR_ERR(aconnect->ape_clk),
"can't retrieve ape clock\n");
aconnect->apb2ape_clk = devm_clk_get(&pdev->dev, "apb2ape");
if (IS_ERR(aconnect->apb2ape_clk))
return dev_err_probe(&pdev->dev, PTR_ERR(aconnect->apb2ape_clk),
"can't retrieve apb2ape clock\n");
dev_set_drvdata(&pdev->dev, aconnect);
pm_runtime_enable(&pdev->dev);
of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
dev_info(&pdev->dev, "Tegra ACONNECT bus registered\n");
return 0;
}
static void tegra_aconnect_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
}
static int tegra_aconnect_runtime_resume(struct device *dev)
{
struct tegra_aconnect *aconnect = dev_get_drvdata(dev);
int ret;
ret = clk_prepare_enable(aconnect->ape_clk);
if (ret) {
dev_err(dev, "ape clk_enable failed: %d\n", ret);
return ret;
}
ret = clk_prepare_enable(aconnect->apb2ape_clk);
if (ret) {
clk_disable_unprepare(aconnect->ape_clk);
dev_err(dev, "apb2ape clk_enable failed: %d\n", ret);
return ret;
}
return 0;
}
static int tegra_aconnect_runtime_suspend(struct device *dev)
{
struct tegra_aconnect *aconnect = dev_get_drvdata(dev);
clk_disable_unprepare(aconnect->ape_clk);
clk_disable_unprepare(aconnect->apb2ape_clk);
return 0;
}
static const struct dev_pm_ops tegra_aconnect_pm_ops = {
SET_RUNTIME_PM_OPS(tegra_aconnect_runtime_suspend,
tegra_aconnect_runtime_resume, NULL)
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
};
static const struct of_device_id tegra_aconnect_of_match[] = {
{ .compatible = "nvidia,tegra210-aconnect", },
{ }
};
MODULE_DEVICE_TABLE(of, tegra_aconnect_of_match);
static struct platform_driver tegra_aconnect_driver = {
.probe = tegra_aconnect_probe,
.remove = tegra_aconnect_remove,
.driver = {
Annotation
- Immediate include surface: `linux/clk.h`, `linux/module.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct tegra_aconnect`, `function tegra_aconnect_probe`, `function tegra_aconnect_remove`, `function tegra_aconnect_runtime_resume`, `function tegra_aconnect_runtime_suspend`.
- 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.