diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 14:13:47 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:18:06 +0100 |
commit | a42dd420bea7a5cd130162183d95f640c299a337 (patch) | |
tree | b9c8a88c957b973faf3e5a4faf027a39a0d8343f /sound/drivers/opl4 | |
parent | 5b1646a8eceff0a4ff06f309abb6e7f43f99a498 (diff) |
[ALSA] Remove xxx_t typedefs: OPL4
Modules: OPL4
Remove xxx_t typedefs from the OPL4 driver
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers/opl4')
-rw-r--r-- | sound/drivers/opl4/opl4_lib.c | 40 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_local.h | 68 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_mixer.c | 16 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_proc.c | 24 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_seq.c | 42 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_synth.c | 76 | ||||
-rw-r--r-- | sound/drivers/opl4/yrw801.c | 262 |
7 files changed, 266 insertions, 262 deletions
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 4ae5dd8f011..ddfc10d04be 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -27,14 +27,14 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); MODULE_DESCRIPTION("OPL4 driver"); 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; 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); outb(reg, opl4->pcm_port); @@ -43,7 +43,7 @@ void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value) 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); outb(reg, opl4->pcm_port); @@ -52,7 +52,7 @@ u8 snd_opl4_read(opl4_t *opl4, u8 reg) 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; u8 memcfg; @@ -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); } -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; u8 memcfg; @@ -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); } -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); inb(opl4->fm_port); @@ -110,7 +110,7 @@ static void snd_opl4_enable_opl4(opl4_t *opl4) inb(opl4->fm_port); } -static int snd_opl4_detect(opl4_t *opl4) +static int snd_opl4_detect(struct snd_opl4 *opl4) { u8 id1, id2; @@ -144,19 +144,19 @@ static int snd_opl4_detect(opl4_t *opl4) } #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; } -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; 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"); - *(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_free = snd_opl4_seq_dev_free; } @@ -164,7 +164,7 @@ static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device) } #endif -static void snd_opl4_free(opl4_t *opl4) +static void snd_opl4_free(struct snd_opl4 *opl4) { #ifdef CONFIG_PROC_FS snd_opl4_free_proc(opl4); @@ -174,22 +174,22 @@ static void snd_opl4_free(opl4_t *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); 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, int seq_device, - opl3_t **ropl3, opl4_t **ropl4) + struct snd_opl3 **ropl3, struct snd_opl4 **ropl4) { - opl4_t *opl4; - opl3_t *opl3; + struct snd_opl4 *opl4; + struct snd_opl3 *opl3; int err; - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_opl4_dev_free }; diff --git a/sound/drivers/opl4/opl4_local.h b/sound/drivers/opl4/opl4_local.h index c455680843f..7e088a4a2f4 100644 --- a/sound/drivers/opl4/opl4_local.h +++ b/sound/drivers/opl4/opl4_local.h @@ -131,7 +131,7 @@ #define SNDRV_SEQ_DEV_ID_OPL4 "opl4-synth" -typedef struct opl4_sound { +struct opl4_sound { u16 tone; s16 pitch_offset; u8 key_scaling; @@ -144,42 +144,42 @@ typedef struct opl4_sound { u8 reg_level_decay2; u8 reg_release_correction; u8 reg_tremolo; -} opl4_sound_t; +}; -typedef struct opl4_region { +struct opl4_region { u8 key_min, key_max; - opl4_sound_t sound; -} opl4_region_t; + struct opl4_sound sound; +}; -typedef struct opl4_region_ptr { +struct opl4_region_ptr { int count; - const opl4_region_t *regions; -} opl4_region_ptr_t; + const struct opl4_region *regions; +}; -typedef struct opl4_voice { +struct opl4_voice { struct list_head list; int number; - snd_midi_channel_t *chan; + struct snd_midi_channel *chan; int note; int velocity; - const opl4_sound_t *sound; + const struct opl4_sound *sound; u8 level_direct; u8 reg_f_number; u8 reg_misc; u8 reg_lfo_vibrato; -} opl4_voice_t; +}; -struct opl4 { +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; - snd_card_t *card; + struct snd_card *card; #ifdef CONFIG_PROC_FS - snd_info_entry_t *proc_entry; + struct snd_info_entry *proc_entry; int memory_access; #endif struct semaphore access_mutex; @@ -189,44 +189,44 @@ struct opl4 { int seq_dev_num; int seq_client; - snd_seq_device_t *seq_dev; + struct snd_seq_device *seq_dev; - snd_midi_channel_set_t *chset; - opl4_voice_t voices[OPL4_MAX_VOICES]; + 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(opl4_t *opl4, u8 reg, u8 value); -u8 snd_opl4_read(opl4_t *opl4, u8 reg); -void snd_opl4_read_memory(opl4_t *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(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(opl4_t *opl4); +int snd_opl4_create_mixer(struct snd_opl4 *opl4); #ifdef CONFIG_PROC_FS /* opl4_proc.c */ -int snd_opl4_create_proc(opl4_t *opl4); -void snd_opl4_free_proc(opl4_t *opl4); +int snd_opl4_create_proc(struct snd_opl4 *opl4); +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(opl4_t *opl4); -void snd_opl4_synth_shutdown(opl4_t *opl4); -void snd_opl4_note_on(void *p, int note, int vel, snd_midi_channel_t *chan); -void snd_opl4_note_off(void *p, int note, int vel, snd_midi_channel_t *chan); -void snd_opl4_terminate_note(void *p, int note, snd_midi_channel_t *chan); -void snd_opl4_control(void *p, int type, snd_midi_channel_t *chan); -void snd_opl4_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); +void snd_opl4_synth_reset(struct snd_opl4 *opl4); +void snd_opl4_synth_shutdown(struct snd_opl4 *opl4); +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, struct snd_midi_channel *chan); +void snd_opl4_terminate_note(void *p, int note, struct snd_midi_channel *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, struct snd_midi_channel_set *chset); /* yrw801.c */ -int snd_yrw801_detect(opl4_t *opl4); -extern const opl4_region_ptr_t snd_yrw801_regions[]; +int snd_yrw801_detect(struct snd_opl4 *opl4); +extern const struct opl4_region_ptr snd_yrw801_regions[]; #endif /* __OPL4_LOCAL_H */ diff --git a/sound/drivers/opl4/opl4_mixer.c b/sound/drivers/opl4/opl4_mixer.c index ec7a228fbe7..04079de4c35 100644 --- a/sound/drivers/opl4/opl4_mixer.c +++ b/sound/drivers/opl4/opl4_mixer.c @@ -20,7 +20,7 @@ #include "opl4_local.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->count = 2; @@ -29,9 +29,9 @@ static int snd_opl4_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf 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; u8 reg = kcontrol->private_value; u8 value; @@ -44,9 +44,9 @@ static int snd_opl4_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon 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; u8 reg = kcontrol->private_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 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, .name = "FM Playback Volume", @@ -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; strcat(card->mixername, ",OPL4"); diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c index 6a1486258ac..f4b4e74fcc1 100644 --- a/sound/drivers/opl4/opl4_proc.c +++ b/sound/drivers/opl4/opl4_proc.c @@ -23,10 +23,10 @@ #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) { - opl4_t *opl4 = entry->private_data; + struct snd_opl4 *opl4 = entry->private_data; down(&opl4->access_mutex); if (opl4->memory_access) { @@ -38,10 +38,10 @@ static int snd_opl4_mem_proc_open(snd_info_entry_t *entry, 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) { - opl4_t *opl4 = entry->private_data; + struct snd_opl4 *opl4 = entry->private_data; down(&opl4->access_mutex); opl4->memory_access--; @@ -49,11 +49,11 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry, 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, unsigned long count, unsigned long pos) { - opl4_t *opl4 = entry->private_data; + struct snd_opl4 *opl4 = entry->private_data; long size; char* buf; @@ -75,11 +75,11 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d 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, unsigned long count, unsigned long pos) { - opl4_t *opl4 = entry->private_data; + struct snd_opl4 *opl4 = entry->private_data; long size; char *buf; @@ -101,7 +101,7 @@ static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_ 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) { switch (orig) { @@ -130,9 +130,9 @@ static struct snd_info_entry_ops snd_opl4_mem_proc_ops = { .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); if (entry) { @@ -157,7 +157,7 @@ int snd_opl4_create_proc(opl4_t *opl4) return 0; } -void snd_opl4_free_proc(opl4_t *opl4) +void snd_opl4_free_proc(struct snd_opl4 *opl4) { if (opl4->proc_entry) snd_info_unregister(opl4->proc_entry); diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c index 958dfe88479..bfd68e49c91 100644 --- a/sound/drivers/opl4/opl4_seq.c +++ b/sound/drivers/opl4/opl4_seq.c @@ -45,21 +45,21 @@ int volume_boost = 8; module_param(volume_boost, int, 0644); 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)) return -EFAULT; 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); } -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; down(&opl4->access_mutex); @@ -84,9 +84,9 @@ static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info) 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); @@ -99,7 +99,7 @@ static int snd_opl4_seq_unuse(void *private_data, snd_seq_port_subscribe_t *info return 0; } -static snd_midi_op_t opl4_ops = { +static struct snd_midi_op opl4_ops = { .note_on = snd_opl4_note_on, .note_off = snd_opl4_note_off, .note_terminate = snd_opl4_terminate_note, @@ -107,10 +107,10 @@ static snd_midi_op_t opl4_ops = { .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) { - opl4_t *opl4 = private_data; + struct snd_opl4 *opl4 = private_data; snd_midi_process_event(&opl4_ops, ev, opl4->chset); return 0; @@ -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) { - opl4_t *opl4 = private_data; + struct snd_opl4 *opl4 = private_data; 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; - snd_seq_client_callback_t callbacks; - snd_seq_client_info_t cinfo; - snd_seq_port_callback_t pcallbacks; + struct snd_seq_client_callback callbacks; + struct snd_seq_client_info cinfo; + 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) return -EINVAL; @@ -188,11 +188,11 @@ static int snd_opl4_seq_new_device(snd_seq_device_t *dev) 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) return -EINVAL; @@ -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 snd_seq_dev_ops_t ops = { + static struct snd_seq_dev_ops ops = { snd_opl4_seq_new_device, snd_opl4_seq_delete_device }; 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) diff --git a/sound/drivers/opl4/opl4_synth.c b/sound/drivers/opl4/opl4_synth.c index b146a1c995d..74f6e53eae0 100644 --- a/sound/drivers/opl4/opl4_synth.c +++ b/sound/drivers/opl4/opl4_synth.c @@ -270,7 +270,7 @@ static unsigned char snd_opl4_volume_table[128] = { /* * Initializes all voices. */ -void snd_opl4_synth_reset(opl4_t *opl4) +void snd_opl4_synth_reset(struct snd_opl4 *opl4) { unsigned long flags; int i; @@ -294,7 +294,7 @@ void snd_opl4_synth_reset(opl4_t *opl4) /* * Shuts down all voices. */ -void snd_opl4_synth_shutdown(opl4_t *opl4) +void snd_opl4_synth_shutdown(struct snd_opl4 *opl4) { unsigned long flags; int i; @@ -309,12 +309,12 @@ void snd_opl4_synth_shutdown(opl4_t *opl4) /* * 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, - void (*func)(opl4_t *opl4, opl4_voice_t *voice)) +static void snd_opl4_do_for_note(struct snd_opl4 *opl4, int note, struct snd_midi_channel *chan, + void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice)) { int i; unsigned long flags; - opl4_voice_t *voice; + struct opl4_voice *voice; spin_lock_irqsave(&opl4->reg_lock, flags); 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 /* * 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, - void (*func)(opl4_t *opl4, opl4_voice_t *voice)) +static void snd_opl4_do_for_channel(struct snd_opl4 *opl4, + struct snd_midi_channel *chan, + void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice)) { int i; unsigned long flags; - opl4_voice_t *voice; + struct opl4_voice *voice; spin_lock_irqsave(&opl4->reg_lock, flags); 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, /* * Executes the callback for all active voices. */ -static void snd_opl4_do_for_all(opl4_t *opl4, - void (*func)(opl4_t *opl4, opl4_voice_t *voice)) +static void snd_opl4_do_for_all(struct snd_opl4 *opl4, + void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice)) { int i; unsigned long flags; - opl4_voice_t *voice; + struct opl4_voice *voice; spin_lock_irqsave(&opl4->reg_lock, flags); for (i = 0; i < OPL4_MAX_VOICES; i++) { @@ -365,7 +366,7 @@ static void snd_opl4_do_for_all(opl4_t *opl4, 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; @@ -384,7 +385,7 @@ static void snd_opl4_update_volume(opl4_t *opl4, opl4_voice_t *voice) 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; @@ -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); } -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; @@ -414,9 +416,10 @@ static void snd_opl4_update_vibrato_depth(opl4_t *opl4, opl4_voice_t *voice) 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; note = chan->drum_channel ? 60 : voice->note; @@ -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); } -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, voice->sound->reg_attack_decay1); @@ -457,17 +461,17 @@ static void snd_opl4_update_tone_parameters(opl4_t *opl4, opl4_voice_t *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 */ 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 */ 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; @@ -475,12 +479,12 @@ static void snd_opl4_wait_for_wave_headers(opl4_t *opl4) 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; - const opl4_region_ptr_t *regions; - opl4_voice_t *voice[2]; - const opl4_sound_t *sound[2]; + struct snd_opl4 *opl4 = private_data; + const struct opl4_region_ptr *regions; + struct opl4_voice *voice[2]; + const struct opl4_sound *sound[2]; int voices = 0, i; unsigned long flags; @@ -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); } -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_add_tail(&voice->list, &opl4->off_voices); @@ -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); } -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); } -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_add_tail(&voice->list, &opl4->off_voices); @@ -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); } -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); } -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) { case MIDI_CTL_MSB_MODWHEEL: @@ -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, - 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) snd_opl4_do_for_all(opl4, snd_opl4_update_volume); diff --git a/sound/drivers/opl4/yrw801.c b/sound/drivers/opl4/yrw801.c index a51174dd3e5..6c335492d08 100644 --- a/sound/drivers/opl4/yrw801.c +++ b/sound/drivers/opl4/yrw801.c @@ -33,7 +33,7 @@ #include "opl4_local.h" -int snd_yrw801_detect(opl4_t *opl4) +int snd_yrw801_detect(struct snd_opl4 *opl4) { char buf[15]; @@ -54,7 +54,7 @@ int snd_yrw801_detect(opl4_t *opl4) * by this driver. */ -static const opl4_region_t regions_00[] = { /* Acoustic Grand Piano */ +static const struct opl4_region regions_00[] = { /* Acoustic Grand Piano */ {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}}, {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, @@ -66,7 +66,7 @@ static const opl4_region_t regions_00[] = { /* Acoustic Grand Piano */ {0x53, 0x58, {0x134,1444,100, 0,0,0x07,0xc8,0x20,0xf3,0x14,0x18,0x0}}, {0x59, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}} }; -static const opl4_region_t regions_01[] = { /* Bright Acoustic Piano */ +static const struct opl4_region regions_01[] = { /* Bright Acoustic Piano */ {0x14, 0x2d, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}}, {0x2e, 0x33, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x34, 0x39, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, @@ -78,7 +78,7 @@ static const opl4_region_t regions_01[] = { /* Bright Acoustic Piano */ {0x59, 0x5e, {0x134,1444,100, 0,0,0x0a,0xc8,0x20,0xf3,0x14,0x18,0x0}}, {0x5f, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}} }; -static const opl4_region_t regions_02[] = { /* Electric Grand Piano */ +static const struct opl4_region regions_02[] = { /* Electric Grand Piano */ {0x14, 0x2d, {0x12c,7476,100, 1,0,0x00,0xae,0x20,0xf2,0x13,0x07,0x0}}, {0x2e, 0x33, {0x12d,6818,100, 1,0,0x00,0xae,0x20,0xf2,0x14,0x07,0x0}}, {0x34, 0x39, {0x12e,5901,100, 1,0,0x00,0xae,0x20,0xf2,0x14,0x07,0x0}}, @@ -91,7 +91,7 @@ static const opl4_region_t regions_02[] = { /* Electric Grand Piano */ {0x5f, 0x6d, {0x135,1917,100, 1,0,0x00,0xae,0x20,0xf4,0x15,0x07,0x0}}, {0x00, 0x7f, {0x06c,6375,100,-1,0,0x00,0xc2,0x28,0xf4,0x23,0x18,0x0}} }; -static const opl4_region_t regions_03[] = { /* Honky-Tonk Piano */ +static const struct opl4_region regions_03[] = { /* Honky-Tonk Piano */ {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xb4,0x20,0xf2,0x13,0x08,0x0}}, {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xb4,0x20,0xf2,0x14,0x08,0x0}}, {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xb4,0x20,0xf2,0x14,0x08,0x0}}, @@ -113,11 +113,11 @@ static const opl4_region_t regions_03[] = { /* Honky-Tonk Piano */ {0x53, 0x58, {0x134,1457,100, 0,0,0x01,0xb4,0x20,0xf3,0x14,0x18,0x0}}, {0x59, 0x6d, {0x135,1903,100, 0,0,0x00,0xb4,0x20,0xf4,0x15,0x08,0x0}} }; -static const opl4_region_t regions_04[] = { /* Electric Piano 1 */ +static const struct opl4_region regions_04[] = { /* Electric Piano 1 */ {0x15, 0x6c, {0x00b,6570,100, 0,0,0x00,0x28,0x38,0xf0,0x00,0x0c,0x0}}, {0x00, 0x7f, {0x06c,6375,100, 0,2,0x00,0xb0,0x22,0xf4,0x23,0x19,0x0}} }; -static const opl4_region_t regions_05[] = { /* Electric Piano 2 */ +static const struct opl4_region regions_05[] = { /* Electric Piano 2 */ {0x14, 0x27, {0x12c,7476,100, 0,3,0x00,0xa2,0x1b,0xf2,0x13,0x08,0x0}}, {0x28, 0x2d, {0x12d,6818,100, 0,3,0x00,0xa2,0x1b,0xf2,0x14,0x08,0x0}}, {0x2e, 0x33, {0x12e,5901,100, 0,3,0x00,0xa2,0x1b,0xf2,0x14,0x08,0x0}}, @@ -139,103 +139,103 @@ static const opl4_region_t regions_05[] = { /* Electric Piano 2 */ {0x59, 0x5e, {0x134,1442,100, 0,0,0x0a,0xa2,0x18,0xf3,0x14,0x18,0x0}}, {0x5f, 0x6d, {0x135,1913,100, 0,0,0x00,0xa2,0x18,0xf4,0x15,0x08,0x0}} }; -static const opl4_region_t regions_06[] = { /* Harpsichord */ +static const struct opl4_region regions_06[] = { /* Harpsichord */ {0x15, 0x39, {0x080,5158,100, 0,0,0x00,0xb2,0x20,0xf5,0x24,0x19,0x0}}, {0x3a, 0x3f, {0x081,4408,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x09,0x0}}, {0x40, 0x45, {0x082,3622,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x09,0x0}}, {0x46, 0x4d, {0x083,2843,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x19,0x0}}, {0x4e, 0x6c, {0x084,1307,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x29,0x0}} }; -static const opl4_region_t regions_07[] = { /* Clavinet */ +static const struct opl4_region regions_07[] = { /* Clavinet */ {0x15, 0x51, {0x027,5009,100, 0,0,0x00,0xd2,0x28,0xf5,0x13,0x2b,0x0}}, {0x52, 0x6c, {0x028,3495,100, 0,0,0x00,0xd2,0x28,0xf5,0x13,0x3b,0x0}} }; -static const opl4_region_t regions_08[] = { /* Celesta */ +static const struct opl4_region regions_08[] = { /* Celesta */ {0x15, 0x6c, {0x02b,3267,100, 0,0,0x00,0xdc,0x20,0xf4,0x15,0x07,0x3}} }; -static const opl4_region_t regions_09[] = { /* Glockenspiel */ +static const struct opl4_region regions_09[] = { /* Glockenspiel */ {0x15, 0x78, {0x0f3, 285,100, 0,0,0x00,0xc2,0x28,0xf6,0x25,0x25,0x0}} }; -static const opl4_region_t regions_0a[] = { /* Music Box */ +static const struct opl4_region regions_0a[] = { /* Music Box */ {0x15, 0x6c, {0x0f3,3362,100, 0,0,0x00,0xb6,0x20,0xa6,0x25,0x25,0x0}}, {0x15, 0x6c, {0x101,4773,100, 0,0,0x00,0xaa,0x20,0xd4,0x14,0x16,0x0}} }; -static const opl4_region_t regions_0b[] = { /* Vibraphone */ +static const struct opl4_region regions_0b[] = { /* Vibraphone */ {0x15, 0x6c, {0x101,4778,100, 0,0,0x00,0xc0,0x28,0xf4,0x14,0x16,0x4}} }; -static const opl4_region_t regions_0c[] = { /* Marimba */ +static const struct opl4_region regions_0c[] = { /* Marimba */ {0x15, 0x3f, {0x0f4,4778,100, 0,0,0x00,0xc4,0x38,0xf7,0x47,0x08,0x0}}, {0x40, 0x4c, {0x0f5,3217,100, 0,0,0x00,0xc4,0x38,0xf7,0x47,0x08,0x0}}, {0x4d, 0x5a, {0x0f5,3217,100, 0,0,0x00,0xc4,0x38,0xf7,0x48,0x08,0x0}}, {0x5b, 0x7f, {0x0f5,3218,100, 0,0,0x00,0xc4,0x38,0xf7,0x48,0x18,0x0}} }; -static const opl4_region_t regions_0d[] = { /* Xylophone */ +static const struct opl4_region regions_0d[] = { /* Xylophone */ {0x00, 0x7f, {0x136,1729,100, 0,0,0x00,0xd2,0x38,0xf0,0x06,0x36,0x0}} }; -static const opl4_region_t regions_0e[] = { /* Tubular Bell */ +static const struct opl4_region regions_0e[] = { /* Tubular Bell */ {0x01, 0x7f, {0x0ff,3999,100, 0,1,0x00,0x90,0x21,0xf4,0xa3,0x25,0x1}} }; -static const opl4_region_t regions_0f[] = { /* Dulcimer */ +static const struct opl4_region regions_0f[] = { /* Dulcimer */ {0x00, 0x7f, {0x03f,4236,100, 0,1,0x00,0xbc,0x29,0xf5,0x16,0x07,0x0}}, {0x00, 0x7f, {0x040,4236,100, 0,2,0x0e,0x94,0x2a,0xf5,0x16,0x07,0x0}} }; -static const opl4_region_t regions_10[] = { /* Drawbar Organ */ +static const struct opl4_region regions_10[] = { /* Drawbar Organ */ {0x01, 0x7f, {0x08e,4394,100, 0,2,0x14,0xc2,0x3a,0xf0,0x00,0x0a,0x0}} }; -static const opl4_region_t regions_11[] = { /* Percussive Organ */ +static const struct opl4_region regions_11[] = { /* Percussive Organ */ {0x15, 0x3b, {0x08c,6062,100, 0,3,0x00,0xbe,0x3b,0xf0,0x00,0x09,0x0}}, {0x3c, 0x6c, {0x08d,2984,100, 0,3,0x00,0xbe,0x3b,0xf0,0x00,0x09,0x0}} }; -static const opl4_region_t regions_12[] = { /* Rock Organ */ +static const struct opl4_region regions_12[] = { /* Rock Organ */ {0x15, 0x30, {0x128,6574,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, {0x31, 0x3c, {0x129,5040,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, {0x3d, 0x48, {0x12a,3498,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, {0x49, 0x54, {0x12b,1957,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, {0x55, 0x6c, {0x127, 423,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}} }; -static const opl4_region_t regions_13[] = { /* Church Organ */ +static const struct opl4_region regions_13[] = { /* Church Organ */ {0x15, 0x29, {0x087,7466,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, {0x2a, 0x30, {0x088,6456,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, {0x31, 0x38, {0x089,5428,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, {0x39, 0x41, {0x08a,4408,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, {0x42, 0x6c, {0x08b,3406,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}} }; -static const opl4_region_t regions_14[] = { /* Reed Organ */ +static const struct opl4_region regions_14[] = { /* Reed Organ */ {0x00, 0x53, {0x0ac,5570,100, 0,0,0x06,0xc0,0x38,0xf0,0x00,0x09,0x1}}, {0x54, 0x7f, {0x0ad,2497,100, 0,0,0x00,0xc0,0x38,0xf0,0x00,0x09,0x1}} }; -static const opl4_region_t regions_15[] = { /* Accordion */ +static const struct opl4_region regions_15[] = { /* Accordion */ {0x15, 0x4c, {0x006,4261,100, 0,2,0x00,0xa4,0x22,0x90,0x00,0x09,0x0}}, {0x4d, 0x6c, {0x007,1530,100, 0,2,0x00,0xa4,0x22,0x90,0x00,0x09,0x0}}, {0x15, 0x6c, {0x070,4391,100, 0,3,0x00,0x8a,0x23,0xa0,0x00,0x09,0x0}} }; -static const opl4_region_t regions_16[] = { /* Harmonica */ +static const struct opl4_region regions_16[] = { /* Harmonica */ {0x15, 0x6c, {0x070,4408,100, 0,0,0x00,0xae,0x30,0xa0,0x00,0x09,0x2}} }; -static const opl4_region_t regions_17[] = { /* Tango Accordion */ +static const struct opl4_region regions_17[] = { /* Tango Accordion */ |