sound/soc/samsung/aries_wm8994.c
Source file repositories/reference/linux-study-clean/sound/soc/samsung/aries_wm8994.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/samsung/aries_wm8994.c- Extension
.c- Size
- 18074 bytes
- Lines
- 703
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/extcon.hlinux/gpio/consumer.hlinux/iio/consumer.hlinux/input-event-codes.hlinux/mfd/wm8994/registers.hlinux/module.hlinux/of.hlinux/regulator/consumer.hsound/jack.hsound/pcm_params.hsound/soc.hi2s.h../codecs/wm8994.h
Detected Declarations
struct aries_wm8994_variantstruct aries_wm8994_datafunction aries_extcon_notifierfunction headset_det_irq_threadfunction headset_button_checkfunction aries_spk_cfgfunction aries_main_biasfunction aries_headset_biasfunction aries_hw_paramsfunction aries_hw_freefunction aries_baseband_initfunction aries_late_probefunction aries_audio_probefunction for_each_card_prelinks
Annotated Snippet
struct aries_wm8994_variant {
unsigned int modem_dai_fmt;
bool has_fm_radio;
};
struct aries_wm8994_data {
struct extcon_dev *usb_extcon;
struct regulator *reg_main_micbias;
struct regulator *reg_headset_micbias;
struct gpio_desc *gpio_headset_detect;
struct gpio_desc *gpio_headset_key;
struct gpio_desc *gpio_earpath_sel;
struct iio_channel *adc;
const struct aries_wm8994_variant *variant;
};
/* USB dock */
static struct snd_soc_jack aries_dock;
static struct snd_soc_jack_pin dock_pins[] = {
{
.pin = "LINE",
.mask = SND_JACK_LINEOUT,
},
};
static int aries_extcon_notifier(struct notifier_block *this,
unsigned long connected, void *_cmd)
{
if (connected)
snd_soc_jack_report(&aries_dock, SND_JACK_LINEOUT,
SND_JACK_LINEOUT);
else
snd_soc_jack_report(&aries_dock, 0, SND_JACK_LINEOUT);
return NOTIFY_DONE;
}
static struct notifier_block aries_extcon_notifier_block = {
.notifier_call = aries_extcon_notifier,
};
/* Headset jack */
static struct snd_soc_jack aries_headset;
static struct snd_soc_jack_pin jack_pins[] = {
{
.pin = "HP",
.mask = SND_JACK_HEADPHONE,
}, {
.pin = "Headset Mic",
.mask = SND_JACK_MICROPHONE,
},
};
static struct snd_soc_jack_zone headset_zones[] = {
{
.min_mv = 0,
.max_mv = 241,
.jack_type = SND_JACK_HEADPHONE,
}, {
.min_mv = 242,
.max_mv = 2980,
.jack_type = SND_JACK_HEADSET,
}, {
.min_mv = 2981,
.max_mv = UINT_MAX,
.jack_type = SND_JACK_HEADPHONE,
},
};
static irqreturn_t headset_det_irq_thread(int irq, void *data)
{
struct aries_wm8994_data *priv = (struct aries_wm8994_data *) data;
int ret = 0;
int time_left_ms = 300;
int adc;
while (time_left_ms > 0) {
if (!gpiod_get_value(priv->gpio_headset_detect)) {
snd_soc_jack_report(&aries_headset, 0,
SND_JACK_HEADSET);
gpiod_set_value(priv->gpio_earpath_sel, 0);
return IRQ_HANDLED;
}
msleep(20);
time_left_ms -= 20;
}
/* Temporarily enable micbias and earpath selector */
Annotation
- Immediate include surface: `linux/extcon.h`, `linux/gpio/consumer.h`, `linux/iio/consumer.h`, `linux/input-event-codes.h`, `linux/mfd/wm8994/registers.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct aries_wm8994_variant`, `struct aries_wm8994_data`, `function aries_extcon_notifier`, `function headset_det_irq_thread`, `function headset_button_check`, `function aries_spk_cfg`, `function aries_main_bias`, `function aries_headset_bias`, `function aries_hw_params`, `function aries_hw_free`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.