drivers/soc/qcom/qcom_aoss.c
Source file repositories/reference/linux-study-clean/drivers/soc/qcom/qcom_aoss.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/qcom/qcom_aoss.c- Extension
.c- Size
- 16085 bytes
- Lines
- 674
- Domain
- Driver Families
- Bucket
- drivers/soc
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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-provider.hlinux/debugfs.hlinux/interrupt.hlinux/io.hlinux/mailbox_client.hlinux/module.hlinux/of_platform.hlinux/platform_device.hlinux/thermal.hlinux/slab.hlinux/string_choices.hlinux/soc/qcom/qcom_aoss.htrace-aoss.h
Detected Declarations
struct qmp_cooling_devicestruct qmpstruct qmp_debugfs_entryfunction qmp_kickfunction qmp_magic_validfunction qmp_link_ackedfunction qmp_mcore_channel_ackedfunction qmp_ucore_channel_upfunction qmp_openfunction qmp_closefunction qmp_intrfunction qmp_message_emptyfunction qmp_sendfunction qmp_qdss_clk_preparefunction qmp_qdss_clk_unpreparefunction qmp_qdss_clk_addfunction qmp_qdss_clk_removefunction qmp_cdev_get_max_statefunction qmp_cdev_get_cur_statefunction qmp_cdev_set_cur_statefunction qmp_cooling_device_addfunction qmp_cooling_devices_registerfunction for_each_available_child_of_node_scopedfunction qmp_cooling_devices_removefunction qmp_getfunction qmp_putfunction qmp_debugfs_writefunction qmp_debugfs_createfunction qmp_probefunction qmp_removeexport qmp_sendexport qmp_getexport qmp_put
Annotated Snippet
static const struct file_operations qmp_debugfs_fops = {
.open = simple_open,
.write = qmp_debugfs_write,
};
static void qmp_debugfs_create(struct qmp *qmp)
{
const struct qmp_debugfs_entry *entry;
int i;
qmp->debugfs_root = debugfs_create_dir("qcom_aoss", NULL);
for (i = 0; i < ARRAY_SIZE(qmp->debugfs_files); i++) {
entry = &qmp_debugfs_entries[i];
qmp->debugfs_files[i] = debugfs_create_file(entry->name, 0200,
qmp->debugfs_root,
qmp,
&qmp_debugfs_fops);
}
}
static int qmp_probe(struct platform_device *pdev)
{
struct qmp *qmp;
int irq;
int ret;
qmp = devm_kzalloc(&pdev->dev, sizeof(*qmp), GFP_KERNEL);
if (!qmp)
return -ENOMEM;
qmp->dev = &pdev->dev;
init_waitqueue_head(&qmp->event);
mutex_init(&qmp->tx_lock);
qmp->msgram = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(qmp->msgram))
return PTR_ERR(qmp->msgram);
qmp->mbox_client.dev = &pdev->dev;
qmp->mbox_client.knows_txdone = true;
qmp->mbox_chan = mbox_request_channel(&qmp->mbox_client, 0);
if (IS_ERR(qmp->mbox_chan)) {
dev_err(&pdev->dev, "failed to acquire ipc mailbox\n");
return PTR_ERR(qmp->mbox_chan);
}
irq = platform_get_irq(pdev, 0);
ret = devm_request_irq(&pdev->dev, irq, qmp_intr, 0,
"aoss-qmp", qmp);
if (ret < 0) {
dev_err(&pdev->dev, "failed to request interrupt\n");
goto err_free_mbox;
}
ret = qmp_open(qmp);
if (ret < 0)
goto err_free_mbox;
ret = qmp_qdss_clk_add(qmp);
if (ret)
goto err_close_qmp;
ret = qmp_cooling_devices_register(qmp);
if (ret)
dev_err(&pdev->dev, "failed to register aoss cooling devices\n");
platform_set_drvdata(pdev, qmp);
qmp_debugfs_create(qmp);
return 0;
err_close_qmp:
qmp_close(qmp);
err_free_mbox:
mbox_free_channel(qmp->mbox_chan);
return ret;
}
static void qmp_remove(struct platform_device *pdev)
{
struct qmp *qmp = platform_get_drvdata(pdev);
debugfs_remove_recursive(qmp->debugfs_root);
qmp_qdss_clk_remove(qmp);
qmp_cooling_devices_remove(qmp);
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/debugfs.h`, `linux/interrupt.h`, `linux/io.h`, `linux/mailbox_client.h`, `linux/module.h`, `linux/of_platform.h`, `linux/platform_device.h`.
- Detected declarations: `struct qmp_cooling_device`, `struct qmp`, `struct qmp_debugfs_entry`, `function qmp_kick`, `function qmp_magic_valid`, `function qmp_link_acked`, `function qmp_mcore_channel_acked`, `function qmp_ucore_channel_up`, `function qmp_open`, `function qmp_close`.
- Atlas domain: Driver Families / drivers/soc.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.