sound/soc/qcom/common.c
Source file repositories/reference/linux-study-clean/sound/soc/qcom/common.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/qcom/common.c- Extension
.c- Size
- 6944 bytes
- Lines
- 268
- 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
dt-bindings/sound/qcom,q6afe.hlinux/module.hsound/jack.hlinux/input-event-codes.hcommon.h
Detected Declarations
function qcom_snd_parse_offunction for_each_available_child_of_node_scopedfunction qcom_snd_wcd_jack_setupfunction qcom_snd_dp_jack_setupfunction for_each_rtd_codec_daisexport qcom_snd_parse_ofexport qcom_snd_wcd_jack_setupexport qcom_snd_dp_jack_setup
Annotated Snippet
if (ret) {
dev_err(card->dev, "error getting codec dai_link name\n");
return ret;
}
struct device_node *cpu __free(device_node) =
of_get_child_by_name(np, "cpu");
struct device_node *platform __free(device_node) =
of_get_child_by_name(np, "platform");
struct device_node *codec __free(device_node) =
of_get_child_by_name(np, "codec");
if (!cpu) {
dev_err(dev, "%s: Can't find cpu DT node\n", link->name);
return -EINVAL;
}
ret = snd_soc_of_get_dlc(cpu, &args, link->cpus, 0);
if (ret) {
dev_err_probe(card->dev, ret,
"%s: error getting cpu dai name\n", link->name);
return ret;
}
link->id = args.args[0];
if (link->id >= LPASS_MAX_PORT) {
dev_err(dev, "%s: Invalid cpu dai id %d\n", link->name, link->id);
return -EINVAL;
}
if (platform) {
link->platforms->of_node = of_parse_phandle(platform,
"sound-dai",
0);
if (!link->platforms->of_node) {
dev_err(card->dev, "%s: platform dai not found\n", link->name);
return -EINVAL;
}
} else {
link->platforms->of_node = link->cpus->of_node;
}
if (codec) {
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
if (ret < 0) {
dev_err_probe(card->dev, ret,
"%s: codec dai not found\n", link->name);
return ret;
}
if (platform) {
/* DPCM backend */
link->no_pcm = 1;
link->ignore_pmdown_time = 1;
}
} else {
/* DPCM frontend */
link->codecs = &snd_soc_dummy_dlc;
link->num_codecs = 1;
link->dynamic = 1;
}
if (platform || !codec) {
/* DPCM */
link->ignore_suspend = 1;
link->nonatomic = 1;
}
link->stream_name = link->name;
link++;
}
if (!card->dapm_widgets) {
card->dapm_widgets = qcom_jack_snd_widgets;
card->num_dapm_widgets = ARRAY_SIZE(qcom_jack_snd_widgets);
}
return 0;
}
EXPORT_SYMBOL_GPL(qcom_snd_parse_of);
static struct snd_soc_jack_pin qcom_headset_jack_pins[] = {
/* Headset */
{
.pin = "Mic Jack",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Headphone Jack",
Annotation
- Immediate include surface: `dt-bindings/sound/qcom,q6afe.h`, `linux/module.h`, `sound/jack.h`, `linux/input-event-codes.h`, `common.h`.
- Detected declarations: `function qcom_snd_parse_of`, `function for_each_available_child_of_node_scoped`, `function qcom_snd_wcd_jack_setup`, `function qcom_snd_dp_jack_setup`, `function for_each_rtd_codec_dais`, `export qcom_snd_parse_of`, `export qcom_snd_wcd_jack_setup`, `export qcom_snd_dp_jack_setup`.
- 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.