include/sound/emu10k1.h
Source file repositories/reference/linux-study-clean/include/sound/emu10k1.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/emu10k1.h- Extension
.h- Size
- 96933 bytes
- Lines
- 1922
- Domain
- Driver Families
- Bucket
- include/sound
- 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 user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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.
- 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
sound/pcm.hsound/rawmidi.hsound/hwdep.hsound/ac97_codec.hsound/util_mem.hsound/pcm-indirect.hsound/timer.hlinux/interrupt.hlinux/mutex.hlinux/firmware.hlinux/io.huapi/sound/emu10k1.h
Detected Declarations
struct snd_emu10k1struct snd_emu10k1_voicestruct snd_emu10k1_pcmstruct snd_emu10k1_pcm_mixerstruct snd_emu10k1_memblkstruct snd_emu10k1_fx8010_ctlstruct snd_emu10k1_fx8010_irqstruct snd_emu10k1_fx8010_pcmstruct snd_emu10k1_fx8010struct snd_emu10k1_midistruct snd_emu_chip_detailsstruct snd_emu1010struct snd_emu10k1function snd_emu10k1_wc
Annotated Snippet
struct snd_emu10k1_voice {
unsigned char number;
unsigned char use;
unsigned char dirty;
unsigned char last;
void (*interrupt)(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
struct snd_emu10k1_pcm *epcm;
};
enum {
PLAYBACK_EMUVOICE,
PLAYBACK_EFX,
CAPTURE_AC97ADC,
CAPTURE_AC97MIC,
CAPTURE_EFX
};
struct snd_emu10k1_pcm {
struct snd_emu10k1 *emu;
int type;
struct snd_pcm_substream *substream;
struct snd_emu10k1_voice *voices[NUM_EFX_PLAYBACK];
struct snd_emu10k1_voice *extra;
unsigned short running;
unsigned short first_ptr;
snd_pcm_uframes_t resume_pos;
struct snd_util_memblk *memblk;
unsigned int pitch_target;
unsigned int start_addr;
unsigned int ccca_start_addr;
unsigned int capture_ipr; /* interrupt acknowledge mask */
unsigned int capture_inte; /* interrupt enable mask */
unsigned int capture_ba_reg; /* buffer address register */
unsigned int capture_bs_reg; /* buffer size register */
unsigned int capture_idx_reg; /* buffer index register */
unsigned int capture_cr_val; /* control value */
unsigned int capture_cr_val2; /* control value2 (for audigy) */
unsigned int capture_bs_val; /* buffer size value */
unsigned int capture_bufsize; /* buffer size in bytes */
};
struct snd_emu10k1_pcm_mixer {
/* mono, left, right x 8 sends (4 on emu10k1) */
unsigned char send_routing[3][8];
unsigned char send_volume[3][8];
// 0x8000 is neutral. The mixer code rescales it to 0xffff to maintain
// backwards compatibility with user space.
unsigned short attn[3];
struct snd_emu10k1_pcm *epcm;
};
#define snd_emu10k1_compose_send_routing(route) \
((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16)
#define snd_emu10k1_compose_audigy_fxrt1(route) \
((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 24) | 0x80808080)
#define snd_emu10k1_compose_audigy_fxrt2(route) \
((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24) | 0x80808080)
#define snd_emu10k1_compose_audigy_sendamounts(vol) \
(((unsigned int)vol[4] << 24) | ((unsigned int)vol[5] << 16) | ((unsigned int)vol[6] << 8) | (unsigned int)vol[7])
struct snd_emu10k1_memblk {
struct snd_util_memblk mem;
/* private part */
int first_page, last_page, pages, mapped_page;
unsigned int map_locked;
struct list_head mapped_link;
struct list_head mapped_order_link;
};
#define snd_emu10k1_memblk_offset(blk) (((blk)->mapped_page << PAGE_SHIFT) | ((blk)->mem.offset & (PAGE_SIZE - 1)))
#define EMU10K1_MAX_TRAM_BLOCKS_PER_CODE 16
struct snd_emu10k1_fx8010_ctl {
struct list_head list; /* list link container */
unsigned int vcount;
unsigned int count; /* count of GPR (1..16) */
unsigned short gpr[32]; /* GPR number(s) */
int value[32];
int min; /* minimum range */
int max; /* maximum range */
unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
struct snd_kcontrol *kcontrol;
};
typedef void (snd_fx8010_irq_handler_t)(struct snd_emu10k1 *emu, void *private_data);
Annotation
- Immediate include surface: `sound/pcm.h`, `sound/rawmidi.h`, `sound/hwdep.h`, `sound/ac97_codec.h`, `sound/util_mem.h`, `sound/pcm-indirect.h`, `sound/timer.h`, `linux/interrupt.h`.
- Detected declarations: `struct snd_emu10k1`, `struct snd_emu10k1_voice`, `struct snd_emu10k1_pcm`, `struct snd_emu10k1_pcm_mixer`, `struct snd_emu10k1_memblk`, `struct snd_emu10k1_fx8010_ctl`, `struct snd_emu10k1_fx8010_irq`, `struct snd_emu10k1_fx8010_pcm`, `struct snd_emu10k1_fx8010`, `struct snd_emu10k1_midi`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.