sound/soc/mediatek/mt8186/mt8186-mt6366-common.c
Source file repositories/reference/linux-study-clean/sound/soc/mediatek/mt8186/mt8186-mt6366-common.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/mediatek/mt8186/mt8186-mt6366-common.c- Extension
.c- Size
- 1544 bytes
- Lines
- 58
- Domain
- Driver Families
- Bucket
- sound/soc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/soc.h../../codecs/mt6358.h../common/mtk-afe-platform-driver.hmt8186-afe-common.hmt8186-mt6366-common.h
Detected Declarations
function mt8186_mt6366_initfunction mt8186_mt6366_card_set_be_linkexport mt8186_mt6366_initexport mt8186_mt6366_card_set_be_link
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
//
// mt8186-mt6366-common.c
// -- MT8186 MT6366 ALSA common driver
//
// Copyright (c) 2022 MediaTek Inc.
// Author: Jiaxin Yu <jiaxin.yu@mediatek.com>
//
#include <sound/soc.h>
#include "../../codecs/mt6358.h"
#include "../common/mtk-afe-platform-driver.h"
#include "mt8186-afe-common.h"
#include "mt8186-mt6366-common.h"
int mt8186_mt6366_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *cmpnt_afe =
snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
struct snd_soc_component *cmpnt_codec =
snd_soc_rtd_to_codec(rtd, 0)->component;
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
struct mt8186_afe_private *afe_priv = afe->platform_priv;
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card);
int ret;
/* set mtkaif protocol */
mt6358_set_mtkaif_protocol(cmpnt_codec,
MT6358_MTKAIF_PROTOCOL_1);
afe_priv->mtkaif_protocol = MT6358_MTKAIF_PROTOCOL_1;
ret = snd_soc_dapm_sync(dapm);
if (ret) {
dev_err(rtd->dev, "failed to snd_soc_dapm_sync\n");
return ret;
}
return 0;
}
EXPORT_SYMBOL_GPL(mt8186_mt6366_init);
int mt8186_mt6366_card_set_be_link(struct device *dev,
struct snd_soc_dai_link *link,
struct device_node *node,
char *link_name)
{
int ret;
if (node && strcmp(link->name, link_name) == 0) {
ret = snd_soc_of_get_dai_link_codecs(dev, node, link);
if (ret < 0)
return dev_err_probe(dev, ret, "get dai link codecs fail\n");
}
return 0;
}
EXPORT_SYMBOL_GPL(mt8186_mt6366_card_set_be_link);
Annotation
- Immediate include surface: `sound/soc.h`, `../../codecs/mt6358.h`, `../common/mtk-afe-platform-driver.h`, `mt8186-afe-common.h`, `mt8186-mt6366-common.h`.
- Detected declarations: `function mt8186_mt6366_init`, `function mt8186_mt6366_card_set_be_link`, `export mt8186_mt6366_init`, `export mt8186_mt6366_card_set_be_link`.
- Atlas domain: Driver Families / sound/soc.
- 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.