sound/soc/sof/intel/hda-dai-ops.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/intel/hda-dai-ops.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/intel/hda-dai-ops.c- Extension
.c- Size
- 19375 bytes
- Lines
- 662
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/pcm_params.hsound/hdaudio_ext.hsound/hda_register.hsound/hda-mlink.hsound/sof/ipc4/header.huapi/sound/sof/header.h../ipc4-priv.h../ipc4-topology.h../sof-priv.h../sof-audio.hhda.h
Detected Declarations
function hda_check_fesfunction for_each_dpcm_fefunction hda_link_stream_assignfunction hda_release_hext_streamfunction hda_setup_hext_streamfunction hda_reset_hext_streamfunction hda_codec_dai_set_streamfunction hda_calc_stream_formatfunction generic_calc_stream_formatfunction dmic_calc_stream_formatfunction hda_ipc4_pre_triggerfunction hda_triggerfunction hda_ipc4_post_triggerfunction hda_ipc3_post_triggerfunction hda_dspless_get_hext_streamfunction hda_dspless_setup_hext_streamfunction hda_select_dai_widget_ops
Annotated Snippet
if (!hext_stream->link_locked) {
/*
* choose the first available link for platforms that do not have the
* PROCEN_FMT_QUIRK set.
*/
if (!(chip->quirks & SOF_INTEL_PROCEN_FMT_QUIRK)) {
res = hext_stream;
break;
}
if (hstream->opened) {
/*
* check if the stream tag matches the stream
* tag of one of the connected FEs
*/
if (hda_check_fes(rtd, stream_dir,
hstream->stream_tag)) {
res = hext_stream;
break;
}
} else {
res = hext_stream;
/*
* This must be a hostless stream.
* So reserve the host DMA channel.
*/
hda_stream->host_reserved = 1;
break;
}
}
}
if (res) {
/* Make sure that host and link DMA is decoupled. */
snd_hdac_ext_stream_decouple_locked(bus, res, true);
res->link_locked = 1;
res->link_substream = substream;
}
return res;
}
static struct hdac_ext_stream *hda_get_hext_stream(struct snd_sof_dev *sdev,
struct snd_soc_dai *cpu_dai,
struct snd_pcm_substream *substream)
{
return snd_soc_dai_get_dma_data(cpu_dai, substream);
}
static struct hdac_ext_stream *hda_ipc4_get_hext_stream(struct snd_sof_dev *sdev,
struct snd_soc_dai *cpu_dai,
struct snd_pcm_substream *substream)
{
struct snd_sof_widget *pipe_widget;
struct sof_ipc4_pipeline *pipeline;
struct snd_sof_widget *swidget;
struct snd_soc_dapm_widget *w;
w = snd_soc_dai_get_widget(cpu_dai, substream->stream);
swidget = w->dobj.private;
pipe_widget = swidget->spipe->pipe_widget;
pipeline = pipe_widget->private;
/* mark pipeline so that it can be skipped during FE trigger */
pipeline->skip_during_fe_trigger = true;
return snd_soc_dai_get_dma_data(cpu_dai, substream);
}
static struct hdac_ext_stream *hda_assign_hext_stream(struct snd_sof_dev *sdev,
struct snd_soc_dai *cpu_dai,
struct snd_pcm_substream *substream)
{
struct hdac_ext_stream *hext_stream;
hext_stream = hda_link_stream_assign(sof_to_bus(sdev), substream);
if (!hext_stream)
return NULL;
snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)hext_stream);
return hext_stream;
}
static void hda_release_hext_stream(struct snd_sof_dev *sdev, struct snd_soc_dai *cpu_dai,
struct snd_pcm_substream *substream)
{
struct hdac_ext_stream *hext_stream = hda_get_hext_stream(sdev, cpu_dai, substream);
Annotation
- Immediate include surface: `sound/pcm_params.h`, `sound/hdaudio_ext.h`, `sound/hda_register.h`, `sound/hda-mlink.h`, `sound/sof/ipc4/header.h`, `uapi/sound/sof/header.h`, `../ipc4-priv.h`, `../ipc4-topology.h`.
- Detected declarations: `function hda_check_fes`, `function for_each_dpcm_fe`, `function hda_link_stream_assign`, `function hda_release_hext_stream`, `function hda_setup_hext_stream`, `function hda_reset_hext_stream`, `function hda_codec_dai_set_stream`, `function hda_calc_stream_format`, `function generic_calc_stream_format`, `function dmic_calc_stream_format`.
- 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.