sound/soc/intel/boards/bytcht_cx2072x.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/boards/bytcht_cx2072x.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/boards/bytcht_cx2072x.c- Extension
.c- Size
- 8399 bytes
- Lines
- 297
- 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/acpi.hlinux/device.hlinux/gpio/consumer.hlinux/module.hlinux/platform_device.hlinux/slab.hsound/pcm.hsound/pcm_params.hsound/jack.hsound/soc.hsound/soc-acpi.h../../codecs/cx2072x.h../atom/sst-atom-controls.h
Detected Declarations
function byt_cht_cx2072x_initfunction byt_cht_cx2072x_fixupfunction byt_cht_cx2072x_aif1_startupfunction snd_byt_cht_cx2072x_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
//
// ASoC DPCM Machine driver for Baytrail / Cherrytrail platforms with
// CX2072X codec
//
#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/jack.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "../../codecs/cx2072x.h"
#include "../atom/sst-atom-controls.h"
static const struct snd_soc_dapm_widget byt_cht_cx2072x_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("Int Mic", NULL),
SND_SOC_DAPM_SPK("Ext Spk", NULL),
};
static const struct snd_soc_dapm_route byt_cht_cx2072x_audio_map[] = {
/* External Speakers: HFL, HFR */
{"Headphone", NULL, "PORTA"},
{"Ext Spk", NULL, "PORTG"},
{"PORTC", NULL, "Int Mic"},
{"PORTD", NULL, "Headset Mic"},
{"Playback", NULL, "ssp2 Tx"},
{"ssp2 Tx", NULL, "codec_out0"},
{"ssp2 Tx", NULL, "codec_out1"},
{"codec_in0", NULL, "ssp2 Rx"},
{"codec_in1", NULL, "ssp2 Rx"},
{"ssp2 Rx", NULL, "Capture"},
};
static const struct snd_kcontrol_new byt_cht_cx2072x_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Int Mic"),
SOC_DAPM_PIN_SWITCH("Ext Spk"),
};
static struct snd_soc_jack byt_cht_cx2072x_headset;
/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin byt_cht_cx2072x_headset_pins[] = {
{
.pin = "Headset Mic",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Headphone",
.mask = SND_JACK_HEADPHONE,
},
};
static const struct acpi_gpio_params byt_cht_cx2072x_headset_gpios;
static const struct acpi_gpio_mapping byt_cht_cx2072x_acpi_gpios[] = {
{ "headset-gpios", &byt_cht_cx2072x_headset_gpios, 1 },
{},
};
static int byt_cht_cx2072x_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
struct snd_soc_component *codec = snd_soc_rtd_to_codec(rtd, 0)->component;
int ret;
if (devm_acpi_dev_add_driver_gpios(codec->dev,
byt_cht_cx2072x_acpi_gpios))
dev_warn(rtd->dev, "Unable to add GPIO mapping table\n");
snd_soc_dapm_set_idle_bias(dapm, false);
/* set the default PLL rate, the clock is handled by the codec driver */
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0), CX2072X_MCLK_EXTERNAL_PLL,
19200000, SND_SOC_CLOCK_IN);
if (ret) {
dev_err(rtd->dev, "Could not set sysclk\n");
return ret;
}
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/platform_device.h`, `linux/slab.h`, `sound/pcm.h`, `sound/pcm_params.h`.
- Detected declarations: `function byt_cht_cx2072x_init`, `function byt_cht_cx2072x_fixup`, `function byt_cht_cx2072x_aif1_startup`, `function snd_byt_cht_cx2072x_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.