Commit a42dd420 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: OPL4

Modules: OPL4

Remove xxx_t typedefs from the OPL4 driver
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5b1646a8
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
#include <sound/opl3.h> #include <sound/opl3.h>
typedef struct opl4 opl4_t; struct snd_opl4;
extern int snd_opl4_create(snd_card_t *card, extern int snd_opl4_create(struct snd_card *card,
unsigned long fm_port, unsigned long pcm_port, unsigned long fm_port, unsigned long pcm_port,
int seq_device, int seq_device,
opl3_t **opl3, opl4_t **opl4); struct snd_opl3 **opl3, struct snd_opl4 **opl4);
#endif /* __SOUND_OPL4_H */ #endif /* __SOUND_OPL4_H */
...@@ -27,14 +27,14 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); ...@@ -27,14 +27,14 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
MODULE_DESCRIPTION("OPL4 driver"); MODULE_DESCRIPTION("OPL4 driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static void inline snd_opl4_wait(opl4_t *opl4) static void inline snd_opl4_wait(struct snd_opl4 *opl4)
{ {
int timeout = 10; int timeout = 10;
while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0) while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0)
; ;
} }
void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value) void snd_opl4_write(struct snd_opl4 *opl4, u8 reg, u8 value)
{ {
snd_opl4_wait(opl4); snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port); outb(reg, opl4->pcm_port);
...@@ -43,7 +43,7 @@ void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value) ...@@ -43,7 +43,7 @@ void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value)
outb(value, opl4->pcm_port + 1); outb(value, opl4->pcm_port + 1);
} }
u8 snd_opl4_read(opl4_t *opl4, u8 reg) u8 snd_opl4_read(struct snd_opl4 *opl4, u8 reg)
{ {
snd_opl4_wait(opl4); snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port); outb(reg, opl4->pcm_port);
...@@ -52,7 +52,7 @@ u8 snd_opl4_read(opl4_t *opl4, u8 reg) ...@@ -52,7 +52,7 @@ u8 snd_opl4_read(opl4_t *opl4, u8 reg)
return inb(opl4->pcm_port + 1); return inb(opl4->pcm_port + 1);
} }
void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size) void snd_opl4_read_memory(struct snd_opl4 *opl4, char *buf, int offset, int size)
{ {
unsigned long flags; unsigned long flags;
u8 memcfg; u8 memcfg;
...@@ -76,7 +76,7 @@ void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size) ...@@ -76,7 +76,7 @@ void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size)
spin_unlock_irqrestore(&opl4->reg_lock, flags); spin_unlock_irqrestore(&opl4->reg_lock, flags);
} }
void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size) void snd_opl4_write_memory(struct snd_opl4 *opl4, const char *buf, int offset, int size)
{ {
unsigned long flags; unsigned long flags;
u8 memcfg; u8 memcfg;
...@@ -100,7 +100,7 @@ void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size) ...@@ -100,7 +100,7 @@ void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size)
spin_unlock_irqrestore(&opl4->reg_lock, flags); spin_unlock_irqrestore(&opl4->reg_lock, flags);
} }
static void snd_opl4_enable_opl4(opl4_t *opl4) static void snd_opl4_enable_opl4(struct snd_opl4 *opl4)
{ {
outb(OPL3_REG_MODE, opl4->fm_port + 2); outb(OPL3_REG_MODE, opl4->fm_port + 2);
inb(opl4->fm_port); inb(opl4->fm_port);
...@@ -110,7 +110,7 @@ static void snd_opl4_enable_opl4(opl4_t *opl4) ...@@ -110,7 +110,7 @@ static void snd_opl4_enable_opl4(opl4_t *opl4)
inb(opl4->fm_port); inb(opl4->fm_port);
} }
static int snd_opl4_detect(opl4_t *opl4) static int snd_opl4_detect(struct snd_opl4 *opl4)
{ {
u8 id1, id2; u8 id1, id2;
...@@ -144,19 +144,19 @@ static int snd_opl4_detect(opl4_t *opl4) ...@@ -144,19 +144,19 @@ static int snd_opl4_detect(opl4_t *opl4)
} }
#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) #if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
static void snd_opl4_seq_dev_free(snd_seq_device_t *seq_dev) static void snd_opl4_seq_dev_free(struct snd_seq_device *seq_dev)
{ {
opl4_t *opl4 = seq_dev->private_data; struct snd_opl4 *opl4 = seq_dev->private_data;
opl4->seq_dev = NULL; opl4->seq_dev = NULL;
} }
static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device) static int snd_opl4_create_seq_dev(struct snd_opl4 *opl4, int seq_device)
{ {
opl4->seq_dev_num = seq_device; opl4->seq_dev_num = seq_device;
if (snd_seq_device_new(opl4->card, seq_device, SNDRV_SEQ_DEV_ID_OPL4, if (snd_seq_device_new(opl4->card, seq_device, SNDRV_SEQ_DEV_ID_OPL4,
sizeof(opl4_t *), &opl4->seq_dev) >= 0) { sizeof(struct snd_opl4 *), &opl4->seq_dev) >= 0) {
strcpy(opl4->seq_dev->name, "OPL4 Wavetable"); strcpy(opl4->seq_dev->name, "OPL4 Wavetable");
*(opl4_t **)SNDRV_SEQ_DEVICE_ARGPTR(opl4->seq_dev) = opl4; *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(opl4->seq_dev) = opl4;
opl4->seq_dev->private_data = opl4; opl4->seq_dev->private_data = opl4;
opl4->seq_dev->private_free = snd_opl4_seq_dev_free; opl4->seq_dev->private_free = snd_opl4_seq_dev_free;
} }
...@@ -164,7 +164,7 @@ static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device) ...@@ -164,7 +164,7 @@ static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device)
} }
#endif #endif
static void snd_opl4_free(opl4_t *opl4) static void snd_opl4_free(struct snd_opl4 *opl4)
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
snd_opl4_free_proc(opl4); snd_opl4_free_proc(opl4);
...@@ -174,22 +174,22 @@ static void snd_opl4_free(opl4_t *opl4) ...@@ -174,22 +174,22 @@ static void snd_opl4_free(opl4_t *opl4)
kfree(opl4); kfree(opl4);
} }
static int snd_opl4_dev_free(snd_device_t *device) static int snd_opl4_dev_free(struct snd_device *device)
{ {
opl4_t *opl4 = device->device_data; struct snd_opl4 *opl4 = device->device_data;
snd_opl4_free(opl4); snd_opl4_free(opl4);
return 0; return 0;
} }
int snd_opl4_create(snd_card_t *card, int snd_opl4_create(struct snd_card *card,
unsigned long fm_port, unsigned long pcm_port, unsigned long fm_port, unsigned long pcm_port,
int seq_device, int seq_device,
opl3_t **ropl3, opl4_t **ropl4) struct snd_opl3 **ropl3, struct snd_opl4 **ropl4)
{ {
opl4_t *opl4; struct snd_opl4 *opl4;
opl3_t *opl3; struct snd_opl3 *opl3;
int err; int err;
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_opl4_dev_free .dev_free = snd_opl4_dev_free
}; };
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
#define SNDRV_SEQ_DEV_ID_OPL4 "opl4-synth" #define SNDRV_SEQ_DEV_ID_OPL4 "opl4-synth"
typedef struct opl4_sound { struct opl4_sound {
u16 tone; u16 tone;
s16 pitch_offset; s16 pitch_offset;
u8 key_scaling; u8 key_scaling;
...@@ -144,42 +144,42 @@ typedef struct opl4_sound { ...@@ -144,42 +144,42 @@ typedef struct opl4_sound {
u8 reg_level_decay2; u8 reg_level_decay2;
u8 reg_release_correction; u8 reg_release_correction;
u8 reg_tremolo; u8 reg_tremolo;
} opl4_sound_t; };
typedef struct opl4_region { struct opl4_region {
u8 key_min, key_max; u8 key_min, key_max;
opl4_sound_t sound; struct opl4_sound sound;
} opl4_region_t; };
typedef struct opl4_region_ptr { struct opl4_region_ptr {
int count; int count;
const opl4_region_t *regions; const struct opl4_region *regions;
} opl4_region_ptr_t; };
typedef struct opl4_voice { struct opl4_voice {
struct list_head list; struct list_head list;
int number; int number;
snd_midi_channel_t *chan; struct snd_midi_channel *chan;
int note; int note;
int velocity; int velocity;
const opl4_sound_t *sound; const struct opl4_sound *sound;
u8 level_direct; u8 level_direct;
u8 reg_f_number; u8 reg_f_number;
u8 reg_misc; u8 reg_misc;
u8 reg_lfo_vibrato; u8 reg_lfo_vibrato;
} opl4_voice_t; };
struct opl4 { struct snd_opl4 {
unsigned long fm_port; unsigned long fm_port;
unsigned long pcm_port; unsigned long pcm_port;
struct resource *res_fm_port; struct resource *res_fm_port;
struct resource *res_pcm_port; struct resource *res_pcm_port;
unsigned short hardware; unsigned short hardware;
spinlock_t reg_lock; spinlock_t reg_lock;
snd_card_t *card; struct snd_card *card;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
snd_info_entry_t *proc_entry; struct snd_info_entry *proc_entry;
int memory_access; int memory_access;
#endif #endif
struct semaphore access_mutex; struct semaphore access_mutex;
...@@ -189,44 +189,44 @@ struct opl4 { ...@@ -189,44 +189,44 @@ struct opl4 {
int seq_dev_num; int seq_dev_num;
int seq_client; int seq_client;
snd_seq_device_t *seq_dev; struct snd_seq_device *seq_dev;
snd_midi_channel_set_t *chset; struct snd_midi_channel_set *chset;
opl4_voice_t voices[OPL4_MAX_VOICES]; struct opl4_voice voices[OPL4_MAX_VOICES];
struct list_head off_voices; struct list_head off_voices;
struct list_head on_voices; struct list_head on_voices;
#endif #endif
}; };
/* opl4_lib.c */ /* opl4_lib.c */
void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value); void snd_opl4_write(struct snd_opl4 *opl4, u8 reg, u8 value);
u8 snd_opl4_read(opl4_t *opl4, u8 reg); u8 snd_opl4_read(struct snd_opl4 *opl4, u8 reg);
void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size); void snd_opl4_read_memory(struct snd_opl4 *opl4, char *buf, int offset, int size);
void snd_opl4_write_memory(opl4_t *opl4, const 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 */ /* opl4_mixer.c */
int snd_opl4_create_mixer(opl4_t *opl4); int snd_opl4_create_mixer(struct snd_opl4 *opl4);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
/* opl4_proc.c */ /* opl4_proc.c */
int snd_opl4_create_proc(opl4_t *opl4); int snd_opl4_create_proc(struct snd_opl4 *opl4);
void snd_opl4_free_proc(opl4_t *opl4); void snd_opl4_free_proc(struct snd_opl4 *opl4);
#endif #endif
/* opl4_seq.c */ /* opl4_seq.c */
extern int volume_boost; extern int volume_boost;
/* opl4_synth.c */ /* opl4_synth.c */
void snd_opl4_synth_reset(opl4_t *opl4); void snd_opl4_synth_reset(struct snd_opl4 *opl4);
void snd_opl4_synth_shutdown(opl4_t *opl4); void snd_opl4_synth_shutdown(struct snd_opl4 *opl4);
void snd_opl4_note_on(void *p, int note, int vel, snd_midi_channel_t *chan); void snd_opl4_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
void snd_opl4_note_off(void *p, int note, int vel, snd_midi_channel_t *chan); void snd_opl4_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
void snd_opl4_terminate_note(void *p, int note, snd_midi_channel_t *chan); void snd_opl4_terminate_note(void *p, int note, struct snd_midi_channel *chan);
void snd_opl4_control(void *p, int type, snd_midi_channel_t *chan); void snd_opl4_control(void *p, int type, struct snd_midi_channel *chan);
void snd_opl4_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); void snd_opl4_sysex(void *p, unsigned char *buf, int len, int parsed, struct snd_midi_channel_set *chset);
/* yrw801.c */ /* yrw801.c */
int snd_yrw801_detect(opl4_t *opl4); int snd_yrw801_detect(struct snd_opl4 *opl4);
extern const opl4_region_ptr_t snd_yrw801_regions[]; extern const struct opl4_region_ptr snd_yrw801_regions[];
#endif /* __OPL4_LOCAL_H */ #endif /* __OPL4_LOCAL_H */
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "opl4_local.h" #include "opl4_local.h"
#include <sound/control.h> #include <sound/control.h>
static int snd_opl4_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int snd_opl4_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
...@@ -29,9 +29,9 @@ static int snd_opl4_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf ...@@ -29,9 +29,9 @@ static int snd_opl4_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
return 0; return 0;
} }
static int snd_opl4_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_opl4_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
opl4_t *opl4 = snd_kcontrol_chip(kcontrol); struct snd_opl4 *opl4 = snd_kcontrol_chip(kcontrol);
unsigned long flags; unsigned long flags;
u8 reg = kcontrol->private_value; u8 reg = kcontrol->private_value;
u8 value; u8 value;
...@@ -44,9 +44,9 @@ static int snd_opl4_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon ...@@ -44,9 +44,9 @@ static int snd_opl4_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon
return 0; return 0;
} }
static int snd_opl4_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_opl4_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
opl4_t *opl4 = snd_kcontrol_chip(kcontrol); struct snd_opl4 *opl4 = snd_kcontrol_chip(kcontrol);
unsigned long flags; unsigned long flags;
u8 reg = kcontrol->private_value; u8 reg = kcontrol->private_value;
u8 value, old_value; u8 value, old_value;
...@@ -60,7 +60,7 @@ static int snd_opl4_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon ...@@ -60,7 +60,7 @@ static int snd_opl4_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon
return value != old_value; return value != old_value;
} }
static snd_kcontrol_new_t snd_opl4_controls[] = { static struct snd_kcontrol_new snd_opl4_controls[] = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "FM Playback Volume", .name = "FM Playback Volume",
...@@ -79,9 +79,9 @@ static snd_kcontrol_new_t snd_opl4_controls[] = { ...@@ -79,9 +79,9 @@ static snd_kcontrol_new_t snd_opl4_controls[] = {
} }
}; };
int snd_opl4_create_mixer(opl4_t *opl4) int snd_opl4_create_mixer(struct snd_opl4 *opl4)
{ {
snd_card_t *card = opl4->card; struct snd_card *card = opl4->card;
int i, err; int i, err;
strcat(card->mixername, ",OPL4"); strcat(card->mixername, ",OPL4");
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static int snd_opl4_mem_proc_open(snd_info_entry_t *entry, static int snd_opl4_mem_proc_open(struct snd_info_entry *entry,
unsigned short mode, void **file_private_data) unsigned short mode, void **file_private_data)
{ {
opl4_t *opl4 = entry->private_data; struct snd_opl4 *opl4 = entry->private_data;
down(&opl4->access_mutex); down(&opl4->access_mutex);
if (opl4->memory_access) { if (opl4->memory_access) {
...@@ -38,10 +38,10 @@ static int snd_opl4_mem_proc_open(snd_info_entry_t *entry, ...@@ -38,10 +38,10 @@ static int snd_opl4_mem_proc_open(snd_info_entry_t *entry,
return 0; return 0;
} }
static int snd_opl4_mem_proc_release(snd_info_entry_t *entry, static int snd_opl4_mem_proc_release(struct snd_info_entry *entry,
unsigned short mode, void *file_private_data) unsigned short mode, void *file_private_data)
{ {
opl4_t *opl4 = entry->private_data; struct snd_opl4 *opl4 = entry->private_data;
down(&opl4->access_mutex); down(&opl4->access_mutex);
opl4->memory_access--; opl4->memory_access--;
...@@ -49,11 +49,11 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry, ...@@ -49,11 +49,11 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry,
return 0; return 0;
} }
static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_data, static long snd_opl4_mem_proc_read(struct snd_info_entry *entry, void *file_private_data,
struct file *file, char __user *_buf, struct file *file, char __user *_buf,
unsigned long count, unsigned long pos) unsigned long count, unsigned long pos)
{ {
opl4_t *opl4 = entry->private_data; struct snd_opl4 *opl4 = entry->private_data;
long size; long size;
char* buf; char* buf;
...@@ -75,11 +75,11 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d ...@@ -75,11 +75,11 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d
return 0; return 0;
} }
static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_data, static long snd_opl4_mem_proc_write(struct snd_info_entry *entry, void *file_private_data,
struct file *file, const char __user *_buf, struct file *file, const char __user *_buf,
unsigned long count, unsigned long pos) unsigned long count, unsigned long pos)
{ {
opl4_t *opl4 = entry->private_data; struct snd_opl4 *opl4 = entry->private_data;
long size; long size;
char *buf; char *buf;
...@@ -101,7 +101,7 @@ static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_ ...@@ -101,7 +101,7 @@ static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_
return 0; return 0;
} }
static long long snd_opl4_mem_proc_llseek(snd_info_entry_t *entry, void *file_private_data, static long long snd_opl4_mem_proc_llseek(struct snd_info_entry *entry, void *file_private_data,
struct file *file, long long offset, int orig) struct file *file, long long offset, int orig)
{ {
switch (orig) { switch (orig) {
...@@ -130,9 +130,9 @@ static struct snd_info_entry_ops snd_opl4_mem_proc_ops = { ...@@ -130,9 +130,9 @@ static struct snd_info_entry_ops snd_opl4_mem_proc_ops = {
.llseek = snd_opl4_mem_proc_llseek, .llseek = snd_opl4_mem_proc_llseek,
}; };
int snd_opl4_create_proc(opl4_t *opl4) int snd_opl4_create_proc(struct snd_opl4 *opl4)
{ {
snd_info_entry_t *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(opl4->card, "opl4-mem", opl4->card->proc_root); entry = snd_info_create_card_entry(opl4->card, "opl4-mem", opl4->card->proc_root);
if (entry) { if (entry) {
...@@ -157,7 +157,7 @@ int snd_opl4_create_proc(opl4_t *opl4) ...@@ -157,7 +157,7 @@ int snd_opl4_create_proc(opl4_t *opl4)
return 0; return 0;
} }
void snd_opl4_free_proc(opl4_t *opl4) void snd_opl4_free_proc(struct snd_opl4 *opl4)
{ {
if (opl4->proc_entry) if (opl4->proc_entry)
snd_info_unregister(opl4->proc_entry); snd_info_unregister(opl4->proc_entry);
......
...@@ -45,21 +45,21 @@ int volume_boost = 8; ...@@ -45,21 +45,21 @@ int volume_boost = 8;
module_param(volume_boost, int, 0644); module_param(volume_boost, int, 0644);
MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds."); MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds.");
static int snd_opl4_seq_use_inc(opl4_t *opl4) static int snd_opl4_seq_use_inc(struct snd_opl4 *opl4)
{ {
if (!try_module_get(opl4->card->module)) if (!try_module_get(opl4->card->module))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
static void snd_opl4_seq_use_dec(opl4_t *opl4) static void snd_opl4_seq_use_dec(struct snd_opl4 *opl4)
{ {
module_put(opl4->card->module); module_put(opl4->card->module);
} }
static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info) static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *info)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
int err; int err;
down(&opl4->access_mutex); down(&opl4->access_mutex);
...@@ -84,9 +84,9 @@ static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info) ...@@ -84,9 +84,9 @@ static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info)
return 0; return 0;
} }
static int snd_opl4_seq_unuse(void *private_data, snd_seq_port_subscribe_t *info) static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribe *info)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
snd_opl4_synth_shutdown(opl4); snd_opl4_synth_shutdown(opl4);
...@@ -99,7 +99,7 @@ static int snd_opl4_seq_unuse(void *private_data, snd_seq_port_subscribe_t *info ...@@ -99,7 +99,7 @@ static int snd_opl4_seq_unuse(void *private_data, snd_seq_port_subscribe_t *info
return 0; return 0;
} }
static snd_midi_op_t opl4_ops = { static struct snd_midi_op opl4_ops = {
.note_on = snd_opl4_note_on, .note_on = snd_opl4_note_on,
.note_off = snd_opl4_note_off, .note_off = snd_opl4_note_off,
.note_terminate = snd_opl4_terminate_note, .note_terminate = snd_opl4_terminate_note,
...@@ -107,10 +107,10 @@ static snd_midi_op_t opl4_ops = { ...@@ -107,10 +107,10 @@ static snd_midi_op_t opl4_ops = {
.sysex = snd_opl4_sysex, .sysex = snd_opl4_sysex,
}; };
static int snd_opl4_seq_event_input(snd_seq_event_t *ev, int direct, static int snd_opl4_seq_event_input(struct snd_seq_event *ev, int direct,
void *private_data, int atomic, int hop) void *private_data, int atomic, int hop)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
snd_midi_process_event(&opl4_ops, ev, opl4->chset); snd_midi_process_event(&opl4_ops, ev, opl4->chset);
return 0; return 0;
...@@ -118,20 +118,20 @@ static int snd_opl4_seq_event_input(snd_seq_event_t *ev, int direct, ...@@ -118,20 +118,20 @@ static int snd_opl4_seq_event_input(snd_seq_event_t *ev, int direct,
static void snd_opl4_seq_free_port(void *private_data) static void snd_opl4_seq_free_port(void *private_data)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
snd_midi_channel_free_set(opl4->chset); snd_midi_channel_free_set(opl4->chset);
} }
static int snd_opl4_seq_new_device(snd_seq_device_t *dev) static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
{ {
opl4_t *opl4; struct snd_opl4 *opl4;
int client; int client;
snd_seq_client_callback_t callbacks; struct snd_seq_client_callback callbacks;
snd_seq_client_info_t cinfo; struct snd_seq_client_info cinfo;
snd_seq_port_callback_t pcallbacks; struct snd_seq_port_callback pcallbacks;
opl4 = *(opl4_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (!opl4) if (!opl4)
return -EINVAL; return -EINVAL;
...@@ -188,11 +188,11 @@ static int snd_opl4_seq_new_device(snd_seq_device_t *dev) ...@@ -188,11 +188,11 @@ static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
return 0; return 0;
} }
static int snd_opl4_seq_delete_device(snd_seq_device_t *dev) static int snd_opl4_seq_delete_device(struct snd_seq_device *dev)
{ {
opl4_t *opl4; struct snd_opl4 *opl4;
opl4 = *(opl4_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (!opl4) if (!opl4)
return -EINVAL; return -EINVAL;
...@@ -205,13 +205,13 @@ static int snd_opl4_seq_delete_device(snd_seq_device_t *dev) ...@@ -205,13 +205,13 @@ static int snd_opl4_seq_delete_device(snd_seq_device_t *dev)
static int __init alsa_opl4_synth_init(void) static int __init alsa_opl4_synth_init(void)
{ {
static snd_seq_dev_ops_t ops = { static struct snd_seq_dev_ops ops = {
snd_opl4_seq_new_device, snd_opl4_seq_new_device,
snd_opl4_seq_delete_device snd_opl4_seq_delete_device
}; };
return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL4, &ops, return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL4, &ops,
sizeof(opl4_t*)); sizeof(struct snd_opl4 *));
} }
static void __exit alsa_opl4_synth_exit(void) static void __exit alsa_opl4_synth_exit(void)
......
...@@ -270,7 +270,7 @@ static unsigned char snd_opl4_volume_table[128] = { ...@@ -270,7 +270,7 @@ static unsigned char snd_opl4_volume_table[128] = {
/* /*
* Initializes all voices. * Initializes all voices.
*/ */
void snd_opl4_synth_reset(opl4_t *opl4) void snd_opl4_synth_reset(struct snd_opl4 *opl4)
{ {
unsigned long flags; unsigned long flags;
int i; int i;
...@@ -294,7 +294,7 @@ void snd_opl4_synth_reset(opl4_t *opl4) ...@@ -294,7 +294,7 @@ void snd_opl4_synth_reset(opl4_t *opl4)
/* /*
* Shuts down all voices. * Shuts down all voices.
*/ */
void snd_opl4_synth_shutdown(opl4_t *opl4) void snd_opl4_synth_shutdown(struct snd_opl4 *opl4)
{ {
unsigned long flags; unsigned long flags;
int i; int i;
...@@ -309,12 +309,12 @@ void snd_opl4_synth_shutdown(opl4_t *opl4) ...@@ -309,12 +309,12 @@ void snd_opl4_synth_shutdown(opl4_t *opl4)
/* /*
* Executes the callback for all voices playing the specified note. * Executes the callback for all voices playing the specified note.
*/ */
static void snd_opl4_do_for_note(opl4_t *opl4, int note, snd_midi_channel_t *chan, static void snd_opl4_do_for_note(struct snd_opl4 *opl4, int note, struct snd_midi_channel *chan,
void (*func)(opl4_t *opl4, opl4_voice_t *voice)) void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
{ {
int i; int i;
unsigned long flags; unsigned long flags;
opl4_voice_t *voice; struct opl4_voice *voice;
spin_lock_irqsave(&opl4->reg_lock, flags); spin_lock_irqsave(&opl4->reg_lock, flags);
for (i = 0; i < OPL4_MAX_VOICES; i++) { for (i = 0; i < OPL4_MAX_VOICES; i++) {
...@@ -329,12 +329,13 @@ static void snd_opl4_do_for_note(opl4_t *opl4, int note, snd_midi_channel_t *cha ...@@ -329,12 +329,13 @@ static void snd_opl4_do_for_note(opl4_t *opl4, int note, snd_midi_channel_t *cha
/* /*
* Executes the callback for all voices of to the specified channel. * Executes the callback for all voices of to the specified channel.
*/ */
static void snd_opl4_do_for_channel(opl4_t *opl4, snd_midi_channel_t *chan, static void snd_opl4_do_for_channel(struct snd_opl4 *opl4,
void (*func)(opl4_t *opl4, opl4_voice_t *voice)) struct snd_midi_channel *chan,
void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
{ {
int i; int i;
unsigned long flags; unsigned long flags;
opl4_voice_t *voice; struct opl4_voice *voice;
spin_lock_irqsave(&opl4->reg_lock, flags); spin_lock_irqsave(&opl4->reg_lock, flags);
for (i = 0; i < OPL4_MAX_VOICES; i++) { for (i = 0; i < OPL4_MAX_VOICES; i++) {
...@@ -349,12 +350,12 @@ static void snd_opl4_do_for_channel(opl4_t *opl4, snd_midi_channel_t *chan, ...@@ -349,12 +350,12 @@ static void snd_opl4_do_for_channel(opl4_t *opl4, snd_midi_channel_t *chan,
/* /*
* Executes the callback for all active voices. * Executes the callback for all active voices.
*/ */
static void snd_opl4_do_for_all(opl4_t *opl4, static void snd_opl4_do_for_all(struct snd_opl4 *opl4,
void (*func)(opl4_t *opl4, opl4_voice_t *voice)) void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
{ {
int i; int i;
unsigned long flags; unsigned long flags;
opl4_voice_t *voice; struct opl4_voice *voice;
spin_lock_irqsave(&opl4->reg_lock, flags); spin_lock_irqsave(&opl4->reg_lock, flags);
for (i = 0; i < OPL4_MAX_VOICES; i++) { for (i = 0; i < OPL4_MAX_VOICES; i++) {
...@@ -365,7 +366,7 @@ static void snd_opl4_do_for_all(opl4_t *opl4, ...@@ -365,7 +366,7 @@ static void snd_opl4_do_for_all(opl4_t *opl4,
spin_unlock_irqrestore(&opl4->reg_lock, flags); spin_unlock_irqrestore(&opl4->reg_lock, flags);
} }
static void snd_opl4_update_volume(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_update_volume(struct snd_opl4 *opl4, struct opl4_voice *voice)
{ {
int att; int att;
...@@ -384,7 +385,7 @@ static void snd_opl4_update_volume(opl4_t *opl4, opl4_voice_t *voice) ...@@ -384,7 +385,7 @@ static void snd_opl4_update_volume(opl4_t *opl4, opl4_voice_t *voice)
voice->level_direct = 0; voice->level_direct = 0;
} }
static void snd_opl4_update_pan(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_update_pan(struct snd_opl4 *opl4, struct opl4_voice *voice)
{ {
int pan = voice->sound->panpot; int pan = voice->sound->panpot;
...@@ -399,7 +400,8 @@ static void snd_opl4_update_pan(opl4_t *opl4, opl4_voice_t *voice) ...@@ -399,7 +400,8 @@ static void snd_opl4_update_pan(opl4_t *opl4, opl4_voice_t *voice)
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc); snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
} }
static void snd_opl4_update_vibrato_depth(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_update_vibrato_depth(struct snd_opl4 *opl4,
struct opl4_voice *voice)
{ {
int depth; int depth;
...@@ -414,9 +416,10 @@ static void snd_opl4_update_vibrato_depth(opl4_t *opl4, opl4_voice_t *voice) ...@@ -414,9 +416,10 @@ static void snd_opl4_update_vibrato_depth(opl4_t *opl4, opl4_voice_t *voice)
voice->reg_lfo_vibrato); voice->reg_lfo_vibrato);
} }
static void snd_opl4_update_pitch(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_update_pitch(struct snd_opl4 *opl4,
struct opl4_voice *voice)
{ {
snd_midi_channel_t *chan = voice->chan; struct snd_midi_channel *chan = voice->chan;
int note, pitch, octave; int note, pitch, octave;
note = chan->drum_channel ? 60 : voice->note; note = chan->drum_channel ? 60 : voice->note;
...@@ -444,7 +447,8 @@ static void snd_opl4_update_pitch(opl4_t *opl4, opl4_voice_t *voice) ...@@ -444,7 +447,8 @@ static void snd_opl4_update_pitch(opl4_t *opl4, opl4_voice_t *voice)
snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice->number, voice->reg_f_number); snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice->number, voice->reg_f_number);
} }
static void snd_opl4_update_tone_parameters(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_update_tone_parameters(struct snd_opl4 *opl4,
struct opl4_voice *voice)
{ {
snd_opl4_write(opl4, OPL4_REG_ATTACK_DECAY1 + voice->number, snd_opl4_write(opl4, OPL4_REG_ATTACK_DECAY1 + voice->number,
voice->sound->reg_attack_decay1); voice->sound->reg_attack_decay1);
...@@ -457,17 +461,17 @@ static void snd_opl4_update_tone_parameters(opl4_t *opl4, opl4_voice_t *voice) ...@@ -457,17 +461,17 @@ static void snd_opl4_update_tone_parameters(opl4_t *opl4, opl4_voice_t *voice)
} }
/* allocate one voice */ /* allocate one voice */
static opl4_voice_t *snd_opl4_get_voice(opl4_t *opl4) static struct opl4_voice *snd_opl4_get_voice(struct snd_opl4 *opl4)
{ {
/* first, try to get the oldest key-off voice */ /* first, try to get the oldest key-off voice */
if (!list_empty(&opl4->off_voices)) if (!list_empty(&opl4->off_voices))
return list_entry(opl4->off_voices.next, opl4_voice_t, list); return list_entry(opl4->off_voices.next, struct opl4_voice, list);
/* then get the oldest key-on voice */ /* then get the oldest key-on voice */
snd_assert(!list_empty(&opl4->on_voices), ); snd_assert(!list_empty(&opl4->on_voices), );
return list_entry(opl4->on_voices.next, opl4_voice_t, list); return list_entry(opl4->on_voices.next, struct opl4_voice, list);
} }
static void snd_opl4_wait_for_wave_headers(opl4_t *opl4) static void snd_opl4_wait_for_wave_headers(struct snd_opl4 *opl4)
{ {
int timeout = 200; int timeout = 200;
...@@ -475,12 +479,12 @@ static void snd_opl4_wait_for_wave_headers(opl4_t *opl4) ...@@ -475,12 +479,12 @@ static void snd_opl4_wait_for_wave_headers(opl4_t *opl4)
udelay(10); udelay(10);
} }
void snd_opl4_note_on(void *private_data, int note, int vel, snd_midi_channel_t *chan) void snd_opl4_note_on(void *private_data, int note, int vel, struct snd_midi_channel *chan)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
const opl4_region_ptr_t *regions; const struct opl4_region_ptr *regions;
opl4_voice_t *voice[2]; struct opl4_voice *voice[2];
const opl4_sound_t *sound[2]; const struct opl4_sound *sound[2];
int voices = 0, i; int voices = 0, i;
unsigned long flags; unsigned long flags;
...@@ -549,7 +553,7 @@ void snd_opl4_note_on(void *private_data, int note, int vel, snd_midi_channel_t ...@@ -549,7 +553,7 @@ void snd_opl4_note_on(void *private_data, int note, int vel, snd_midi_channel_t
spin_unlock_irqrestore(&opl4->reg_lock, flags); spin_unlock_irqrestore(&opl4->reg_lock, flags);
} }
static void snd_opl4_voice_off(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_voice_off(struct snd_opl4 *opl4, struct opl4_voice *voice)
{ {
list_del(&voice->list); list_del(&voice->list);
list_add_tail(&voice->list, &opl4->off_voices); list_add_tail(&voice->list, &opl4->off_voices);
...@@ -558,14 +562,14 @@ static void snd_opl4_voice_off(opl4_t *opl4, opl4_voice_t *voice) ...@@ -558,14 +562,14 @@ static void snd_opl4_voice_off(opl4_t *opl4, opl4_voice_t *voice)
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc); snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
} }
void snd_opl4_note_off(void *private_data, int note, int vel, snd_midi_channel_t *chan) void snd_opl4_note_off(void *private_data, int note, int vel, struct snd_midi_channel *chan)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
snd_opl4_do_for_note(opl4, note, chan, snd_opl4_voice_off); snd_opl4_do_for_note(opl4, note, chan, snd_opl4_voice_off);
} }
static void snd_opl4_terminate_voice(opl4_t *opl4, opl4_voice_t *voice) static void snd_opl4_terminate_voice(struct snd_opl4 *opl4, struct opl4_voice *voice)
{ {
list_del(&voice->list); list_del(&voice->list);
list_add_tail(&voice->list, &opl4->off_voices); list_add_tail(&voice->list, &opl4->off_voices);
...@@ -574,16 +578,16 @@ static void snd_opl4_terminate_voice(opl4_t *opl4, opl4_voice_t *voice) ...@@ -574,16 +578,16 @@ static void snd_opl4_terminate_voice(opl4_t *opl4, opl4_voice_t *voice)
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc); snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
} }
void snd_opl4_terminate_note(void *private_data, int note, snd_midi_channel_t *chan) void snd_opl4_terminate_note(void *private_data, int note, struct snd_midi_channel *chan)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
snd_opl4_do_for_note(opl4, note, chan, snd_opl4_terminate_voice); snd_opl4_do_for_note(opl4, note, chan, snd_opl4_terminate_voice);
} }
void snd_opl4_control(void *private_data, int type, snd_midi_channel_t *chan) void snd_opl4_control(void *private_data, int type, struct snd_midi_channel *chan)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
switch (type) { switch (type) {
case MIDI_CTL_MSB_MODWHEEL: case MIDI_CTL_MSB_MODWHEEL:
...@@ -621,9 +625,9 @@ void snd_opl4_control(void *private_data, int type, snd_midi_channel_t *chan) ...@@ -621,9 +625,9 @@ void snd_opl4_control(void *private_data, int type, snd_midi_channel_t *chan)
} }
void snd_opl4_sysex(void *private_data, unsigned char *buf, int len, void snd_opl4_sysex(void *private_data, unsigned char *buf, int len,
int parsed, snd_midi_channel_set_t *chset) int parsed, struct snd_midi_channel_set *chset)
{ {
opl4_t *opl4 = private_data; struct snd_opl4 *opl4 = private_data;
if (parsed == SNDRV_MIDI_SYSEX_GS_MASTER_VOLUME) if (parsed == SNDRV_MIDI_SYSEX_GS_MASTER_VOLUME)
snd_opl4_do_for_all(opl4, snd_opl4_update_volume); snd_opl4_do_for_all(opl4, snd_opl4_update_volume);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment