sound/soc/intel/boards/sof_board_helpers.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/sof_board_helpers.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/sof_board_helpers.c- Extension
.c- Size
- 18561 bytes
- Lines
- 786
- 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.
- 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
sound/soc.h../common/soc-intel-quirks.hhda_dsp_common.hsof_board_helpers.h
Detected Declarations
enum sof_dmic_be_typeenum sof_hda_be_typefunction hdmi_initfunction sof_intel_board_card_late_probefunction dmic_initfunction hda_initfunction set_ssp_codec_linkfunction set_dmic_linkfunction set_idisp_hdmi_linkfunction set_ssp_amp_linkfunction set_bt_offload_linkfunction set_hdmi_in_linkfunction set_hda_codec_linkfunction calculate_num_linksfunction sof_intel_board_set_dai_linkfunction for_each_set_bitfunction sof_intel_board_get_ctx
Annotated Snippet
if (ctx->link_id_overwrite) {
be_id = link_ids & SOF_LINK_IDS_MASK;
link_ids >>= SOF_LINK_IDS_SHIFT;
} else {
/* use array index as link id */
be_id = idx;
}
switch (link) {
case SOF_LINK_CODEC:
/* headphone codec */
if (ctx->codec_type == CODEC_NONE)
continue;
ret = set_ssp_codec_link(dev, &links[idx], be_id,
ctx->codec_type, ctx->ssp_codec);
if (ret) {
dev_err(dev, "fail to set codec link, ret %d\n",
ret);
return ret;
}
ctx->codec_link = &links[idx];
idx++;
break;
case SOF_LINK_DMIC01:
/* dmic01 */
if (ctx->dmic_be_num == 0)
continue;
/* at least we have dmic01 */
ret = set_dmic_link(dev, &links[idx], be_id, SOF_DMIC_01);
if (ret) {
dev_err(dev, "fail to set dmic01 link, ret %d\n",
ret);
return ret;
}
idx++;
break;
case SOF_LINK_DMIC16K:
/* dmic16k */
if (ctx->dmic_be_num <= 1)
continue;
/* set up 2 BE links at most */
ret = set_dmic_link(dev, &links[idx], be_id,
SOF_DMIC_16K);
if (ret) {
dev_err(dev, "fail to set dmic16k link, ret %d\n",
ret);
return ret;
}
idx++;
break;
case SOF_LINK_IDISP_HDMI:
/* idisp HDMI */
for (i = 1; i <= ctx->hdmi_num; i++) {
ret = set_idisp_hdmi_link(dev, &links[idx],
be_id, i,
ctx->hdmi.idisp_codec);
if (ret) {
dev_err(dev, "fail to set hdmi link, ret %d\n",
ret);
return ret;
}
idx++;
be_id++;
}
break;
case SOF_LINK_AMP:
/* speaker amp */
if (ctx->amp_type == CODEC_NONE)
continue;
ret = set_ssp_amp_link(dev, &links[idx], be_id,
ctx->amp_type, ctx->ssp_amp);
if (ret) {
dev_err(dev, "fail to set amp link, ret %d\n",
ret);
return ret;
}
ctx->amp_link = &links[idx];
idx++;
break;
case SOF_LINK_BT_OFFLOAD:
/* BT audio offload */
Annotation
- Immediate include surface: `sound/soc.h`, `../common/soc-intel-quirks.h`, `hda_dsp_common.h`, `sof_board_helpers.h`.
- Detected declarations: `enum sof_dmic_be_type`, `enum sof_hda_be_type`, `function hdmi_init`, `function sof_intel_board_card_late_probe`, `function dmic_init`, `function hda_init`, `function set_ssp_codec_link`, `function set_dmic_link`, `function set_idisp_hdmi_link`, `function set_ssp_amp_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.