sound/pci/oxygen/xonar_wm87x6.c
Source file repositories/reference/linux-study-clean/sound/pci/oxygen/xonar_wm87x6.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/oxygen/xonar_wm87x6.c- Extension
.c- Size
- 38448 bytes
- Lines
- 1323
- Domain
- Driver Families
- Bucket
- sound/pci
- 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/pci.hlinux/delay.hsound/control.hsound/core.hsound/info.hsound/jack.hsound/pcm.hsound/pcm_params.hsound/tlv.hxonar.hwm8776.hwm8766.h
Detected Declarations
struct xonar_wm87x6function wm8776_write_spifunction wm8776_write_i2cfunction wm8776_writefunction wm8776_write_cachedfunction wm8766_writefunction wm8766_write_cachedfunction wm8776_registers_initfunction wm8766_registers_initfunction wm8776_initfunction wm8766_initfunction xonar_ds_handle_hp_jackfunction xonar_ds_initfunction xonar_hdav_slim_initfunction xonar_ds_cleanupfunction xonar_hdav_slim_cleanupfunction xonar_ds_suspendfunction xonar_hdav_slim_suspendfunction xonar_ds_resumefunction xonar_hdav_slim_resumefunction wm8776_adc_hardware_filterfunction xonar_hdav_slim_hardware_filterfunction set_wm87x6_dac_paramsfunction set_hdav_slim_dac_paramsfunction update_wm8776_volumefunction update_wm87x6_volumefunction update_wm8776_mutefunction update_wm87x6_mutefunction update_wm8766_center_lfe_mixfunction xonar_ds_gpio_changedfunction wm8776_bit_switch_getfunction wm8776_bit_switch_putfunction wm8776_field_enum_infofunction wm8776_field_volume_infofunction wm8776_field_set_from_ctlfunction wm8776_field_setfunction wm8776_field_enum_getfunction wm8776_field_volume_getfunction wm8776_field_enum_putfunction wm8776_field_volume_putfunction wm8776_hp_vol_infofunction wm8776_hp_vol_getfunction wm8776_hp_vol_putfunction wm8776_input_mux_getfunction wm8776_input_mux_putfunction wm8776_input_vol_infofunction wm8776_input_vol_getfunction wm8776_input_vol_put
Annotated Snippet
struct xonar_wm87x6 {
struct xonar_generic generic;
u16 wm8776_regs[0x17];
u16 wm8766_regs[0x10];
struct snd_kcontrol *line_adcmux_control;
struct snd_kcontrol *mic_adcmux_control;
struct snd_kcontrol *lc_controls[13];
struct snd_jack *hp_jack;
struct xonar_hdmi hdmi;
};
static void wm8776_write_spi(struct oxygen *chip,
unsigned int reg, unsigned int value)
{
oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER |
OXYGEN_SPI_DATA_LENGTH_2 |
OXYGEN_SPI_CLOCK_160 |
(1 << OXYGEN_SPI_CODEC_SHIFT) |
OXYGEN_SPI_CEN_LATCH_CLOCK_LO,
(reg << 9) | value);
}
static void wm8776_write_i2c(struct oxygen *chip,
unsigned int reg, unsigned int value)
{
oxygen_write_i2c(chip, I2C_DEVICE_WM8776,
(reg << 1) | (value >> 8), value);
}
static void wm8776_write(struct oxygen *chip,
unsigned int reg, unsigned int value)
{
struct xonar_wm87x6 *data = chip->model_data;
if ((chip->model.function_flags & OXYGEN_FUNCTION_2WIRE_SPI_MASK) ==
OXYGEN_FUNCTION_SPI)
wm8776_write_spi(chip, reg, value);
else
wm8776_write_i2c(chip, reg, value);
if (reg < ARRAY_SIZE(data->wm8776_regs)) {
/* reg >= WM8776_HPLVOL is always true */
if (reg <= WM8776_DACMASTER)
value &= ~WM8776_UPDATE;
data->wm8776_regs[reg] = value;
}
}
static void wm8776_write_cached(struct oxygen *chip,
unsigned int reg, unsigned int value)
{
struct xonar_wm87x6 *data = chip->model_data;
if (reg >= ARRAY_SIZE(data->wm8776_regs) ||
value != data->wm8776_regs[reg])
wm8776_write(chip, reg, value);
}
static void wm8766_write(struct oxygen *chip,
unsigned int reg, unsigned int value)
{
struct xonar_wm87x6 *data = chip->model_data;
oxygen_write_spi(chip, OXYGEN_SPI_TRIGGER |
OXYGEN_SPI_DATA_LENGTH_2 |
OXYGEN_SPI_CLOCK_160 |
(0 << OXYGEN_SPI_CODEC_SHIFT) |
OXYGEN_SPI_CEN_LATCH_CLOCK_LO,
(reg << 9) | value);
if (reg < ARRAY_SIZE(data->wm8766_regs)) {
/* reg >= WM8766_LDA1 is always true */
if (reg <= WM8766_RDA1 ||
(reg >= WM8766_LDA2 && reg <= WM8766_MASTDA))
value &= ~WM8766_UPDATE;
data->wm8766_regs[reg] = value;
}
}
static void wm8766_write_cached(struct oxygen *chip,
unsigned int reg, unsigned int value)
{
struct xonar_wm87x6 *data = chip->model_data;
if (reg >= ARRAY_SIZE(data->wm8766_regs) ||
value != data->wm8766_regs[reg])
wm8766_write(chip, reg, value);
}
static void wm8776_registers_init(struct oxygen *chip)
{
struct xonar_wm87x6 *data = chip->model_data;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/delay.h`, `sound/control.h`, `sound/core.h`, `sound/info.h`, `sound/jack.h`, `sound/pcm.h`, `sound/pcm_params.h`.
- Detected declarations: `struct xonar_wm87x6`, `function wm8776_write_spi`, `function wm8776_write_i2c`, `function wm8776_write`, `function wm8776_write_cached`, `function wm8766_write`, `function wm8766_write_cached`, `function wm8776_registers_init`, `function wm8766_registers_init`, `function wm8776_init`.
- Atlas domain: Driver Families / sound/pci.
- 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.