include/sound/vx_core.h
Source file repositories/reference/linux-study-clean/include/sound/vx_core.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/vx_core.h- Extension
.h- Size
- 15034 bytes
- Lines
- 536
- 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 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
sound/pcm.hsound/hwdep.hlinux/interrupt.h
Detected Declarations
struct firmwarestruct devicestruct vx_rmhstruct vx_ibl_infostruct vx_pipestruct vx_corestruct snd_vx_opsstruct snd_vx_hardwarestruct vx_corefunction vx_test_and_ackfunction vx_validate_irqfunction snd_vx_inbfunction snd_vx_inlfunction snd_vx_outbfunction snd_vx_outlfunction vx_reset_dspfunction vx_pseudo_dma_writefunction vx_pseudo_dma_read
Annotated Snippet
struct vx_rmh {
u16 LgCmd; /* length of the command to send (WORDs) */
u16 LgStat; /* length of the status received (WORDs) */
u32 Cmd[SIZE_MAX_CMD];
u32 Stat[SIZE_MAX_STATUS];
u16 DspStat; /* status type, RMP_SSIZE_XXX */
};
typedef u64 pcx_time_t;
#define VX_MAX_PIPES 16
#define VX_MAX_PERIODS 32
#define VX_MAX_CODECS 2
struct vx_ibl_info {
int size; /* the current IBL size (0 = query) in bytes */
int max_size; /* max. IBL size in bytes */
int min_size; /* min. IBL size in bytes */
int granularity; /* granularity */
};
struct vx_pipe {
int number;
unsigned int is_capture: 1;
unsigned int data_mode: 1;
unsigned int running: 1;
unsigned int prepared: 1;
int channels;
unsigned int differed_type;
pcx_time_t pcx_time;
struct snd_pcm_substream *substream;
int hbuf_size; /* H-buffer size in bytes */
int buffer_bytes; /* the ALSA pcm buffer size in bytes */
int period_bytes; /* the ALSA pcm period size in bytes */
int hw_ptr; /* the current hardware pointer in bytes */
int position; /* the current position in frames (playback only) */
int transferred; /* the transferred size (per period) in frames */
int align; /* size of alignment */
u64 cur_count; /* current sample position (for playback) */
unsigned int references; /* an output pipe may be used for monitoring and/or playback */
struct vx_pipe *monitoring_pipe; /* pointer to the monitoring pipe (capture pipe only)*/
};
struct vx_core;
struct snd_vx_ops {
/* low-level i/o */
unsigned char (*in8)(struct vx_core *chip, int reg);
unsigned int (*in32)(struct vx_core *chip, int reg);
void (*out8)(struct vx_core *chip, int reg, unsigned char val);
void (*out32)(struct vx_core *chip, int reg, unsigned int val);
/* irq */
int (*test_and_ack)(struct vx_core *chip);
void (*validate_irq)(struct vx_core *chip, int enable);
/* codec */
void (*write_codec)(struct vx_core *chip, int codec, unsigned int data);
void (*akm_write)(struct vx_core *chip, int reg, unsigned int data);
void (*reset_codec)(struct vx_core *chip);
void (*change_audio_source)(struct vx_core *chip, int src);
void (*set_clock_source)(struct vx_core *chp, int src);
/* chip init */
int (*load_dsp)(struct vx_core *chip, int idx, const struct firmware *fw);
void (*reset_dsp)(struct vx_core *chip);
void (*reset_board)(struct vx_core *chip, int cold_reset);
int (*add_controls)(struct vx_core *chip);
/* pcm */
void (*dma_write)(struct vx_core *chip, struct snd_pcm_runtime *runtime,
struct vx_pipe *pipe, int count);
void (*dma_read)(struct vx_core *chip, struct snd_pcm_runtime *runtime,
struct vx_pipe *pipe, int count);
};
struct snd_vx_hardware {
const char *name;
int type; /* VX_TYPE_XXX */
/* hardware specs */
unsigned int num_codecs;
unsigned int num_ins;
unsigned int num_outs;
unsigned int output_level_max;
const unsigned int *output_level_db_scale;
};
/* hwdep id string */
#define SND_VX_HWDEP_ID "VX Loader"
/* hardware type */
Annotation
- Immediate include surface: `sound/pcm.h`, `sound/hwdep.h`, `linux/interrupt.h`.
- Detected declarations: `struct firmware`, `struct device`, `struct vx_rmh`, `struct vx_ibl_info`, `struct vx_pipe`, `struct vx_core`, `struct snd_vx_ops`, `struct snd_vx_hardware`, `struct vx_core`, `function vx_test_and_ack`.
- Atlas domain: Driver Families / include/sound.
- 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.