sound/soc/intel/boards/skl_hda_dsp_generic.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/skl_hda_dsp_generic.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/skl_hda_dsp_generic.c- Extension
.c- Size
- 4628 bytes
- Lines
- 179
- 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.
- 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/module.hlinux/platform_device.hsound/core.hsound/hda_codec.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-acpi.h../../codecs/hdac_hda.h../../sof/intel/hda.hsof_board_helpers.h
Detected Declarations
function skl_hda_card_late_probefunction skl_set_hda_codec_autosuspend_delayfunction for_each_card_rtdsfunction skl_hda_get_board_quirkfunction skl_hda_add_dai_linkfunction skl_hda_audio_probe
Annotated Snippet
if (hda_pvt) {
/*
* all codecs are on the same bus, so it's sufficient
* to look up only the first one
*/
snd_hda_set_power_save(hda_pvt->codec->bus,
HDA_CODEC_AUTOSUSPEND_DELAY_MS);
break;
}
}
}
#define IDISP_HDMI_BE_ID 1
#define HDA_BE_ID 4
#define DMIC01_BE_ID 6
#define DMIC16K_BE_ID 7
#define BT_OFFLOAD_BE_ID 8
#define HDA_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_IDISP_HDMI, \
SOF_LINK_HDA, \
SOF_LINK_DMIC01, \
SOF_LINK_DMIC16K, \
SOF_LINK_BT_OFFLOAD, \
SOF_LINK_NONE, \
SOF_LINK_NONE)
#define HDA_LINK_IDS SOF_LINK_ORDER(IDISP_HDMI_BE_ID, \
HDA_BE_ID, \
DMIC01_BE_ID, \
DMIC16K_BE_ID, \
BT_OFFLOAD_BE_ID, \
0, \
0)
static unsigned long
skl_hda_get_board_quirk(struct snd_soc_acpi_mach_params *mach_params)
{
unsigned long board_quirk = 0;
int ssp_bt;
if (hweight_long(mach_params->bt_link_mask) == 1) {
ssp_bt = fls(mach_params->bt_link_mask) - 1;
board_quirk |= SOF_SSP_PORT_BT_OFFLOAD(ssp_bt) |
SOF_BT_OFFLOAD_PRESENT;
}
return board_quirk;
}
static int skl_hda_add_dai_link(struct snd_soc_card *card,
struct snd_soc_dai_link *link)
{
struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);
/* Ignore the HDMI PCM link if iDisp is not present */
if (strstr(link->stream_name, "HDMI") && !ctx->hdmi.idisp_codec)
link->ignore = true;
return 0;
}
static int skl_hda_audio_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
struct sof_card_private *ctx;
struct snd_soc_card *card;
unsigned long board_quirk = skl_hda_get_board_quirk(&mach->mach_params);
int ret;
card = devm_kzalloc(&pdev->dev, sizeof(struct snd_soc_card), GFP_KERNEL);
if (!card)
return -ENOMEM;
card->name = "hda-dsp";
card->owner = THIS_MODULE;
card->fully_routed = true;
card->late_probe = skl_hda_card_late_probe;
card->add_dai_link = skl_hda_add_dai_link;
dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk);
/* initialize ctx with board quirk */
ctx = sof_intel_board_get_ctx(&pdev->dev, board_quirk);
if (!ctx)
return -ENOMEM;
if (HDA_EXT_CODEC(mach->mach_params.codec_mask))
ctx->hda_codec_present = true;
if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `sound/core.h`, `sound/hda_codec.h`, `sound/jack.h`, `sound/pcm.h`, `sound/pcm_params.h`, `sound/soc.h`.
- Detected declarations: `function skl_hda_card_late_probe`, `function skl_set_hda_codec_autosuspend_delay`, `function for_each_card_rtds`, `function skl_hda_get_board_quirk`, `function skl_hda_add_dai_link`, `function skl_hda_audio_probe`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.