sound/soc/intel/boards/sof_da7219.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/sof_da7219.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/sof_da7219.c- Extension
.c- Size
- 12718 bytes
- Lines
- 491
- 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
linux/input.hlinux/module.hsound/jack.hsound/pcm.hsound/pcm_params.hlinux/platform_device.hsound/soc.hsound/soc-acpi.hsound/sof.h../../codecs/da7219.hsof_board_helpers.hsof_maxim_common.h
Detected Declarations
function platform_clock_controlfunction da7219_codec_initfunction da7219_codec_exitfunction card_late_probefunction sof_card_dai_links_createfunction audio_probe
Annotated Snippet
if (ret) {
dev_err(rtd->dev, "fail to set pll, ret %d\n", ret);
return ret;
}
ctx->da7219.pll_bypass = true;
}
/*
* Headset buttons map to the google Reference headset.
* These can be configured by userspace.
*/
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
SND_JACK_HEADSET | SND_JACK_BTN_0 |
SND_JACK_BTN_1 | SND_JACK_BTN_2 |
SND_JACK_BTN_3 | SND_JACK_LINEOUT,
jack, jack_pins, ARRAY_SIZE(jack_pins));
if (ret) {
dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret);
return ret;
}
snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
ret = snd_soc_component_set_jack(component, jack, NULL);
if (ret) {
dev_err(rtd->dev, "fail to set component jack, ret %d\n", ret);
return ret;
}
return ret;
}
static void da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
snd_soc_component_set_jack(component, NULL, NULL);
}
static int card_late_probe(struct snd_soc_card *card)
{
struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
int err;
if (ctx->amp_type == CODEC_MAX98373) {
/* Disable Left and Right Spk pin after boot */
snd_soc_dapm_disable_pin(dapm, "Left Spk");
snd_soc_dapm_disable_pin(dapm, "Right Spk");
err = snd_soc_dapm_sync(dapm);
if (err < 0)
return err;
}
return sof_intel_board_card_late_probe(card);
}
static struct snd_soc_card card_da7219 = {
.name = "da7219", /* the sof- prefix is added by the core */
.owner = THIS_MODULE,
.controls = controls,
.num_controls = ARRAY_SIZE(controls),
.dapm_widgets = widgets,
.num_dapm_widgets = ARRAY_SIZE(widgets),
.dapm_routes = audio_map,
.num_dapm_routes = ARRAY_SIZE(audio_map),
.fully_routed = true,
.late_probe = card_late_probe,
};
static struct snd_soc_dai_link_component da7219_component[] = {
{
.name = "i2c-DLGS7219:00",
.dai_name = DIALOG_CODEC_DAI,
}
};
static int
sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
struct sof_card_private *ctx)
{
int ret;
ret = sof_intel_board_set_dai_link(dev, card, ctx);
if (ret)
return ret;
Annotation
- Immediate include surface: `linux/input.h`, `linux/module.h`, `sound/jack.h`, `sound/pcm.h`, `sound/pcm_params.h`, `linux/platform_device.h`, `sound/soc.h`, `sound/soc-acpi.h`.
- Detected declarations: `function platform_clock_control`, `function da7219_codec_init`, `function da7219_codec_exit`, `function card_late_probe`, `function sof_card_dai_links_create`, `function 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.