sound/pci/au88x0/au88x0_core.c
Source file repositories/reference/linux-study-clean/sound/pci/au88x0/au88x0_core.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/au88x0/au88x0_core.c- Extension
.c- Size
- 78851 bytes
- Lines
- 2863
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
au88x0.hau88x0_a3d.hlinux/delay.h
Detected Declarations
function vortex_mixer_en_srfunction vortex_mixer_dis_srfunction vortex_mix_muteinputgainfunction vortex_mix_getvolumefunction vortex_mix_getinputvolumefunction vortex_mix_boost6dbfunction vortex_mix_rampvolumefunction vortex_mix_getenablebitfunction vortex_mix_setvolumebytefunction vortex_mix_setinputvolumebytefunction vortex_mix_setenablebitfunction vortex_mix_killinputfunction vortex_mix_enableinputfunction vortex_mix_disableinputfunction vortex_mixer_addWTDfunction vortex_mixer_delWTDfunction vortex_mixer_initfunction vortex_src_en_srfunction vortex_src_dis_srfunction vortex_src_flushbuffersfunction vortex_src_cleardriftfunction vortex_src_set_throttlesourcefunction vortex_src_persist_convratiofunction vortex_src_slowlockfunction vortex_src_change_convratiofunction vortex_src_checkratiofunction vortex_src_setupchannelfunction vortex_srcblock_initfunction vortex_src_addWTDfunction vortex_src_delWTDfunction vortex_fifo_clearadbdatafunction vortex_fifo_adbinitializefunction vortex_fifo_setadbvalidfunction vortex_fifo_setadbctrlfunction vortex_fifo_clearwtdatafunction vortex_fifo_wtinitializefunction vortex_fifo_setwtvalidfunction vortex_fifo_setwtctrlfunction vortex_fifo_initfunction vortex_adbdma_initfunction vortex_adbdma_setstartbufferfunction vortex_adbdma_setbuffersfunction vortex_adbdma_setmodefunction vortex_adbdma_bufshiftfunction vortex_adbdma_resetupfunction vortex_adbdma_getlinearposfunction vortex_adbdma_startfifofunction vortex_adbdma_resumefifo
Annotated Snippet
if (a > -126) {
a -= 2;
hwwrite(vortex->mmio,
VORTEX_MIX_INVOL_A +
(((mix << 5) + ch) << 2), a);
hwwrite(vortex->mmio,
VORTEX_MIX_INVOL_B +
(((mix << 5) + ch) << 2), a);
} else
vortex_mix_killinput(vortex, mix, ch);
}
}
static int
vortex_mix_getenablebit(vortex_t * vortex, unsigned char mix, int mixin)
{
int addr, temp;
if (mixin >= 0)
addr = mixin;
else
addr = mixin + 3;
addr = ((mix << 3) + (addr >> 2)) << 2;
temp = hwread(vortex->mmio, VORTEX_MIX_ENIN + addr);
return ((temp >> (mixin & 3)) & 1);
}
#endif
static void
vortex_mix_setvolumebyte(vortex_t * vortex, unsigned char mix,
unsigned char vol)
{
int temp;
hwwrite(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2), vol);
if (1) { /*if (this_10) */
temp = hwread(vortex->mmio, VORTEX_MIX_VOL_B + (mix << 2));
if ((temp != 0x80) || (vol == 0x80))
return;
}
hwwrite(vortex->mmio, VORTEX_MIX_VOL_B + (mix << 2), vol);
}
static void
vortex_mix_setinputvolumebyte(vortex_t * vortex, unsigned char mix,
int mixin, unsigned char vol)
{
int temp;
hwwrite(vortex->mmio,
VORTEX_MIX_INVOL_A + (((mix << 5) + mixin) << 2), vol);
if (1) { /* this_10, initialized to 1. */
temp =
hwread(vortex->mmio,
VORTEX_MIX_INVOL_B + (((mix << 5) + mixin) << 2));
if ((temp != 0x80) || (vol == 0x80))
return;
}
hwwrite(vortex->mmio,
VORTEX_MIX_INVOL_B + (((mix << 5) + mixin) << 2), vol);
}
static void
vortex_mix_setenablebit(vortex_t * vortex, unsigned char mix, int mixin, int en)
{
int temp, addr;
if (mixin < 0)
addr = (mixin + 3);
else
addr = mixin;
addr = ((mix << 3) + (addr >> 2)) << 2;
temp = hwread(vortex->mmio, VORTEX_MIX_ENIN + addr);
if (en)
temp |= (1 << (mixin & 3));
else
temp &= ~(1 << (mixin & 3));
/* Mute input. Astatic void crackling? */
hwwrite(vortex->mmio,
VORTEX_MIX_INVOL_B + (((mix << 5) + mixin) << 2), 0x80);
/* Looks like clear buffer. */
hwwrite(vortex->mmio, VORTEX_MIX_SMP + (mixin << 2), 0x0);
hwwrite(vortex->mmio, VORTEX_MIX_SMP + 4 + (mixin << 2), 0x0);
/* Write enable bit. */
hwwrite(vortex->mmio, VORTEX_MIX_ENIN + addr, temp);
}
static void
vortex_mix_killinput(vortex_t * vortex, unsigned char mix, int mixin)
{
rampchs[mix] &= ~(1 << mixin);
vortex_mix_setinputvolumebyte(vortex, mix, mixin, 0x80);
mchannels[mix] &= ~(1 << mixin);
Annotation
- Immediate include surface: `au88x0.h`, `au88x0_a3d.h`, `linux/delay.h`.
- Detected declarations: `function vortex_mixer_en_sr`, `function vortex_mixer_dis_sr`, `function vortex_mix_muteinputgain`, `function vortex_mix_getvolume`, `function vortex_mix_getinputvolume`, `function vortex_mix_boost6db`, `function vortex_mix_rampvolume`, `function vortex_mix_getenablebit`, `function vortex_mix_setvolumebyte`, `function vortex_mix_setinputvolumebyte`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.