sound/pci/pcxhr/pcxhr.h
Source file repositories/reference/linux-study-clean/sound/pci/pcxhr/pcxhr.h
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/pcxhr/pcxhr.h- Extension
.h- Size
- 6344 bytes
- Lines
- 202
- 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/interrupt.hlinux/mutex.hsound/pcm.h
Detected Declarations
struct snd_pcxhrstruct pcxhr_mgrstruct pcxhr_streamstruct pcxhr_pipestruct pcxhr_mgrstruct pcxhr_streamstruct pcxhr_pipestruct snd_pcxhrstruct pcxhr_hostportenum pcxhr_clock_typeenum pcxhr_stream_statusenum pcxhr_pipe_status
Annotated Snippet
struct pcxhr_mgr {
unsigned int num_cards;
struct snd_pcxhr *chip[PCXHR_MAX_CARDS];
struct pci_dev *pci;
int irq;
int granularity;
/* card access with 1 mem bar and 2 io bar's */
unsigned long port[3];
/* share the name */
char name[40]; /* name of this soundcard */
struct pcxhr_rmh *prmh;
struct mutex lock; /* interrupt lock */
struct mutex msg_lock; /* message lock */
struct mutex setup_mutex; /* mutex used in hw_params, open and close */
struct mutex mixer_mutex; /* mutex for mixer */
/* hardware interface */
unsigned int dsp_loaded; /* bit flags of loaded dsp indices */
unsigned int dsp_version; /* read from embedded once firmware is loaded */
int playback_chips;
int capture_chips;
int fw_file_set;
int firmware_num;
unsigned int is_hr_stereo:1;
unsigned int board_has_aes1:1; /* if 1 board has AES1 plug and SRC */
unsigned int board_has_analog:1; /* if 0 the board is digital only */
unsigned int board_has_mic:1; /* if 1 the board has microphone input */
unsigned int board_aes_in_192k:1;/* if 1 the aes input plugs do support 192kHz */
unsigned int mono_capture:1; /* if 1 the board does mono capture */
unsigned int capture_ltc:1; /* if 1 the board captures LTC input */
struct snd_dma_buffer hostport;
enum pcxhr_clock_type use_clock_type; /* clock type selected by mixer */
enum pcxhr_clock_type cur_clock_type; /* current clock type synced */
int sample_rate;
int ref_count_rate;
int timer_toggle; /* timer interrupt toggles between the two values 0x200 and 0x300 */
int dsp_time_last; /* the last dsp time (read by interrupt) */
int dsp_time_err; /* dsp time errors */
unsigned int src_it_dsp; /* dsp interrupt source */
unsigned int io_num_reg_cont; /* backup of IO_NUM_REG_CONT */
unsigned int codec_speed; /* speed mode of the codecs */
unsigned int sample_rate_real; /* current real sample rate */
int last_reg_stat;
int async_err_stream_xrun;
int async_err_pipe_xrun;
int async_err_other_last;
unsigned char xlx_cfg; /* copy of PCXHR_XLX_CFG register */
unsigned char xlx_selmic; /* copy of PCXHR_XLX_SELMIC register */
unsigned char dsp_reset; /* copy of PCXHR_DSP_RESET register */
};
enum pcxhr_stream_status {
PCXHR_STREAM_STATUS_FREE,
PCXHR_STREAM_STATUS_OPEN,
PCXHR_STREAM_STATUS_SCHEDULE_RUN,
PCXHR_STREAM_STATUS_STARTED,
PCXHR_STREAM_STATUS_RUNNING,
PCXHR_STREAM_STATUS_SCHEDULE_STOP,
PCXHR_STREAM_STATUS_STOPPED,
PCXHR_STREAM_STATUS_PAUSED
};
struct pcxhr_stream {
struct snd_pcm_substream *substream;
snd_pcm_format_t format;
struct pcxhr_pipe *pipe;
enum pcxhr_stream_status status; /* free, open, running, draining, pause */
u_int64_t timer_abs_periods; /* timer: samples elapsed since TRIGGER_START (multiple of period_size) */
u_int32_t timer_period_frag; /* timer: samples elapsed since last call to snd_pcm_period_elapsed (0..period_size) */
u_int32_t timer_buf_periods; /* nb of periods in the buffer that have already elapsed */
int timer_is_synced; /* if(0) : timer needs to be resynced with real hardware pointer */
int channels;
};
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/mutex.h`, `sound/pcm.h`.
- Detected declarations: `struct snd_pcxhr`, `struct pcxhr_mgr`, `struct pcxhr_stream`, `struct pcxhr_pipe`, `struct pcxhr_mgr`, `struct pcxhr_stream`, `struct pcxhr_pipe`, `struct snd_pcxhr`, `struct pcxhr_hostport`, `enum pcxhr_clock_type`.
- 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.