sound/soc/intel/boards/bdw-rt5650.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/bdw-rt5650.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/bdw-rt5650.c- Extension
.c- Size
- 9235 bytes
- Lines
- 336
- 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/delay.hlinux/gpio/consumer.hlinux/module.hlinux/platform_device.hsound/core.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-acpi.h../../codecs/rt5645.h
Detected Declarations
struct bdw_rt5650_privfunction broadwell_ssp0_fixupfunction bdw_rt5650_hw_paramsfunction bdw_rt5650_fe_startupfunction bdw_rt5650_initfunction bdw_rt5650_probe
Annotated Snippet
struct bdw_rt5650_priv {
struct gpio_desc *gpio_hp_en;
struct snd_soc_component *component;
};
static const struct snd_soc_dapm_widget bdw_rt5650_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("DMIC Pair1", NULL),
SND_SOC_DAPM_MIC("DMIC Pair2", NULL),
};
static const struct snd_soc_dapm_route bdw_rt5650_map[] = {
/* Speakers */
{"Speaker", NULL, "SPOL"},
{"Speaker", NULL, "SPOR"},
/* Headset jack connectors */
{"Headphone", NULL, "HPOL"},
{"Headphone", NULL, "HPOR"},
{"IN1P", NULL, "Headset Mic"},
{"IN1N", NULL, "Headset Mic"},
/* Digital MICs
* DMIC Pair1 are the two DMICs connected on the DMICN1 connector.
* DMIC Pair2 are the two DMICs connected on the DMICN2 connector.
* Facing the camera, DMIC Pair1 are on the left side, DMIC Pair2
* are on the right side.
*/
{"DMIC L1", NULL, "DMIC Pair1"},
{"DMIC R1", NULL, "DMIC Pair1"},
{"DMIC L2", NULL, "DMIC Pair2"},
{"DMIC R2", NULL, "DMIC Pair2"},
/* CODEC BE connections */
{"SSP0 CODEC IN", NULL, "AIF1 Capture"},
{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
};
static const struct snd_kcontrol_new bdw_rt5650_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("DMIC Pair1"),
SOC_DAPM_PIN_SWITCH("DMIC Pair2"),
};
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 int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
struct snd_interval *rate = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_RATE);
struct snd_interval *chan = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS);
/* The ADSP will convert the FE rate to 48k, max 4-channels */
rate->min = rate->max = 48000;
chan->min = 2;
chan->max = 4;
/* set SSP0 to 24 bit */
snd_mask_set_format(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT),
SNDRV_PCM_FORMAT_S24_LE);
return 0;
}
static int bdw_rt5650_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
int ret;
/* Workaround: set codec PLL to 19.2MHz that PLL source is
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/platform_device.h`, `sound/core.h`, `sound/jack.h`, `sound/pcm.h`, `sound/pcm_params.h`.
- Detected declarations: `struct bdw_rt5650_priv`, `function broadwell_ssp0_fixup`, `function bdw_rt5650_hw_params`, `function bdw_rt5650_fe_startup`, `function bdw_rt5650_init`, `function bdw_rt5650_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.