sound/pci/echoaudio/echoaudio.h

Source file repositories/reference/linux-study-clean/sound/pci/echoaudio/echoaudio.h

File Facts

System
Linux kernel
Corpus path
sound/pci/echoaudio/echoaudio.h
Extension
.h
Size
17127 bytes
Lines
550
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct audiopipe {
	volatile __le32 *dma_counter;	/* Commpage register that contains
					 * the current dma position
					 * (lower 32 bits only)
					 */
	u32 last_period;                /* Counter position last time a
					 * period elapsed
					 */
	u32 last_counter;		/* Used exclusively by pcm_pointer
					 * under PCM core locks.
					 * The last position, which is used
					 * to compute...
					 */
	u32 position;			/* ...the number of bytes tranferred
					 * by the DMA engine, modulo the
					 * buffer size
					 */
	short index;			/* Index of the first channel or <0
					 * if hw is not configured yet
					 */
	short interleave;
	struct snd_dma_buffer sgpage;	/* Room for the scatter-gather list */
	struct snd_pcm_hardware hw;
	struct snd_pcm_hw_constraint_list constr;
	short sglist_head;
	char state;			/* pipe state */
};


struct audioformat {
	u8 interleave;			/* How the data is arranged in memory:
					 * mono = 1, stereo = 2, ...
					 */
	u8 bits_per_sample;		/* 8, 16, 24, 32 (24 bits left aligned) */
	char mono_to_stereo;		/* Only used if interleave is 1 and
					 * if this is an output pipe.
					 */
	char data_are_bigendian;	/* 1 = big endian, 0 = little endian */
};


struct echoaudio {
	spinlock_t lock;
	struct snd_pcm_substream *substream[DSP_MAXPIPES];
	struct mutex mode_mutex;
	u16 num_digital_modes, digital_mode_list[6];
	u16 num_clock_sources, clock_source_list[10];
	unsigned int opencount;  /* protected by mode_mutex */
	struct snd_kcontrol *clock_src_ctl;
	struct snd_pcm *analog_pcm, *digital_pcm;
	struct snd_card *card;
	const char *card_name;
	struct pci_dev *pci;
	unsigned long dsp_registers_phys;
	struct resource *iores;
	struct snd_dma_buffer *commpage_dma_buf;
	int irq;
#ifdef ECHOCARD_HAS_MIDI
	struct snd_rawmidi *rmidi;
	struct snd_rawmidi_substream *midi_in, *midi_out;
#endif
	struct timer_list timer;
	char tinuse;				/* Timer in use */
	char midi_full;				/* MIDI output buffer is full */
	char can_set_rate;                      /* protected by mode_mutex */
	char rate_set;                          /* protected by mode_mutex */

	/* This stuff is used mainly by the lowlevel code */
	struct comm_page *comm_page;	/* Virtual address of the memory
					 * seen by DSP
					 */
	u32 pipe_alloc_mask;		/* Bitmask of allocated pipes */
	u32 pipe_cyclic_mask;		/* Bitmask of pipes with cyclic
					 * buffers
					 */
	u32 sample_rate;		/* Card sample rate in Hz */
	u8 digital_mode;		/* Current digital mode
					 * (see DIGITAL_MODE_*)
					 */
	u8 spdif_status;		/* Gina20, Darla20, Darla24 - only */
	u8 clock_state;			/* Gina20, Darla20, Darla24 - only */
	u8 input_clock;			/* Currently selected sample clock
					 * source
					 */
	u8 output_clock;		/* Layla20 only */
	char meters_enabled;		/* VU-meters status */
	char asic_loaded;		/* Set true when ASIC loaded */
	char bad_board;			/* Set true if DSP won't load */
	char professional_spdif;	/* 0 = consumer; 1 = professional */
	char non_audio_spdif;		/* 3G - only */

Annotation

Implementation Notes