sound/drivers/opl4/opl4_local.h

Source file repositories/reference/linux-study-clean/sound/drivers/opl4/opl4_local.h

File Facts

System
Linux kernel
Corpus path
sound/drivers/opl4/opl4_local.h
Extension
.h
Size
6994 bytes
Lines
236
Domain
Driver Families
Bucket
sound/drivers
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 opl4_sound {
	u16 tone;
	s16 pitch_offset;
	u8 key_scaling;
	s8 panpot;
	u8 vibrato;
	u8 tone_attenuate;
	u8 volume_factor;
	u8 reg_lfo_vibrato;
	u8 reg_attack_decay1;
	u8 reg_level_decay2;
	u8 reg_release_correction;
	u8 reg_tremolo;
};

struct opl4_region {
	u8 key_min, key_max;
	struct opl4_sound sound;
};

struct opl4_region_ptr {
	int count;
	const struct opl4_region *regions;
};

struct opl4_voice {
	struct list_head list;
	int number;
	struct snd_midi_channel *chan;
	int note;
	int velocity;
	const struct opl4_sound *sound;
	u8 level_direct;
	u8 reg_f_number;
	u8 reg_misc;
	u8 reg_lfo_vibrato;
};

struct snd_opl4 {
	unsigned long fm_port;
	unsigned long pcm_port;
	struct resource *res_fm_port;
	struct resource *res_pcm_port;
	unsigned short hardware;
	spinlock_t reg_lock;
	struct snd_card *card;

#ifdef CONFIG_SND_PROC_FS
	struct snd_info_entry *proc_entry;
	int memory_access;
#endif
	struct mutex access_mutex;

#if IS_ENABLED(CONFIG_SND_SEQUENCER)
	int used;

	int seq_dev_num;
	int seq_client;
	struct snd_seq_device *seq_dev;

	struct snd_midi_channel_set *chset;
	struct opl4_voice voices[OPL4_MAX_VOICES];
	struct list_head off_voices;
	struct list_head on_voices;
#endif
};

/* opl4_lib.c */
void snd_opl4_write(struct snd_opl4 *opl4, u8 reg, u8 value);
u8 snd_opl4_read(struct snd_opl4 *opl4, u8 reg);
void snd_opl4_read_memory(struct snd_opl4 *opl4, char *buf, int offset, int size);
void snd_opl4_write_memory(struct snd_opl4 *opl4, const char *buf, int offset, int size);

/* opl4_mixer.c */
int snd_opl4_create_mixer(struct snd_opl4 *opl4);

#ifdef CONFIG_SND_PROC_FS
/* opl4_proc.c */
int snd_opl4_create_proc(struct snd_opl4 *opl4);
void snd_opl4_free_proc(struct snd_opl4 *opl4);
#else
static inline int snd_opl4_create_proc(struct snd_opl4 *opl4) { return 0; }
static inline void snd_opl4_free_proc(struct snd_opl4 *opl4) {}
#endif

/* opl4_seq.c */
extern int volume_boost;

/* opl4_synth.c */
void snd_opl4_synth_reset(struct snd_opl4 *opl4);

Annotation

Implementation Notes