sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
Source file repositories/reference/linux-study-clean/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c- Extension
.c- Size
- 27236 bytes
- Lines
- 995
- Domain
- Driver Families
- Bucket
- sound/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.
- 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/delay.hlinux/dma-mapping.hlinux/module.hlinux/mfd/syscon.hlinux/of.hlinux/of_address.hlinux/of_reserved_mem.hlinux/pm_runtime.hlinux/reset.hmt8183-afe-common.hmt8183-afe-clk.hmt8183-interconnection.hmt8183-reg.h../common/mtk-afe-platform-driver.h../common/mtk-afe-fe-dai.h
Detected Declarations
function mt8183_general_rate_transformfunction dai_memif_rate_transformfunction mt8183_rate_transformfunction mt8183_memif_fsfunction mt8183_irq_fsfunction mt8183_is_volatile_regfunction mt8183_afe_irq_handlerfunction mt8183_afe_runtime_suspendfunction mt8183_afe_runtime_resumefunction mt8183_dai_memif_registerfunction mt8183_afe_release_reserved_memfunction mt8183_afe_pcm_dev_probefunction mt8183_afe_pcm_dev_remove
Annotated Snippet
if (ret) {
dev_warn(dev, "dai register i %d fail, ret %d\n",
i, ret);
goto err_pm_disable;
}
}
/* init dai_driver and component_driver */
ret = mtk_afe_combine_sub_dai(afe);
if (ret) {
dev_warn(dev, "mtk_afe_combine_sub_dai fail, ret %d\n", ret);
goto err_pm_disable;
}
afe->mtk_afe_hardware = &mt8183_afe_hardware;
afe->memif_fs = mt8183_memif_fs;
afe->irq_fs = mt8183_irq_fs;
afe->runtime_resume = mt8183_afe_runtime_resume;
afe->runtime_suspend = mt8183_afe_runtime_suspend;
/* register component */
ret = devm_snd_soc_register_component(dev, &mtk_afe_pcm_platform,
NULL, 0);
if (ret) {
dev_warn(dev, "err_platform\n");
goto err_pm_disable;
}
ret = devm_snd_soc_register_component(dev, &mt8183_afe_pcm_dai_component,
afe->dai_drivers,
afe->num_dai_drivers);
if (ret) {
dev_warn(dev, "err_dai_component\n");
goto err_pm_disable;
}
return ret;
err_pm_disable:
pm_runtime_disable(dev);
return ret;
}
static void mt8183_afe_pcm_dev_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
pm_runtime_disable(dev);
if (!pm_runtime_status_suspended(dev))
mt8183_afe_runtime_suspend(dev);
}
static const struct of_device_id mt8183_afe_pcm_dt_match[] = {
{ .compatible = "mediatek,mt8183-audio", },
{},
};
MODULE_DEVICE_TABLE(of, mt8183_afe_pcm_dt_match);
static const struct dev_pm_ops mt8183_afe_pm_ops = {
RUNTIME_PM_OPS(mt8183_afe_runtime_suspend,
mt8183_afe_runtime_resume, NULL)
};
static struct platform_driver mt8183_afe_pcm_driver = {
.driver = {
.name = "mt8183-audio",
.of_match_table = mt8183_afe_pcm_dt_match,
.pm = pm_ptr(&mt8183_afe_pm_ops),
},
.probe = mt8183_afe_pcm_dev_probe,
.remove = mt8183_afe_pcm_dev_remove,
};
module_platform_driver(mt8183_afe_pcm_driver);
MODULE_DESCRIPTION("Mediatek ALSA SoC AFE platform driver for 8183");
MODULE_AUTHOR("KaiChieh Chuang <kaichieh.chuang@mediatek.com>");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/delay.h`, `linux/dma-mapping.h`, `linux/module.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/of_address.h`, `linux/of_reserved_mem.h`, `linux/pm_runtime.h`.
- Detected declarations: `function mt8183_general_rate_transform`, `function dai_memif_rate_transform`, `function mt8183_rate_transform`, `function mt8183_memif_fs`, `function mt8183_irq_fs`, `function mt8183_is_volatile_reg`, `function mt8183_afe_irq_handler`, `function mt8183_afe_runtime_suspend`, `function mt8183_afe_runtime_resume`, `function mt8183_dai_memif_register`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- 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.