sound/soc/intel/boards/bdw_rt286.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/bdw_rt286.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/bdw_rt286.c- Extension
.c- Size
- 7269 bytes
- Lines
- 260
- 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/module.hlinux/platform_device.hsound/core.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-acpi.h../../codecs/rt286.h
Detected Declarations
function codec_link_initfunction codec_link_exitfunction codec_link_hw_params_fixupfunction codec_link_hw_paramsfunction card_suspend_prefunction card_resume_postfunction bdw_rt286_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Sound card driver for Intel Broadwell Wildcat Point with Realtek 286
*
* Copyright (C) 2013, Intel Corporation
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "../../codecs/rt286.h"
static struct snd_soc_jack card_headset;
static struct snd_soc_jack_pin card_headset_pins[] = {
{
.pin = "Mic Jack",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
};
static const struct snd_kcontrol_new card_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
};
static const struct snd_soc_dapm_widget card_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_MIC("DMIC1", NULL),
SND_SOC_DAPM_MIC("DMIC2", NULL),
SND_SOC_DAPM_LINE("Line Jack", NULL),
};
static const struct snd_soc_dapm_route card_routes[] = {
{"Speaker", NULL, "SPOR"},
{"Speaker", NULL, "SPOL"},
{"Headphone Jack", NULL, "HPO Pin"},
{"MIC1", NULL, "Mic Jack"},
{"LINE1", NULL, "Line Jack"},
{"DMIC1 Pin", NULL, "DMIC1"},
{"DMIC2 Pin", NULL, "DMIC2"},
/* CODEC BE connections */
{"SSP0 CODEC IN", NULL, "AIF1 Capture"},
{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
};
static int codec_link_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *codec = snd_soc_rtd_to_codec(rtd, 0)->component;
int ret;
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0,
&card_headset, card_headset_pins,
ARRAY_SIZE(card_headset_pins));
if (ret)
return ret;
return snd_soc_component_set_jack(codec, &card_headset, NULL);
}
static void codec_link_exit(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *codec = snd_soc_rtd_to_codec(rtd, 0)->component;
snd_soc_component_set_jack(codec, NULL, NULL);
}
static int codec_link_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
/* The ADSP will convert the FE rate to 48kHz, stereo. */
rate->min = rate->max = 48000;
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `sound/core.h`, `sound/jack.h`, `sound/pcm.h`, `sound/pcm_params.h`, `sound/soc.h`, `sound/soc-acpi.h`.
- Detected declarations: `function codec_link_init`, `function codec_link_exit`, `function codec_link_hw_params_fixup`, `function codec_link_hw_params`, `function card_suspend_pre`, `function card_resume_post`, `function bdw_rt286_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.