summaryrefslogtreecommitdiffstats
path: root/sound/synth
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 14:24:47 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:18:14 +0100
commit03da312ac080b4f5c9359c233b8812cc93a035fe (patch)
tree1a6767ca18964b53442ecfd538141b12e81b23be /sound/synth
parentee42381e71c56328db9e9d64d19a4de7a2f09a93 (diff)
[ALSA] Remove xxx_t typedefs: Emu-X synth
Modules: Common EMU synth,SoundFont,Synth Remove xxx_t typedefs from the Emu-X synth support. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/synth')
-rw-r--r--sound/synth/emux/emux.c29
-rw-r--r--sound/synth/emux/emux_effect.c44
-rw-r--r--sound/synth/emux/emux_hwdep.c23
-rw-r--r--sound/synth/emux/emux_nrpn.c30
-rw-r--r--sound/synth/emux/emux_oss.c90
-rw-r--r--sound/synth/emux/emux_proc.c14
-rw-r--r--sound/synth/emux/emux_seq.c74
-rw-r--r--sound/synth/emux/emux_synth.c139
-rw-r--r--sound/synth/emux/emux_voice.h67
-rw-r--r--sound/synth/emux/soundfont.c248
-rw-r--r--sound/synth/util_mem.c39
11 files changed, 427 insertions, 370 deletions
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c
index 2aacd8a884e5..7c8e328fae62 100644
--- a/sound/synth/emux/emux.c
+++ b/sound/synth/emux/emux.c
@@ -35,9 +35,9 @@ MODULE_LICENSE("GPL");
/*
* create a new hardware dependent device for Emu8000/Emu10k1
*/
-int snd_emux_new(snd_emux_t **remu)
+int snd_emux_new(struct snd_emux **remu)
{
- snd_emux_t *emu;
+ struct snd_emux *emu;
*remu = NULL;
emu = kzalloc(sizeof(*emu), GFP_KERNEL);
@@ -66,33 +66,33 @@ int snd_emux_new(snd_emux_t **remu)
/*
*/
-static int sf_sample_new(void *private_data, snd_sf_sample_t *sp,
- snd_util_memhdr_t *hdr,
- const void __user *buf, long count)
+static int sf_sample_new(void *private_data, struct snd_sf_sample *sp,
+ struct snd_util_memhdr *hdr,
+ const void __user *buf, long count)
{
- snd_emux_t *emu = private_data;
+ struct snd_emux *emu = private_data;
return emu->ops.sample_new(emu, sp, hdr, buf, count);
}
-static int sf_sample_free(void *private_data, snd_sf_sample_t *sp,
- snd_util_memhdr_t *hdr)
+static int sf_sample_free(void *private_data, struct snd_sf_sample *sp,
+ struct snd_util_memhdr *hdr)
{
- snd_emux_t *emu = private_data;
+ struct snd_emux *emu = private_data;
return emu->ops.sample_free(emu, sp, hdr);
}
static void sf_sample_reset(void *private_data)
{
- snd_emux_t *emu = private_data;
+ struct snd_emux *emu = private_data;
emu->ops.sample_reset(emu);
}
-int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
+int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name)
{
int err;
- snd_sf_callback_t sf_cb;
+ struct snd_sf_callback sf_cb;
snd_assert(emu->hw != NULL, return -EINVAL);
snd_assert(emu->max_voices > 0, return -EINVAL);
@@ -101,7 +101,8 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
emu->card = card;
emu->name = kstrdup(name, GFP_KERNEL);
- emu->voices = kcalloc(emu->max_voices, sizeof(snd_emux_voice_t), GFP_KERNEL);
+ emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice),
+ GFP_KERNEL);
if (emu->voices == NULL)
return -ENOMEM;
@@ -138,7 +139,7 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
/*
*/
-int snd_emux_free(snd_emux_t *emu)
+int snd_emux_free(struct snd_emux *emu)
{
unsigned long flags;
diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c
index 4764940f11a0..a447218b6160 100644
--- a/sound/synth/emux/emux_effect.c
+++ b/sound/synth/emux/emux_effect.c
@@ -32,7 +32,7 @@
#define xoffsetof(type,tag) ((long)(&((type)NULL)->tag) - (long)(NULL))
-#define parm_offset(tag) xoffsetof(soundfont_voice_parm_t*, tag)
+#define parm_offset(tag) xoffsetof(struct soundfont_voice_parm *, tag)
#define PARM_IS_BYTE (1 << 0)
#define PARM_IS_WORD (1 << 1)
@@ -97,10 +97,10 @@ static struct emux_parm_defs {
/* set byte effect value */
static void
-effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type)
+effect_set_byte(unsigned char *valp, struct snd_midi_channel *chan, int type)
{
short effect;
- snd_emux_effect_table_t *fx = chan->private;
+ struct snd_emux_effect_table *fx = chan->private;
effect = fx->val[type];
if (fx->flag[type] == EMUX_FX_FLAG_ADD) {
@@ -118,10 +118,10 @@ effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type)
/* set word effect value */
static void
-effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type)
+effect_set_word(unsigned short *valp, struct snd_midi_channel *chan, int type)
{
int effect;
- snd_emux_effect_table_t *fx = chan->private;
+ struct snd_emux_effect_table *fx = chan->private;
effect = *(unsigned short*)&fx->val[type];
if (fx->flag[type] == EMUX_FX_FLAG_ADD)
@@ -135,10 +135,10 @@ effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type)
/* address offset */
static int
-effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode)
+effect_get_offset(struct snd_midi_channel *chan, int lo, int hi, int mode)
{
int addr = 0;
- snd_emux_effect_table_t *fx = chan->private;
+ struct snd_emux_effect_table *fx = chan->private;
if (fx->flag[hi])
addr = (short)fx->val[hi];
@@ -153,7 +153,8 @@ effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode)
#ifdef CONFIG_SND_SEQUENCER_OSS
/* change effects - for OSS sequencer compatibility */
void
-snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val)
+snd_emux_send_effect_oss(struct snd_emux_port *port,
+ struct snd_midi_channel *chan, int type, int val)
{
int mode;
@@ -173,13 +174,14 @@ snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int ty
* if update is necessary, call emu8000_control
*/
void
-snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode)
+snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan,
+ int type, int val, int mode)
{
int i;
int offset;
unsigned char *srcp, *origp;
- snd_emux_t *emu;
- snd_emux_effect_table_t *fx;
+ struct snd_emux *emu;
+ struct snd_emux_effect_table *fx;
unsigned long flags;
emu = port->emu;
@@ -206,7 +208,7 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type,
/* modify the register values */
spin_lock_irqsave(&emu->voice_lock, flags);
for (i = 0; i < emu->max_voices; i++) {
- snd_emux_voice_t *vp = &emu->voices[i];
+ struct snd_emux_voice *vp = &emu->voices[i];
if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan)
continue;
srcp = (unsigned char*)&vp->reg.parm + offset;
@@ -228,10 +230,10 @@ snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type,
/* copy wavetable registers to voice table */
void
-snd_emux_setup_effect(snd_emux_voice_t *vp)
+snd_emux_setup_effect(struct snd_emux_voice *vp)
{
- snd_midi_channel_t *chan = vp->chan;
- snd_emux_effect_table_t *fx;
+ struct snd_midi_channel *chan = vp->chan;
+ struct snd_emux_effect_table *fx;
unsigned char *srcp;
int i;
@@ -275,10 +277,11 @@ snd_emux_setup_effect(snd_emux_voice_t *vp)
* effect table
*/
void
-snd_emux_create_effect(snd_emux_port_t *p)
+snd_emux_create_effect(struct snd_emux_port *p)
{
int i;
- p->effect = kcalloc(p->chset.max_channels, sizeof(snd_emux_effect_table_t), GFP_KERNEL);
+ p->effect = kcalloc(p->chset.max_channels,
+ sizeof(struct snd_emux_effect_table), GFP_KERNEL);
if (p->effect) {
for (i = 0; i < p->chset.max_channels; i++)
p->chset.channels[i].private = p->effect + i;
@@ -289,17 +292,18 @@ snd_emux_create_effect(snd_emux_port_t *p)
}
void
-snd_emux_delete_effect(snd_emux_port_t *p)
+snd_emux_delete_effect(struct snd_emux_port *p)
{
kfree(p->effect);
p->effect = NULL;
}
void
-snd_emux_clear_effect(snd_emux_port_t *p)
+snd_emux_clear_effect(struct snd_emux_port *p)
{
if (p->effect) {
- memset(p->effect, 0, sizeof(snd_emux_effect_table_t) * p->chset.max_channels);
+ memset(p->effect, 0, sizeof(struct snd_emux_effect_table) *
+ p->chset.max_channels);
}
}
diff --git a/sound/synth/emux/emux_hwdep.c b/sound/synth/emux/emux_hwdep.c
index 4182b44eb47e..9b63814c3f64 100644
--- a/sound/synth/emux/emux_hwdep.c
+++ b/sound/synth/emux/emux_hwdep.c
@@ -29,7 +29,7 @@
* open the hwdep device
*/
static int
-snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file)
+snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file)
{
return 0;
}
@@ -39,7 +39,7 @@ snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file)
* close the device
*/
static int
-snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file)
+snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file)
{
return 0;
}
@@ -51,10 +51,10 @@ snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file)
* load patch
*/
static int
-snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg)
+snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg)
{
int err;
- soundfont_patch_info_t patch;
+ struct soundfont_patch_info patch;
if (copy_from_user(&patch, arg, sizeof(patch)))
return -EFAULT;
@@ -77,9 +77,9 @@ snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg)
* set misc mode
*/
static int
-snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg)
+snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg)
{
- struct sndrv_emux_misc_mode info;
+ struct snd_emux_misc_mode info;
int i;
if (copy_from_user(&info, arg, sizeof(info)))
@@ -102,9 +102,10 @@ snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg)
* ioctl
*/
static int
-snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg)
+snd_emux_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
+ unsigned int cmd, unsigned long arg)
{
- snd_emux_t *emu = hw->private_data;
+ struct snd_emux *emu = hw->private_data;
switch (cmd) {
case SNDRV_EMUX_IOCTL_VERSION:
@@ -136,9 +137,9 @@ snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsi
*/
int
-snd_emux_init_hwdep(snd_emux_t *emu)
+snd_emux_init_hwdep(struct snd_emux *emu)
{
- snd_hwdep_t *hw;
+ struct snd_hwdep *hw;
int err;
if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0)
@@ -162,7 +163,7 @@ snd_emux_init_hwdep(snd_emux_t *emu)
* unregister
*/
void
-snd_emux_delete_hwdep(snd_emux_t *emu)
+snd_emux_delete_hwdep(struct snd_emux *emu)
{
if (emu->hwdep) {
snd_device_free(emu->card, emu->hwdep);
diff --git a/sound/synth/emux/emux_nrpn.c b/sound/synth/emux/emux_nrpn.c
index 25edff9e1fc2..c6917ba2c934 100644
--- a/sound/synth/emux/emux_nrpn.c
+++ b/sound/synth/emux/emux_nrpn.c
@@ -27,11 +27,11 @@
*/
/* NRPN / CC -> Emu8000 parameter converter */
-typedef struct {
+struct nrpn_conv_table {
int control;
int effect;
int (*convert)(int val);
-} nrpn_conv_table;
+};
/* effect sensitivity */
@@ -48,8 +48,9 @@ typedef struct {
* convert NRPN/control values
*/
-static int send_converted_effect(nrpn_conv_table *table, int num_tables,
- snd_emux_port_t *port, snd_midi_channel_t *chan,
+static int send_converted_effect(struct nrpn_conv_table *table, int num_tables,
+ struct snd_emux_port *port,
+ struct snd_midi_channel *chan,
int type, int val, int mode)
{
int i, cval;
@@ -178,7 +179,7 @@ static int fx_conv_Q(int val)
}
-static nrpn_conv_table awe_effects[] =
+static struct nrpn_conv_table awe_effects[] =
{
{ 0, EMUX_FX_LFO1_DELAY, fx_lfo1_delay},
{ 1, EMUX_FX_LFO1_FREQ, fx_lfo1_freq},
@@ -265,7 +266,7 @@ static int gs_vib_delay(int val)
return -(val - 64) * gs_sense[FX_VIBDELAY] / 50;
}
-static nrpn_conv_table gs_effects[] =
+static struct nrpn_conv_table gs_effects[] =
{
{32, EMUX_FX_CUTOFF, gs_cutoff},
{33, EMUX_FX_FILTERQ, gs_filterQ},
@@ -282,9 +283,10 @@ static nrpn_conv_table gs_effects[] =
* NRPN events
*/
void
-snd_emux_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset)
+snd_emux_nrpn(void *p, struct snd_midi_channel *chan,
+ struct snd_midi_channel_set *chset)
{
- snd_emux_port_t *port;
+ struct snd_emux_port *port;
port = p;
snd_assert(port != NULL, return);
@@ -348,7 +350,7 @@ static int xg_release(int val)
return -(val - 64) * xg_sense[FX_RELEASE] / 64;
}
-static nrpn_conv_table xg_effects[] =
+static struct nrpn_conv_table xg_effects[] =
{
{71, EMUX_FX_CUTOFF, xg_cutoff},
{74, EMUX_FX_FILTERQ, xg_filterQ},
@@ -357,7 +359,8 @@ static nrpn_conv_table xg_effects[] =
};
int
-snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param)
+snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan,
+ int param)
{
return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
port, chan, param,
@@ -369,10 +372,11 @@ snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param)
* receive sysex
*/
void
-snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset)
+snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed,
+ struct snd_midi_channel_set *chset)
{
- snd_emux_port_t *port;
- snd_emux_t *emu;
+ struct snd_emux_port *port;
+ struct snd_emux *emu;
port = p;
snd_assert(port != NULL, return);
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index 5272f4ac8afd..dfbfcfbe5dd2 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -31,19 +31,25 @@
#include "emux_voice.h"
#include <sound/asoundef.h>
-static int snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure);
-static int snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg);
-static int snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg);
-static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count);
-static int snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg);
-static int snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop);
-static void reset_port_mode(snd_emux_port_t *port, int midi_mode);
-static void emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop);
-static void gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop);
-static void fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop);
+static int snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure);
+static int snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg);
+static int snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
+ unsigned long ioarg);
+static int snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
+ const char __user *buf, int offs, int count);
+static int snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg);
+static int snd_emux_event_oss_input(struct snd_seq_event *ev, int direct,
+ void *private, int atomic, int hop);
+static void reset_port_mode(struct snd_emux_port *port, int midi_mode);
+static void emuspec_control(struct snd_emux *emu, struct snd_emux_port *port,
+ int cmd, unsigned char *event, int atomic, int hop);
+static void gusspec_control(struct snd_emux *emu, struct snd_emux_port *port,
+ int cmd, unsigned char *event, int atomic, int hop);
+static void fake_event(struct snd_emux *emu, struct snd_emux_port *port,
+ int ch, int param, int val, int atomic, int hop);
/* operators */
-static snd_seq_oss_callback_t oss_callback = {
+static struct snd_seq_oss_callback oss_callback = {
.owner = THIS_MODULE,
.open = snd_emux_open_seq_oss,
.close = snd_emux_close_seq_oss,
@@ -58,13 +64,13 @@ static snd_seq_oss_callback_t oss_callback = {
*/
void
-snd_emux_init_seq_oss(snd_emux_t *emu)
+snd_emux_init_seq_oss(struct snd_emux *emu)
{
- snd_seq_oss_reg_t *arg;
- snd_seq_device_t *dev;
+ struct snd_seq_oss_reg *arg;
+ struct snd_seq_device *dev;
if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS,
- sizeof(snd_seq_oss_reg_t), &dev) < 0)
+ sizeof(struct snd_seq_oss_reg), &dev) < 0)
return;
emu->oss_synth = dev;
@@ -85,7 +91,7 @@ snd_emux_init_seq_oss(snd_emux_t *emu)
* unregister
*/
void
-snd_emux_detach_seq_oss(snd_emux_t *emu)
+snd_emux_detach_seq_oss(struct snd_emux *emu)
{
if (emu->oss_synth) {
snd_device_free(emu->card, emu->oss_synth);
@@ -101,11 +107,11 @@ snd_emux_detach_seq_oss(snd_emux_t *emu)
* open port for OSS sequencer
*/
static int
-snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
+snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
{
- snd_emux_t *emu;
- snd_emux_port_t *p;
- snd_seq_port_callback_t callback;
+ struct snd_emux *emu;
+ struct snd_emux_port *p;
+ struct snd_seq_port_callback callback;
char tmpname[64];
emu = closure;
@@ -153,7 +159,7 @@ snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
* reset port mode
*/
static void
-reset_port_mode(snd_emux_port_t *port, int midi_mode)
+reset_port_mode(struct snd_emux_port *port, int midi_mode)
{
if (midi_mode) {
port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI;
@@ -173,10 +179,10 @@ reset_port_mode(snd_emux_port_t *port, int midi_mode)
* close port
*/
static int
-snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg)
+snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg)
{
- snd_emux_t *emu;
- snd_emux_port_t *p;
+ struct snd_emux *emu;
+ struct snd_emux_port *p;
snd_assert(arg != NULL, return -ENXIO);
p = arg->private_data;
@@ -200,11 +206,11 @@ snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg)
* load patch
*/
static int
-snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
+snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
const char __user *buf, int offs, int count)
{
- snd_emux_t *emu;
- snd_emux_port_t *p;
+ struct snd_emux *emu;
+ struct snd_emux_port *p;
int rc;
snd_assert(arg != NULL, return -ENXIO);
@@ -218,7 +224,7 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
rc = snd_soundfont_load_guspatch(emu->sflist, buf, count,
SF_CLIENT_NO(p->chset.port));
else if (format == SNDRV_OSS_SOUNDFONT_PATCH) {
- soundfont_patch_info_t patch;
+ struct soundfont_patch_info patch;
if (count < (int)sizeof(patch))
rc = -EINVAL;
if (copy_from_user(&patch, buf, sizeof(patch)))
@@ -242,10 +248,10 @@ snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
* ioctl
*/
static int
-snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg)
+snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg)
{
- snd_emux_port_t *p;
- snd_emux_t *emu;
+ struct snd_emux_port *p;
+ struct snd_emux *emu;
snd_assert(arg != NULL, return -ENXIO);
p = arg->private_data;
@@ -273,9 +279,9 @@ snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long i
* reset device
*/
static int
-snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg)
+snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg)
{
- snd_emux_port_t *p;
+ struct snd_emux_port *p;
snd_assert(arg != NULL, return -ENXIO);
p = arg->private_data;
@@ -289,11 +295,11 @@ snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg)
* receive raw events: only SEQ_PRIVATE is accepted.
*/
static int
-snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data,
+snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_data,
int atomic, int hop)
{
- snd_emux_t *emu;
- snd_emux_port_t *p;
+ struct snd_emux *emu;
+ struct snd_emux_port *p;
unsigned char cmd, *data;
p = private_data;
@@ -320,14 +326,14 @@ snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data,
* OSS/AWE driver specific h/w controls
*/
static void
-emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
+emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd,
unsigned char *event, int atomic, int hop)
{
int voice;
unsigned short p1;
short p2;
int i;
- snd_midi_channel_t *chan;
+ struct snd_midi_channel *chan;
voice = event[3];
if (voice < 0 || voice >= port->chset.max_channels)
@@ -415,14 +421,14 @@ emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
#include <linux/ultrasound.h>
static void
-gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
+gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd,
unsigned char *event, int atomic, int hop)
{
int voice;
unsigned short p1;
short p2;
int plong;
- snd_midi_channel_t *chan;
+ struct snd_midi_channel *chan;
if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH)
return;
@@ -483,9 +489,9 @@ gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
* send an event to midi emulation
*/
static void
-fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop)
+fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop)
{
- snd_seq_event_t ev;
+ struct snd_seq_event ev;
memset(&ev, 0, sizeof(ev));
ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
ev.data.control.channel = ch;
diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c
index 0f155d68de0d..a70a179f6947 100644
--- a/sound/synth/emux/emux_proc.c
+++ b/sound/synth/emux/emux_proc.c
@@ -30,10 +30,10 @@
#ifdef CONFIG_PROC_FS
static void
-snd_emux_proc_info_read(snd_info_entry_t *entry,
- snd_info_buffer_t *buf)
+snd_emux_proc_info_read(struct snd_info_entry *entry,
+ struct snd_info_buffer *buf)
{
- snd_emux_t *emu;
+ struct snd_emux *emu;
int i;
emu = entry->private_data;
@@ -66,7 +66,7 @@ snd_emux_proc_info_read(snd_info_entry_t *entry,
}
#if 0 /* debug */
if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) {
- snd_emux_voice_t *vp = &emu->voices[0];
+ struct snd_emux_voice *vp = &emu->voices[0];
snd_iprintf(buf, "voice 0: on\n");
snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n",
vp->reg.parm.moddelay,
@@ -107,9 +107,9 @@ snd_emux_proc_info_read(snd_info_entry_t *entry,
}
-void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device)
+void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device)
{
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
char name[64];
sprintf(name, "wavetableD%d", device);
@@ -127,7 +127,7 @@ void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device)
emu->proc = entry;
}
-void snd_emux_proc_free(snd_emux_t *emu)
+void snd_emux_proc_free(struct snd_emux *emu)
{
if (emu->proc) {
snd_info_unregister(emu->proc);
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 8ccd33f4aa57..f5a832ff362c 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -25,15 +25,15 @@
/* Prototypes for static functions */
static void free_port(void *private);
-static void snd_emux_init_port(snd_emux_port_t *p);
-static int snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info);
-static int snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info);
-static int get_client(snd_card_t *card, int index, char *name);
+static void snd_emux_init_port(struct snd_emux_port *p);
+static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info);
+static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info);
+static int get_client(struct snd_card *card, int index, char *name);
/*
* MIDI emulation operators
*/
-static snd_midi_op_t emux_ops = {
+static struct snd_midi_op emux_ops = {
snd_emux_note_on,
snd_emux_note_off,
snd_emux_key_press,
@@ -65,10 +65,10 @@ static snd_midi_op_t emux_ops = {
* can connect to these ports to play midi data.
*/
int
-snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index)
+snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
{
int i;
- snd_seq_port_callback_t pinfo;
+ struct snd_seq_port_callback pinfo;
char tmpname[64];
sprintf(tmpname, "%s WaveTable", emu->name);
@@ -94,7 +94,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index)
pinfo.event_input = snd_emux_event_input;
for (i = 0; i < emu->num_ports; i++) {
- snd_emux_port_t *p;
+ struct snd_emux_port *p;
sprintf(tmpname, "%s Port %d", emu->name, i);
p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS,
@@ -119,7 +119,7 @@ snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index)
* destroy the kernel client.
*/
void
-snd_emux_detach_seq(snd_emux_t *emu)
+snd_emux_detach_seq(struct snd_emux *emu)
{
if (emu->voices)
snd_emux_terminate_all(emu);
@@ -137,12 +137,12 @@ snd_emux_detach_seq(snd_emux_t *emu)
* create a sequencer port and channel_set
*/
-snd_emux_port_t *
-snd_emux_create_port(snd_emux_t *emu, char *name,
- int max_channels, int oss_port,
- snd_seq_port_callback_t *callback)
+struct snd_emux_port *
+snd_emux_create_port(struct snd_emux *emu, char *name,
+ int max_channels, int oss_port,
+ struct snd_seq_port_callback *callback)
{
- snd_emux_port_t *p;
+ struct snd_emux_port *p;
int i, type, cap;
/* Allocate structures for this channel */
@@ -150,7 +150,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name,
snd_printk("no memory\n");
return NULL;
}
- p->chset.channels = kcalloc(max_channels, sizeof(snd_midi_channel_t), GFP_KERNEL);
+ p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL);
if (p->chset.channels == NULL) {
snd_printk("no memory\n");
kfree(p);
@@ -190,7 +190,7 @@ snd_emux_create_port(snd_emux_t *emu, char *name,
static void
free_port(void *private_data)
{
- snd_emux_port_t *p;
+ struct snd_emux_port *p;
p = private_data;
if (p) {
@@ -209,7 +209,7 @@ free_port(void *private_data)
* initialize the port specific parameters
*/
static void
-snd_emux_init_port(snd_emux_port_t *p)
+snd_emux_init_port(struct snd_emux_port *p)
{
p->drum_flags = DEFAULT_DRUM_FLAGS;
p->volume_atten = 0;
@@ -222,7 +222,7 @@ snd_emux_init_port(snd_emux_port_t *p)
* reset port
*/
void
-snd_emux_reset_port(snd_emux_port_t *port)
+snd_emux_reset_port(struct snd_emux_port *port)
{
int i;
@@ -241,7 +241,7 @@ snd_emux_reset_port(snd_emux_port_t *port)
port->ctrls[EMUX_MD_REALTIME_PAN] = 1;
for (i = 0; i < port->chset.max_channels; i++) {
- snd_midi_channel_t *chan = port->chset.channels + i;
+ struct snd_midi_channel *chan = port->chset.channels + i;
chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0;
}
}
@@ -251,10 +251,10 @@ snd_emux_reset_port(snd_emux_port_t *port)
* input sequencer event
*/
int
-snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data,
+snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data,
int atomic, int hop)
{
- snd_emux_port_t *port;
+ struct snd_emux_port *port;
port = private_data;
snd_assert(port != NULL && ev != NULL, return -EINVAL);
@@ -269,7 +269,7 @@ snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data,
* increment usage count
*/
int
-snd_emux_inc_count(snd_emux_t *emu)
+snd_emux_inc_count(struct snd_emux *emu)
{
emu->used++;
if (!try_module_get(emu->ops.owner))
@@ -288,7 +288,7 @@ snd_emux_inc_count(snd_emux_t *emu)
* decrease usage count
*/
void
-snd_emux_dec_count(snd_emux_t *emu)
+snd_emux_dec_count(struct snd_emux *emu)
{
module_put(emu->card->module);
emu->used--;
@@ -302,10 +302,10 @@ snd_emux_dec_count(snd_emux_t *emu)
* Routine that is called upon a first use of a particular port
*/
static int
-snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info)
+snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info)
{
- snd_emux_port_t *p;
- snd_emux_t *emu;
+ struct snd_emux_port *p;
+ struct snd_emux *emu;
p = private_data;
snd_assert(p != NULL, return -EINVAL);
@@ -323,10 +323,10 @@ snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info)
* Routine that is called upon the last unuse() of a particular port.
*/
static int
-snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info)
+snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
{
- snd_emux_port_t *p;
- snd_emux_t *emu;
+ struct snd_emux_port *p;
+ struct snd_emux *emu;
p = private_data;
snd_assert(p != NULL, return -EINVAL);
@@ -345,10 +345,10 @@ snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info)
* Create a sequencer client
*/
static int
-get_client(snd_card_t *card, int index, char *name)
+get_client(struct snd_card *card, int index, char *name)
{
- snd_seq_client_callback_t callbacks;
- snd_seq_client_info_t cinfo;
+ struct snd_seq_client_callback callbacks;
+ struct snd_seq_client_info cinfo;
int client;
memset(&callbacks, 0, sizeof(callbacks));
@@ -374,7 +374,7 @@ get_client(snd_card_t *card, int index, char *name)
/*
* attach virtual rawmidi devices
*/
-int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card)
+int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)
{
int i;
@@ -382,13 +382,13 @@ int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card)
if (emu->midi_ports <= 0)
return 0;
- emu->vmidi = kcalloc(emu->midi_ports, sizeof(snd_rawmidi_t*), GFP_KERNEL);
+ emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL);
if (emu->vmidi == NULL)
return -ENOMEM;
for (i = 0; i < emu->midi_ports; i++) {
- snd_rawmidi_t *rmidi;
- snd_virmidi_dev_t *rdev;
+ struct snd_rawmidi *rmidi;
+ struct snd_virmidi_dev *rdev;
if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0)
goto __error;
rdev = rmidi->private_data;
@@ -411,7 +411,7 @@ __error:
return -ENOMEM;
}
-int snd_emux_delete_virmidi(snd_emux_t *emu)
+int snd_emux_delete_virmidi(struct snd_emux *emu)
{
int i;
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c
index bd71b73be657..c387a83a655e 100644
--- a/sound/synth/emux/emux_synth.c
+++ b/sound/synth/emux/emux_synth.c
@@ -36,30 +36,34 @@
#define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0)
#define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0)
-static int get_zone(snd_emux_t *emu, snd_emux_port_t *port, int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table);
-static int get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan);
-static void terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free);
-static void exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass);
-static void terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free);
-static void update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update);
-static void setup_voice(snd_emux_voice_t *vp);
-static int calc_pan(snd_emux_voice_t *vp);
-static int calc_volume(snd_emux_voice_t *vp);
-static int calc_pitch(snd_emux_voice_t *vp);
+static int get_zone(struct snd_emux *emu, struct snd_emux_port *port,
+ int *notep, int vel, struct snd_midi_channel *chan,
+ struct snd_sf_zone **table);
+static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan);
+static void terminate_note1(struct snd_emux *emu, int note,
+ struct snd_midi_channel *chan, int free);
+static void exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port,
+ int exclass);
+static void terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free);
+static void update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update);
+static void setup_voice(struct snd_emux_voice *vp);
+static int calc_pan(struct snd_emux_voice *vp);
+static int calc_volume(struct snd_emux_voice *vp);
+static int calc_pitch(struct snd_emux_voice *vp);
/*
* Start a note.
*/
void
-snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
+snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
{
- snd_emux_t *emu;
+ struct snd_emux *emu;
int i, key, nvoices;
- snd_emux_voice_t *vp;
- snd_sf_zone_t *table[SNDRV_EMUX_MAX_MULTI_VOICES];
+ struct snd_emux_voice *vp;
+ struct snd_sf_zone *table[SNDRV_EMUX_MAX_MULTI_VOICES];
unsigned long flags;
- snd_emux_port_t *port;