sound/soc/intel/boards/bdw-rt5677.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/bdw-rt5677.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/bdw-rt5677.c- Extension
.c- Size
- 12957 bytes
- Lines
- 461
- 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.
- 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/acpi.hlinux/module.hlinux/platform_device.hlinux/gpio/consumer.hlinux/delay.hsound/core.hsound/pcm.hsound/soc.hsound/pcm_params.hsound/jack.hsound/soc-acpi.h../../codecs/rt5677.h
Detected Declarations
struct bdw_rt5677_privfunction bdw_rt5677_event_hpfunction broadwell_ssp0_fixupfunction bdw_rt5677_hw_paramsfunction bdw_rt5677_dsp_hw_paramsfunction bdw_rt5677_fe_startupfunction bdw_rt5677_initfunction bdw_rt5677_exitfunction bdw_rt5677_suspend_prefunction bdw_rt5677_resume_postfunction bdw_rt5677_probe
Annotated Snippet
struct bdw_rt5677_priv {
struct gpio_desc *gpio_hp_en;
struct snd_soc_component *component;
};
static int bdw_rt5677_event_hp(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
struct snd_soc_card *card = snd_soc_dapm_to_card(w->dapm);
struct bdw_rt5677_priv *bdw_rt5677 = snd_soc_card_get_drvdata(card);
if (SND_SOC_DAPM_EVENT_ON(event))
msleep(70);
gpiod_set_value_cansleep(bdw_rt5677->gpio_hp_en,
SND_SOC_DAPM_EVENT_ON(event));
return 0;
}
static const struct snd_soc_dapm_widget bdw_rt5677_widgets[] = {
SND_SOC_DAPM_HP("Headphone", bdw_rt5677_event_hp),
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("Local DMICs", NULL),
SND_SOC_DAPM_MIC("Remote DMICs", NULL),
};
static const struct snd_soc_dapm_route bdw_rt5677_map[] = {
/* Speakers */
{"Speaker", NULL, "PDM1L"},
{"Speaker", NULL, "PDM1R"},
/* Headset jack connectors */
{"Headphone", NULL, "LOUT1"},
{"Headphone", NULL, "LOUT2"},
{"IN1P", NULL, "Headset Mic"},
{"IN1N", NULL, "Headset Mic"},
/* Digital MICs
* Local DMICs: the two DMICs on the mainboard
* Remote DMICs: the two DMICs on the camera module
*/
{"DMIC L1", NULL, "Remote DMICs"},
{"DMIC R1", NULL, "Remote DMICs"},
{"DMIC L2", NULL, "Local DMICs"},
{"DMIC R2", NULL, "Local DMICs"},
/* CODEC BE connections */
{"SSP0 CODEC IN", NULL, "AIF1 Capture"},
{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
{"DSP Capture", NULL, "DSP Buffer"},
/* DSP Clock Connections */
{ "DSP Buffer", NULL, "SSP0 CODEC IN" },
{ "SSP0 CODEC IN", NULL, "DSPTX" },
};
static const struct snd_kcontrol_new bdw_rt5677_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Local DMICs"),
SOC_DAPM_PIN_SWITCH("Remote DMICs"),
};
static struct snd_soc_jack headphone_jack;
static struct snd_soc_jack mic_jack;
static struct snd_soc_jack_pin headphone_jack_pin = {
.pin = "Headphone",
.mask = SND_JACK_HEADPHONE,
};
static struct snd_soc_jack_pin mic_jack_pin = {
.pin = "Headset Mic",
.mask = SND_JACK_MICROPHONE,
};
static struct snd_soc_jack_gpio headphone_jack_gpio = {
.name = "plug-det",
.report = SND_JACK_HEADPHONE,
.debounce_time = 200,
};
static struct snd_soc_jack_gpio mic_jack_gpio = {
.name = "mic-present",
.report = SND_JACK_MICROPHONE,
.debounce_time = 200,
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/module.h`, `linux/platform_device.h`, `linux/gpio/consumer.h`, `linux/delay.h`, `sound/core.h`, `sound/pcm.h`, `sound/soc.h`.
- Detected declarations: `struct bdw_rt5677_priv`, `function bdw_rt5677_event_hp`, `function broadwell_ssp0_fixup`, `function bdw_rt5677_hw_params`, `function bdw_rt5677_dsp_hw_params`, `function bdw_rt5677_fe_startup`, `function bdw_rt5677_init`, `function bdw_rt5677_exit`, `function bdw_rt5677_suspend_pre`, `function bdw_rt5677_resume_post`.
- 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.