drivers/firmware/mtk-adsp-ipc.c
Source file repositories/reference/linux-study-clean/drivers/firmware/mtk-adsp-ipc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/mtk-adsp-ipc.c- Extension
.c- Size
- 3431 bytes
- Lines
- 142
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/firmware/mediatek/mtk-adsp-ipc.hlinux/kernel.hlinux/mailbox_client.hlinux/module.hlinux/platform_device.hlinux/slab.h
Detected Declarations
function mtk_adsp_ipc_sendfunction mtk_adsp_ipc_recvfunction mtk_adsp_ipc_probefunction mtk_adsp_ipc_removeexport mtk_adsp_ipc_send
Annotated Snippet
if (IS_ERR(adsp_chan->ch)) {
ret = dev_err_probe(dev, PTR_ERR(adsp_chan->ch),
"Failed to request mbox channel %s\n",
adsp_mbox_ch_names[i]);
for (j = 0; j < i; j++) {
adsp_chan = &adsp_ipc->chans[j];
mbox_free_channel(adsp_chan->ch);
}
return ret;
}
}
adsp_ipc->dev = dev;
dev_set_drvdata(dev, adsp_ipc);
dev_dbg(dev, "MTK ADSP IPC initialized\n");
return 0;
}
static void mtk_adsp_ipc_remove(struct platform_device *pdev)
{
struct mtk_adsp_ipc *adsp_ipc = dev_get_drvdata(&pdev->dev);
struct mtk_adsp_chan *adsp_chan;
int i;
for (i = 0; i < MTK_ADSP_MBOX_NUM; i++) {
adsp_chan = &adsp_ipc->chans[i];
mbox_free_channel(adsp_chan->ch);
}
}
static struct platform_driver mtk_adsp_ipc_driver = {
.driver = {
.name = "mtk-adsp-ipc",
},
.probe = mtk_adsp_ipc_probe,
.remove = mtk_adsp_ipc_remove,
};
builtin_platform_driver(mtk_adsp_ipc_driver);
MODULE_AUTHOR("Allen-KH Cheng <allen-kh.cheng@mediatek.com>");
MODULE_DESCRIPTION("MTK ADSP IPC Driver");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/firmware/mediatek/mtk-adsp-ipc.h`, `linux/kernel.h`, `linux/mailbox_client.h`, `linux/module.h`, `linux/platform_device.h`, `linux/slab.h`.
- Detected declarations: `function mtk_adsp_ipc_send`, `function mtk_adsp_ipc_recv`, `function mtk_adsp_ipc_probe`, `function mtk_adsp_ipc_remove`, `export mtk_adsp_ipc_send`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: integration 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.