sound/soc/tegra/tegra_asoc_machine.c
Source file repositories/reference/linux-study-clean/sound/soc/tegra/tegra_asoc_machine.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/tegra/tegra_asoc_machine.c- Extension
.c- Size
- 29375 bytes
- Lines
- 1076
- 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/clk.hlinux/export.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/slab.hsound/core.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/soc.htegra_asoc_machine.h
Detected Declarations
function coupled_mic_hp_checkfunction tegra_machine_eventfunction tegra_asoc_machine_initfunction tegra_machine_mclk_rate_128function tegra_machine_mclk_rate_256function tegra_machine_mclk_rate_512function tegra_machine_mclk_rate_12mhzfunction tegra_machine_mclk_rate_6mhzfunction tegra_machine_mclk_rate_cpcapfunction tegra_machine_hw_paramsfunction tegra_machine_node_releasefunction tegra_machine_parse_phandlefunction tegra_machine_unregister_codecfunction tegra_machine_register_codecfunction tegra_asoc_machine_probefunction tegra_wm9712_initfunction tegra_rt5677_initexport tegra_asoc_machine_initexport tegra_asoc_machine_probe
Annotated Snippet
if (err) {
dev_err(rtd->dev,
"Headphones Jack creation failed: %d\n", err);
return err;
}
tegra_machine_hp_jack_gpio.desc = machine->gpiod_hp_det;
err = snd_soc_jack_add_gpios(&tegra_machine_hp_jack, 1,
&tegra_machine_hp_jack_gpio);
if (err)
dev_err(rtd->dev, "HP GPIOs not added: %d\n", err);
}
if (machine->gpiod_hp_det && machine->asoc->add_headset_jack) {
err = snd_soc_card_jack_new_pins(card, "Headset Jack",
SND_JACK_HEADSET,
&tegra_machine_headset_jack,
tegra_machine_headset_jack_pins,
ARRAY_SIZE(tegra_machine_headset_jack_pins));
if (err) {
dev_err(rtd->dev,
"Headset Jack creation failed: %d\n", err);
return err;
}
tegra_machine_headset_jack_gpio.desc = machine->gpiod_hp_det;
err = snd_soc_jack_add_gpios(&tegra_machine_headset_jack, 1,
&tegra_machine_headset_jack_gpio);
if (err)
dev_err(rtd->dev, "Headset GPIOs not added: %d\n", err);
}
if (machine->gpiod_mic_det && machine->asoc->add_mic_jack) {
err = snd_soc_card_jack_new_pins(rtd->card, "Mic Jack",
SND_JACK_MICROPHONE,
&tegra_machine_mic_jack,
tegra_machine_mic_jack_pins,
ARRAY_SIZE(tegra_machine_mic_jack_pins));
if (err) {
dev_err(rtd->dev, "Mic Jack creation failed: %d\n", err);
return err;
}
tegra_machine_mic_jack_gpio.data = machine;
tegra_machine_mic_jack_gpio.desc = machine->gpiod_mic_det;
if (of_property_read_bool(card->dev->of_node,
"nvidia,coupled-mic-hp-det")) {
tegra_machine_mic_jack_gpio.desc = machine->gpiod_hp_det;
tegra_machine_mic_jack_gpio.jack_status_check = coupled_mic_hp_check;
}
err = snd_soc_jack_add_gpios(&tegra_machine_mic_jack, 1,
&tegra_machine_mic_jack_gpio);
if (err)
dev_err(rtd->dev, "Mic GPIOs not added: %d\n", err);
}
return 0;
}
EXPORT_SYMBOL_GPL(tegra_asoc_machine_init);
static unsigned int tegra_machine_mclk_rate_128(unsigned int srate)
{
return 128 * srate;
}
static unsigned int tegra_machine_mclk_rate_256(unsigned int srate)
{
return 256 * srate;
}
static unsigned int tegra_machine_mclk_rate_512(unsigned int srate)
{
return 512 * srate;
}
static unsigned int tegra_machine_mclk_rate_12mhz(unsigned int srate)
{
unsigned int mclk;
switch (srate) {
case 8000:
case 16000:
case 24000:
case 32000:
case 48000:
case 64000:
Annotation
- Immediate include surface: `linux/clk.h`, `linux/export.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/slab.h`, `sound/core.h`.
- Detected declarations: `function coupled_mic_hp_check`, `function tegra_machine_event`, `function tegra_asoc_machine_init`, `function tegra_machine_mclk_rate_128`, `function tegra_machine_mclk_rate_256`, `function tegra_machine_mclk_rate_512`, `function tegra_machine_mclk_rate_12mhz`, `function tegra_machine_mclk_rate_6mhz`, `function tegra_machine_mclk_rate_cpcap`, `function tegra_machine_hw_params`.
- 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.