drivers/soc/qcom/rpm-proc.c
Source file repositories/reference/linux-study-clean/drivers/soc/qcom/rpm-proc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/qcom/rpm-proc.c- Extension
.c- Size
- 1845 bytes
- Lines
- 78
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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/of.hlinux/of_platform.hlinux/platform_device.hlinux/rpmsg/qcom_smd.h
Detected Declarations
function rpm_proc_probefunction rpm_proc_removefunction rpm_proc_initfunction rpm_proc_exit
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2021-2023, Stephan Gerhold <stephan@gerhold.net> */
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/rpmsg/qcom_smd.h>
static int rpm_proc_probe(struct platform_device *pdev)
{
struct qcom_smd_edge *edge = NULL;
struct device *dev = &pdev->dev;
struct device_node *edge_node;
int ret;
edge_node = of_get_child_by_name(dev->of_node, "smd-edge");
if (edge_node) {
edge = qcom_smd_register_edge(dev, edge_node);
of_node_put(edge_node);
if (IS_ERR(edge))
return dev_err_probe(dev, PTR_ERR(edge),
"Failed to register smd-edge\n");
}
ret = devm_of_platform_populate(dev);
if (ret) {
dev_err(dev, "Failed to populate child devices: %d\n", ret);
goto err;
}
platform_set_drvdata(pdev, edge);
return 0;
err:
if (edge)
qcom_smd_unregister_edge(edge);
return ret;
}
static void rpm_proc_remove(struct platform_device *pdev)
{
struct qcom_smd_edge *edge = platform_get_drvdata(pdev);
if (edge)
qcom_smd_unregister_edge(edge);
}
static const struct of_device_id rpm_proc_of_match[] = {
{ .compatible = "qcom,rpm-proc", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, rpm_proc_of_match);
static struct platform_driver rpm_proc_driver = {
.probe = rpm_proc_probe,
.remove = rpm_proc_remove,
.driver = {
.name = "qcom-rpm-proc",
.of_match_table = rpm_proc_of_match,
},
};
static int __init rpm_proc_init(void)
{
return platform_driver_register(&rpm_proc_driver);
}
arch_initcall(rpm_proc_init);
static void __exit rpm_proc_exit(void)
{
platform_driver_unregister(&rpm_proc_driver);
}
module_exit(rpm_proc_exit);
MODULE_DESCRIPTION("Qualcomm RPM processor/subsystem driver");
MODULE_AUTHOR("Stephan Gerhold <stephan@gerhold.net>");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/rpmsg/qcom_smd.h`.
- Detected declarations: `function rpm_proc_probe`, `function rpm_proc_remove`, `function rpm_proc_init`, `function rpm_proc_exit`.
- Atlas domain: Driver Families / drivers/soc.
- 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.