sound/soc/generic/audio-graph-card.c
Source file repositories/reference/linux-study-clean/sound/soc/generic/audio-graph-card.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/generic/audio-graph-card.c- Extension
.c- Size
- 18701 bytes
- Lines
- 662
- 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
linux/cleanup.hlinux/clk.hlinux/device.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/string.hsound/graph_card.h
Detected Declarations
function _graph_retfunction graph_outdrv_eventfunction soc_component_is_pcmfunction graph_parse_convertfunction graph_parse_nodefunction graph_link_initfunction graph_dai_link_of_dpcmfunction graph_dai_link_offunction parse_as_dpcm_linkfunction __graph_for_each_linkfunction for_each_of_graph_port_endpointfunction graph_for_each_linkfunction graph_count_nomlfunction graph_count_dpcmfunction graph_get_dais_countfunction audio_graph_parse_offunction graph_probeexport audio_graph_parse_of
Annotated Snippet
if (card->component_chaining && !soc_component_is_pcm(cpus)) {
dai_link->no_pcm = 1;
dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
}
simple_util_canonicalize_cpu(cpus, is_single_links);
simple_util_canonicalize_platform(platforms, cpus);
} else {
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0);
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
/* CPU is dummy */
/* BE settings */
dai_link->no_pcm = 1;
dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
ret = graph_parse_node(priv, codec_ep, li, NULL);
if (ret < 0)
goto end;
snprintf(dai_name, sizeof(dai_name),
"be.%pOFP.%s", codecs->of_node, codecs->dai_name);
/* check "prefix" from top node */
struct device_node *port __free(device_node) = ep_to_port(ep);
struct device_node *ports __free(device_node) = port_to_ports(port);
snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, "prefix");
snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix");
snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, "prefix");
}
graph_parse_convert(dev, ep, &dai_props->adata);
ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
li->link++;
end:
return graph_ret(priv, ret);
}
static int graph_dai_link_of(struct simple_util_priv *priv,
struct device_node *cpu_ep,
struct device_node *codec_ep,
struct link_info *li)
{
struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
char dai_name[64];
int ret, is_single_links = 0;
dev_dbg(dev, "link_of (%pOF)\n", cpu_ep);
ret = graph_parse_node(priv, cpu_ep, li, &is_single_links);
if (ret < 0)
goto end;
ret = graph_parse_node(priv, codec_ep, li, NULL);
if (ret < 0)
goto end;
snprintf(dai_name, sizeof(dai_name),
"%s-%s", cpus->dai_name, codecs->dai_name);
simple_util_canonicalize_cpu(cpus, is_single_links);
simple_util_canonicalize_platform(platforms, cpus);
ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
if (ret < 0)
goto end;
li->link++;
end:
return graph_ret(priv, ret);
}
static inline bool parse_as_dpcm_link(struct simple_util_priv *priv,
struct device_node *codec_port,
struct simple_util_data *adata)
{
if (priv->force_dpcm)
return true;
if (!priv->dpcm_selectable)
return false;
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/clk.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`.
- Detected declarations: `function _graph_ret`, `function graph_outdrv_event`, `function soc_component_is_pcm`, `function graph_parse_convert`, `function graph_parse_node`, `function graph_link_init`, `function graph_dai_link_of_dpcm`, `function graph_dai_link_of`, `function parse_as_dpcm_link`, `function __graph_for_each_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.