mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-14 04:41:26 +00:00
[ALSA] Remove xxx_t typedefs: OPL3
Modules: OPL3,Raw OPL FM Remove xxx_t typedefs from the OPL3 driver Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
e1fad17bb4
commit
5b1646a8ec
@ -29,16 +29,16 @@
|
||||
#define SNDRV_DM_FM_MODE_OPL2 0x00
|
||||
#define SNDRV_DM_FM_MODE_OPL3 0x01
|
||||
|
||||
typedef struct snd_dm_fm_info {
|
||||
struct snd_dm_fm_info {
|
||||
unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
|
||||
unsigned char rhythm; /* percussion mode flag */
|
||||
} snd_dm_fm_info_t;
|
||||
};
|
||||
|
||||
/*
|
||||
* Data structure composing an FM "note" or sound event.
|
||||
*/
|
||||
|
||||
typedef struct snd_dm_fm_voice {
|
||||
struct snd_dm_fm_voice {
|
||||
unsigned char op; /* operator cell (0 or 1) */
|
||||
unsigned char voice; /* FM voice (0 to 17) */
|
||||
|
||||
@ -60,25 +60,25 @@ typedef struct snd_dm_fm_voice {
|
||||
unsigned char left; /* stereo left */
|
||||
unsigned char right; /* stereo right */
|
||||
unsigned char waveform; /* 3 bits: waveform shape */
|
||||
} snd_dm_fm_voice_t;
|
||||
};
|
||||
|
||||
/*
|
||||
* This describes an FM note by its voice, octave, frequency number (10bit)
|
||||
* and key on/off.
|
||||
*/
|
||||
|
||||
typedef struct snd_dm_fm_note {
|
||||
struct snd_dm_fm_note {
|
||||
unsigned char voice; /* 0-17 voice channel */
|
||||
unsigned char octave; /* 3 bits: what octave to play */
|
||||
unsigned int fnum; /* 10 bits: frequency number */
|
||||
unsigned char key_on; /* set for active, clear for silent */
|
||||
} snd_dm_fm_note_t;
|
||||
};
|
||||
|
||||
/*
|
||||
* FM parameters that apply globally to all voices, and thus are not "notes"
|
||||
*/
|
||||
|
||||
typedef struct snd_dm_fm_params {
|
||||
struct snd_dm_fm_params {
|
||||
unsigned char am_depth; /* amplitude modulation depth (1=hi) */
|
||||
unsigned char vib_depth; /* vibrato depth (1=hi) */
|
||||
unsigned char kbd_split; /* keyboard split */
|
||||
@ -90,17 +90,17 @@ typedef struct snd_dm_fm_params {
|
||||
unsigned char tomtom;
|
||||
unsigned char cymbal;
|
||||
unsigned char hihat;
|
||||
} snd_dm_fm_params_t;
|
||||
};
|
||||
|
||||
/*
|
||||
* FM mode ioctl settings
|
||||
*/
|
||||
|
||||
#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, snd_dm_fm_info_t)
|
||||
#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)
|
||||
#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
|
||||
#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, snd_dm_fm_note_t)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, snd_dm_fm_voice_t)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, snd_dm_fm_params_t)
|
||||
#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
|
||||
/* for OPL3 only */
|
||||
#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
|
||||
|
@ -237,12 +237,12 @@
|
||||
#define MAX_OPL2_VOICES 9
|
||||
#define MAX_OPL3_VOICES 18
|
||||
|
||||
typedef struct snd_opl3 opl3_t;
|
||||
struct snd_opl3;
|
||||
|
||||
/*
|
||||
* A structure to keep track of each hardware voice
|
||||
*/
|
||||
typedef struct snd_opl3_voice {
|
||||
struct snd_opl3_voice {
|
||||
int state; /* status */
|
||||
#define SNDRV_OPL3_ST_OFF 0 /* Not playing */
|
||||
#define SNDRV_OPL3_ST_ON_2OP 1 /* 2op voice is allocated */
|
||||
@ -257,8 +257,8 @@ typedef struct snd_opl3_voice {
|
||||
|
||||
unsigned char keyon_reg; /* KON register shadow */
|
||||
|
||||
snd_midi_channel_t *chan; /* Midi channel for this note */
|
||||
} snd_opl3_voice_t;
|
||||
struct snd_midi_channel *chan; /* Midi channel for this note */
|
||||
};
|
||||
|
||||
struct snd_opl3 {
|
||||
unsigned long l_port;
|
||||
@ -267,18 +267,18 @@ struct snd_opl3 {
|
||||
struct resource *res_r_port;
|
||||
unsigned short hardware;
|
||||
/* hardware access */
|
||||
void (*command) (opl3_t * opl3, unsigned short cmd, unsigned char val);
|
||||
void (*command) (struct snd_opl3 * opl3, unsigned short cmd, unsigned char val);
|
||||
unsigned short timer_enable;
|
||||
int seq_dev_num; /* sequencer device number */
|
||||
snd_timer_t *timer1;
|
||||
snd_timer_t *timer2;
|
||||
struct snd_timer *timer1;
|
||||
struct snd_timer *timer2;
|
||||
spinlock_t timer_lock;
|
||||
|
||||
void *private_data;
|
||||
void (*private_free)(opl3_t *);
|
||||
void (*private_free)(struct snd_opl3 *);
|
||||
|
||||
spinlock_t reg_lock;
|
||||
snd_card_t *card; /* The card that this belongs to */
|
||||
struct snd_card *card; /* The card that this belongs to */
|
||||
int used; /* usage flag - exclusive */
|
||||
unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
|
||||
unsigned char rhythm; /* percussion mode flag */
|
||||
@ -289,18 +289,18 @@ struct snd_opl3 {
|
||||
int synth_mode; /* synth mode */
|
||||
int seq_client;
|
||||
|
||||
snd_seq_device_t *seq_dev; /* sequencer device */
|
||||
snd_midi_channel_set_t * chset;
|
||||
struct snd_seq_device *seq_dev; /* sequencer device */
|
||||
struct snd_midi_channel_set * chset;
|
||||
|
||||
#ifdef CONFIG_SND_SEQUENCER_OSS
|
||||
snd_seq_device_t *oss_seq_dev; /* OSS sequencer device */
|
||||
snd_midi_channel_set_t * oss_chset;
|
||||
struct snd_seq_device *oss_seq_dev; /* OSS sequencer device */
|
||||
struct snd_midi_channel_set * oss_chset;
|
||||
#endif
|
||||
|
||||
snd_seq_kinstr_ops_t fm_ops;
|
||||
snd_seq_kinstr_list_t *ilist;
|
||||
struct snd_seq_kinstr_ops fm_ops;
|
||||
struct snd_seq_kinstr_list *ilist;
|
||||
|
||||
snd_opl3_voice_t voices[MAX_OPL3_VOICES]; /* Voices (OPL3 'channel') */
|
||||
struct snd_opl3_voice voices[MAX_OPL3_VOICES]; /* Voices (OPL3 'channel') */
|
||||
int use_time; /* allocation counter */
|
||||
|
||||
unsigned short connection_reg; /* connection reg shadow */
|
||||
@ -316,24 +316,25 @@ struct snd_opl3 {
|
||||
};
|
||||
|
||||
/* opl3.c */
|
||||
void snd_opl3_interrupt(snd_hwdep_t * hw);
|
||||
int snd_opl3_new(snd_card_t *card, unsigned short hardware, opl3_t **ropl3);
|
||||
int snd_opl3_init(opl3_t *opl3);
|
||||
int snd_opl3_create(snd_card_t * card,
|
||||
void snd_opl3_interrupt(struct snd_hwdep * hw);
|
||||
int snd_opl3_new(struct snd_card *card, unsigned short hardware,
|
||||
struct snd_opl3 **ropl3);
|
||||
int snd_opl3_init(struct snd_opl3 *opl3);
|
||||
int snd_opl3_create(struct snd_card *card,
|
||||
unsigned long l_port, unsigned long r_port,
|
||||
unsigned short hardware,
|
||||
int integrated,
|
||||
opl3_t ** opl3);
|
||||
int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev);
|
||||
int snd_opl3_hwdep_new(opl3_t * opl3, int device, int seq_device,
|
||||
snd_hwdep_t ** rhwdep);
|
||||
struct snd_opl3 ** opl3);
|
||||
int snd_opl3_timer_new(struct snd_opl3 * opl3, int timer1_dev, int timer2_dev);
|
||||
int snd_opl3_hwdep_new(struct snd_opl3 * opl3, int device, int seq_device,
|
||||
struct snd_hwdep ** rhwdep);
|
||||
|
||||
/* opl3_synth */
|
||||
int snd_opl3_open(snd_hwdep_t * hw, struct file *file);
|
||||
int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
int snd_opl3_open(struct snd_hwdep * hw, struct file *file);
|
||||
int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
|
||||
unsigned int cmd, unsigned long arg);
|
||||
int snd_opl3_release(snd_hwdep_t * hw, struct file *file);
|
||||
int snd_opl3_release(struct snd_hwdep * hw, struct file *file);
|
||||
|
||||
void snd_opl3_reset(opl3_t * opl3);
|
||||
void snd_opl3_reset(struct snd_opl3 * opl3);
|
||||
|
||||
#endif /* __SOUND_OPL3_H */
|
||||
|
@ -45,7 +45,7 @@ static char snd_opl3_drum_table[47] =
|
||||
OPL3_CYMBAL_ON, OPL3_CYMBAL_ON /* 80 - 81 */
|
||||
};
|
||||
|
||||
typedef struct snd_opl3_drum_voice {
|
||||
struct snd_opl3_drum_voice {
|
||||
int voice;
|
||||
int op;
|
||||
unsigned char am_vib;
|
||||
@ -54,33 +54,34 @@ typedef struct snd_opl3_drum_voice {
|
||||
unsigned char sustain_release;
|
||||
unsigned char feedback_connection;
|
||||
unsigned char wave_select;
|
||||
} snd_opl3_drum_voice_t;
|
||||
};
|
||||
|
||||
typedef struct snd_opl3_drum_note {
|
||||
struct snd_opl3_drum_note {
|
||||
int voice;
|
||||
unsigned char fnum;
|
||||
unsigned char octave_f;
|
||||
unsigned char feedback_connection;
|
||||
} snd_opl3_drum_note_t;
|
||||
};
|
||||
|
||||
static snd_opl3_drum_voice_t bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00};
|
||||
static snd_opl3_drum_voice_t bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00};
|
||||
static snd_opl3_drum_note_t bass_note = {6, 0x90, 0x09};
|
||||
static struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00};
|
||||
static struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00};
|
||||
static struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09};
|
||||
|
||||
static snd_opl3_drum_voice_t hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00};
|
||||
static struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00};
|
||||
|
||||
static snd_opl3_drum_voice_t snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02};
|
||||
static snd_opl3_drum_note_t snare_note = {7, 0xf4, 0x0d};
|
||||
static struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02};
|
||||
static struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d};
|
||||
|
||||
static snd_opl3_drum_voice_t tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00};
|
||||
static snd_opl3_drum_note_t tomtom_note = {8, 0xf4, 0x09};
|
||||
static struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00};
|
||||
static struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09};
|
||||
|
||||
static snd_opl3_drum_voice_t cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00};
|
||||
static struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00};
|
||||
|
||||
/*
|
||||
* set drum voice characteristics
|
||||
*/
|
||||
static void snd_opl3_drum_voice_set(opl3_t *opl3, snd_opl3_drum_voice_t *data)
|
||||
static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3,
|
||||
struct snd_opl3_drum_voice *data)
|
||||
{
|
||||
unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
|
||||
unsigned char voice_offset = data->voice;
|
||||
@ -114,7 +115,8 @@ static void snd_opl3_drum_voice_set(opl3_t *opl3, snd_opl3_drum_voice_t *data)
|
||||
/*
|
||||
* Set drum voice pitch
|
||||
*/
|
||||
static void snd_opl3_drum_note_set(opl3_t *opl3, snd_opl3_drum_note_t *data)
|
||||
static void snd_opl3_drum_note_set(struct snd_opl3 *opl3,
|
||||
struct snd_opl3_drum_note *data)
|
||||
{
|
||||
unsigned char voice_offset = data->voice;
|
||||
unsigned short opl3_reg;
|
||||
@ -131,8 +133,9 @@ static void snd_opl3_drum_note_set(opl3_t *opl3, snd_opl3_drum_note_t *data)
|
||||
/*
|
||||
* Set drum voice volume and position
|
||||
*/
|
||||
static void snd_opl3_drum_vol_set(opl3_t *opl3, snd_opl3_drum_voice_t *data,
|
||||
int vel, snd_midi_channel_t *chan)
|
||||
static void snd_opl3_drum_vol_set(struct snd_opl3 *opl3,
|
||||
struct snd_opl3_drum_voice *data,
|
||||
int vel, struct snd_midi_channel *chan)
|
||||
{
|
||||
unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
|
||||
unsigned char voice_offset = data->voice;
|
||||
@ -159,7 +162,7 @@ static void snd_opl3_drum_vol_set(opl3_t *opl3, snd_opl3_drum_voice_t *data,
|
||||
/*
|
||||
* Loads drum voices at init time
|
||||
*/
|
||||
void snd_opl3_load_drums(opl3_t *opl3)
|
||||
void snd_opl3_load_drums(struct snd_opl3 *opl3)
|
||||
{
|
||||
snd_opl3_drum_voice_set(opl3, &bass_op0);
|
||||
snd_opl3_drum_voice_set(opl3, &bass_op1);
|
||||
@ -179,11 +182,11 @@ void snd_opl3_load_drums(opl3_t *opl3)
|
||||
/*
|
||||
* Switch drum voice on or off
|
||||
*/
|
||||
void snd_opl3_drum_switch(opl3_t *opl3, int note, int vel, int on_off,
|
||||
snd_midi_channel_t *chan)
|
||||
void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off,
|
||||
struct snd_midi_channel *chan)
|
||||
{
|
||||
unsigned char drum_mask;
|
||||
snd_opl3_drum_voice_t *drum_voice;
|
||||
struct snd_opl3_drum_voice *drum_voice;
|
||||
|
||||
if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE))
|
||||
return;
|
||||
|
@ -37,7 +37,7 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
|
||||
|
||||
static void snd_opl2_command(opl3_t * opl3, unsigned short cmd, unsigned char val)
|
||||
static void snd_opl2_command(struct snd_opl3 * opl3, unsigned short cmd, unsigned char val)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long port;
|
||||
@ -60,7 +60,7 @@ static void snd_opl2_command(opl3_t * opl3, unsigned short cmd, unsigned char va
|
||||
spin_unlock_irqrestore(&opl3->reg_lock, flags);
|
||||
}
|
||||
|
||||
static void snd_opl3_command(opl3_t * opl3, unsigned short cmd, unsigned char val)
|
||||
static void snd_opl3_command(struct snd_opl3 * opl3, unsigned short cmd, unsigned char val)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long port;
|
||||
@ -85,7 +85,7 @@ static void snd_opl3_command(opl3_t * opl3, unsigned short cmd, unsigned char va
|
||||
spin_unlock_irqrestore(&opl3->reg_lock, flags);
|
||||
}
|
||||
|
||||
static int snd_opl3_detect(opl3_t * opl3)
|
||||
static int snd_opl3_detect(struct snd_opl3 * opl3)
|
||||
{
|
||||
/*
|
||||
* This function returns 1 if the FM chip is present at the given I/O port
|
||||
@ -153,12 +153,12 @@ static int snd_opl3_detect(opl3_t * opl3)
|
||||
* Timer 1 - 80us
|
||||
*/
|
||||
|
||||
static int snd_opl3_timer1_start(snd_timer_t * timer)
|
||||
static int snd_opl3_timer1_start(struct snd_timer * timer)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned char tmp;
|
||||
unsigned int ticks;
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = snd_timer_chip(timer);
|
||||
spin_lock_irqsave(&opl3->timer_lock, flags);
|
||||
@ -171,11 +171,11 @@ static int snd_opl3_timer1_start(snd_timer_t * timer)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_timer1_stop(snd_timer_t * timer)
|
||||
static int snd_opl3_timer1_stop(struct snd_timer * timer)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned char tmp;
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = snd_timer_chip(timer);
|
||||
spin_lock_irqsave(&opl3->timer_lock, flags);
|
||||
@ -190,12 +190,12 @@ static int snd_opl3_timer1_stop(snd_timer_t * timer)
|
||||
* Timer 2 - 320us
|
||||
*/
|
||||
|
||||
static int snd_opl3_timer2_start(snd_timer_t * timer)
|
||||
static int snd_opl3_timer2_start(struct snd_timer * timer)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned char tmp;
|
||||
unsigned int ticks;
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = snd_timer_chip(timer);
|
||||
spin_lock_irqsave(&opl3->timer_lock, flags);
|
||||
@ -208,11 +208,11 @@ static int snd_opl3_timer2_start(snd_timer_t * timer)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_timer2_stop(snd_timer_t * timer)
|
||||
static int snd_opl3_timer2_stop(struct snd_timer * timer)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned char tmp;
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = snd_timer_chip(timer);
|
||||
spin_lock_irqsave(&opl3->timer_lock, flags);
|
||||
@ -227,7 +227,7 @@ static int snd_opl3_timer2_stop(snd_timer_t * timer)
|
||||
|
||||
*/
|
||||
|
||||
static struct _snd_timer_hardware snd_opl3_timer1 =
|
||||
static struct snd_timer_hardware snd_opl3_timer1 =
|
||||
{
|
||||
.flags = SNDRV_TIMER_HW_STOP,
|
||||
.resolution = 80000,
|
||||
@ -236,7 +236,7 @@ static struct _snd_timer_hardware snd_opl3_timer1 =
|
||||
.stop = snd_opl3_timer1_stop,
|
||||
};
|
||||
|
||||
static struct _snd_timer_hardware snd_opl3_timer2 =
|
||||
static struct snd_timer_hardware snd_opl3_timer2 =
|
||||
{
|
||||
.flags = SNDRV_TIMER_HW_STOP,
|
||||
.resolution = 320000,
|
||||
@ -245,10 +245,10 @@ static struct _snd_timer_hardware snd_opl3_timer2 =
|
||||
.stop = snd_opl3_timer2_stop,
|
||||
};
|
||||
|
||||
static int snd_opl3_timer1_init(opl3_t * opl3, int timer_no)
|
||||
static int snd_opl3_timer1_init(struct snd_opl3 * opl3, int timer_no)
|
||||
{
|
||||
snd_timer_t *timer = NULL;
|
||||
snd_timer_id_t tid;
|
||||
struct snd_timer *timer = NULL;
|
||||
struct snd_timer_id tid;
|
||||
int err;
|
||||
|
||||
tid.dev_class = SNDRV_TIMER_CLASS_CARD;
|
||||
@ -265,10 +265,10 @@ static int snd_opl3_timer1_init(opl3_t * opl3, int timer_no)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int snd_opl3_timer2_init(opl3_t * opl3, int timer_no)
|
||||
static int snd_opl3_timer2_init(struct snd_opl3 * opl3, int timer_no)
|
||||
{
|
||||
snd_timer_t *timer = NULL;
|
||||
snd_timer_id_t tid;
|
||||
struct snd_timer *timer = NULL;
|
||||
struct snd_timer_id tid;
|
||||
int err;
|
||||
|
||||
tid.dev_class = SNDRV_TIMER_CLASS_CARD;
|
||||
@ -289,11 +289,11 @@ static int snd_opl3_timer2_init(opl3_t * opl3, int timer_no)
|
||||
|
||||
*/
|
||||
|
||||
void snd_opl3_interrupt(snd_hwdep_t * hw)
|
||||
void snd_opl3_interrupt(struct snd_hwdep * hw)
|
||||
{
|
||||
unsigned char status;
|
||||
opl3_t *opl3;
|
||||
snd_timer_t *timer;
|
||||
struct snd_opl3 *opl3;
|
||||
struct snd_timer *timer;
|
||||
|
||||
if (hw == NULL)
|
||||
return;
|
||||
@ -320,7 +320,7 @@ void snd_opl3_interrupt(snd_hwdep_t * hw)
|
||||
|
||||
*/
|
||||
|
||||
static int snd_opl3_free(opl3_t *opl3)
|
||||
static int snd_opl3_free(struct snd_opl3 *opl3)
|
||||
{
|
||||
snd_assert(opl3 != NULL, return -ENXIO);
|
||||
if (opl3->private_free)
|
||||
@ -331,20 +331,20 @@ static int snd_opl3_free(opl3_t *opl3)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_dev_free(snd_device_t *device)
|
||||
static int snd_opl3_dev_free(struct snd_device *device)
|
||||
{
|
||||
opl3_t *opl3 = device->device_data;
|
||||
struct snd_opl3 *opl3 = device->device_data;
|
||||
return snd_opl3_free(opl3);
|
||||
}
|
||||
|
||||
int snd_opl3_new(snd_card_t *card,
|
||||
int snd_opl3_new(struct snd_card *card,
|
||||
unsigned short hardware,
|
||||
opl3_t **ropl3)
|
||||
struct snd_opl3 **ropl3)
|
||||
{
|
||||
static snd_device_ops_t ops = {
|
||||
static struct snd_device_ops ops = {
|
||||
.dev_free = snd_opl3_dev_free,
|
||||
};
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
int err;
|
||||
|
||||
*ropl3 = NULL;
|
||||
@ -367,7 +367,7 @@ int snd_opl3_new(snd_card_t *card,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_opl3_init(opl3_t *opl3)
|
||||
int snd_opl3_init(struct snd_opl3 *opl3)
|
||||
{
|
||||
if (! opl3->command) {
|
||||
printk(KERN_ERR "snd_opl3_init: command not defined!\n");
|
||||
@ -391,14 +391,14 @@ int snd_opl3_init(opl3_t *opl3)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_opl3_create(snd_card_t * card,
|
||||
int snd_opl3_create(struct snd_card *card,
|
||||
unsigned long l_port,
|
||||
unsigned long r_port,
|
||||
unsigned short hardware,
|
||||
int integrated,
|
||||
opl3_t ** ropl3)
|
||||
struct snd_opl3 ** ropl3)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
int err;
|
||||
|
||||
*ropl3 = NULL;
|
||||
@ -449,7 +449,7 @@ int snd_opl3_create(snd_card_t * card,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev)
|
||||
int snd_opl3_timer_new(struct snd_opl3 * opl3, int timer1_dev, int timer2_dev)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -466,12 +466,12 @@ int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_opl3_hwdep_new(opl3_t * opl3,
|
||||
int snd_opl3_hwdep_new(struct snd_opl3 * opl3,
|
||||
int device, int seq_device,
|
||||
snd_hwdep_t ** rhwdep)
|
||||
struct snd_hwdep ** rhwdep)
|
||||
{
|
||||
snd_hwdep_t *hw;
|
||||
snd_card_t *card = opl3->card;
|
||||
struct snd_hwdep *hw;
|
||||
struct snd_card *card = opl3->card;
|
||||
int err;
|
||||
|
||||
if (rhwdep)
|
||||
@ -514,9 +514,9 @@ int snd_opl3_hwdep_new(opl3_t * opl3,
|
||||
opl3->seq_dev_num = seq_device;
|
||||
#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
|
||||
if (snd_seq_device_new(card, seq_device, SNDRV_SEQ_DEV_ID_OPL3,
|
||||
sizeof(opl3_t*), &opl3->seq_dev) >= 0) {
|
||||
sizeof(struct snd_opl3 *), &opl3->seq_dev) >= 0) {
|
||||
strcpy(opl3->seq_dev->name, hw->name);
|
||||
*(opl3_t**)SNDRV_SEQ_DEVICE_ARGPTR(opl3->seq_dev) = opl3;
|
||||
*(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(opl3->seq_dev) = opl3;
|
||||
}
|
||||
#endif
|
||||
if (rhwdep)
|
||||
|
@ -60,7 +60,7 @@ static char opl3_volume_table[128] =
|
||||
};
|
||||
|
||||
void snd_opl3_calc_volume(unsigned char *volbyte, int vel,
|
||||
snd_midi_channel_t *chan)
|
||||
struct snd_midi_channel *chan)
|
||||
{
|
||||
int oldvol, newvol, n;
|
||||
int volume;
|
||||
@ -93,7 +93,7 @@ static short opl3_note_table[16] =
|
||||
};
|
||||
|
||||
static void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum,
|
||||
int note, snd_midi_channel_t *chan)
|
||||
int note, struct snd_midi_channel *chan)
|
||||
{
|
||||
int block = ((note / 12) & 0x07) - 1;
|
||||
int idx = (note % 12) + 2;
|
||||
@ -121,7 +121,7 @@ static void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum,
|
||||
|
||||
|
||||
#ifdef DEBUG_ALLOC
|
||||
static void debug_alloc(opl3_t *opl3, char *s, int voice) {
|
||||
static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {
|
||||
int i;
|
||||
char *str = "x.24";
|
||||
|
||||
@ -135,12 +135,12 @@ static void debug_alloc(opl3_t *opl3, char *s, int voice) {
|
||||
/*
|
||||
* Get a FM voice (channel) to play a note on.
|
||||
*/
|
||||
static int opl3_get_voice(opl3_t *opl3, int instr_4op,
|
||||
snd_midi_channel_t *chan) {
|
||||
static int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op,
|
||||
struct snd_midi_channel *chan) {
|
||||
int chan_4op_1; /* first voice for 4op instrument */
|
||||
int chan_4op_2; /* second voice for 4op instrument */
|
||||
|
||||
snd_opl3_voice_t *vp, *vp2;
|
||||
struct snd_opl3_voice *vp, *vp2;
|
||||
unsigned int voice_time;
|
||||
int i;
|
||||
|
||||
@ -237,13 +237,13 @@ static int opl3_get_voice(opl3_t *opl3, int instr_4op,
|
||||
void snd_opl3_timer_func(unsigned long data)
|
||||
{
|
||||
|
||||
opl3_t *opl3 = (opl3_t *)data;
|
||||
struct snd_opl3 *opl3 = (struct snd_opl3 *)data;
|
||||
int again = 0;
|
||||
int i;
|
||||
|
||||
spin_lock(&opl3->sys_timer_lock);
|
||||
for (i = 0; i < opl3->max_voices; i++) {
|
||||
snd_opl3_voice_t *vp = &opl3->voices[i];
|
||||
struct snd_opl3_voice *vp = &opl3->voices[i];
|
||||
if (vp->state > 0 && vp->note_off_check) {
|
||||
if (vp->note_off == jiffies)
|
||||
snd_opl3_note_off(opl3, vp->note, 0, vp->chan);
|
||||
@ -263,7 +263,7 @@ void snd_opl3_timer_func(unsigned long data)
|
||||
/*
|
||||
* Start system timer
|
||||
*/
|
||||
static void snd_opl3_start_timer(opl3_t *opl3)
|
||||
static void snd_opl3_start_timer(struct snd_opl3 *opl3)
|
||||
{
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave(&opl3->sys_timer_lock, flags);
|
||||
@ -285,15 +285,15 @@ static int snd_opl3_oss_map[MAX_OPL3_VOICES] = {
|
||||
/*
|
||||
* Start a note.
|
||||
*/
|
||||
void snd_opl3_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
snd_seq_instr_t wanted;
|
||||
snd_seq_kinstr_t *kinstr;
|
||||
struct snd_opl3 *opl3;
|
||||
struct snd_seq_instr wanted;
|
||||
struct snd_seq_kinstr *kinstr;
|
||||
int instr_4op;
|
||||
|
||||
int voice;
|
||||
snd_opl3_voice_t *vp, *vp2;
|
||||
struct snd_opl3_voice *vp, *vp2;
|
||||
unsigned short connect_mask;
|
||||
unsigned char connection;
|
||||
unsigned char vol_op[4];
|
||||
@ -310,7 +310,7 @@ void snd_opl3_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
unsigned char fnum, blocknum;
|
||||
int i;
|
||||
|
||||
fm_instrument_t *fm;
|
||||
struct fm_instrument *fm;
|
||||
unsigned long flags;
|
||||
|
||||
opl3 = p;
|
||||
@ -615,13 +615,13 @@ void snd_opl3_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
spin_unlock_irqrestore(&opl3->voice_lock, flags);
|
||||
}
|
||||
|
||||
static void snd_opl3_kill_voice(opl3_t *opl3, int voice)
|
||||
static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
|
||||
{
|
||||
unsigned short reg_side;
|
||||
unsigned char voice_offset;
|
||||
unsigned short opl3_reg;
|
||||
|
||||
snd_opl3_voice_t *vp, *vp2;
|
||||
struct snd_opl3_voice *vp, *vp2;
|
||||
|
||||
snd_assert(voice < MAX_OPL3_VOICES, return);
|
||||
|
||||
@ -663,12 +663,12 @@ static void snd_opl3_kill_voice(opl3_t *opl3, int voice)
|
||||
/*
|
||||
* Release a note in response to a midi note off.
|
||||
*/
|
||||
void snd_opl3_note_off(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
int voice;
|
||||
snd_opl3_voice_t *vp;
|
||||
struct snd_opl3_voice *vp;
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
@ -708,9 +708,9 @@ void snd_opl3_note_off(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
/*
|
||||
* key pressure change
|
||||
*/
|
||||
void snd_opl3_key_press(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = p;
|
||||
#ifdef DEBUG_MIDI
|
||||
@ -722,9 +722,9 @@ void snd_opl3_key_press(void *p, int note, int vel, snd_midi_channel_t *chan)
|
||||
/*
|
||||
* terminate note
|
||||
*/
|
||||
void snd_opl3_terminate_note(void *p, int note, snd_midi_channel_t *chan)
|
||||
void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = p;
|
||||
#ifdef DEBUG_MIDI
|
||||
@ -733,7 +733,7 @@ void snd_opl3_terminate_note(void *p, int note, snd_midi_channel_t *chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void snd_opl3_update_pitch(opl3_t *opl3, int voice)
|
||||
static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)
|
||||
{
|
||||
unsigned short reg_side;
|
||||
unsigned char voice_offset;
|
||||
@ -741,7 +741,7 @@ static void snd_opl3_update_pitch(opl3_t *opl3, int voice)
|
||||
|
||||
unsigned char fnum, blocknum;
|
||||
|
||||
snd_opl3_voice_t *vp;
|
||||
struct snd_opl3_voice *vp;
|
||||
|
||||
snd_assert(voice < MAX_OPL3_VOICES, return);
|
||||
|
||||
@ -780,10 +780,10 @@ static void snd_opl3_update_pitch(opl3_t *opl3, int voice)
|
||||
/*
|
||||
* Update voice pitch controller
|
||||
*/
|
||||
static void snd_opl3_pitch_ctrl(opl3_t *opl3, snd_midi_channel_t *chan)
|
||||
static void snd_opl3_pitch_ctrl(struct snd_opl3 *opl3, struct snd_midi_channel *chan)
|
||||
{
|
||||
int voice;
|
||||
snd_opl3_voice_t *vp;
|
||||
struct snd_opl3_voice *vp;
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
@ -810,9 +810,9 @@ static void snd_opl3_pitch_ctrl(opl3_t *opl3, snd_midi_channel_t *chan)
|
||||
* Deal with a controler type event. This includes all types of
|
||||
* control events, not just the midi controllers
|
||||
*/
|
||||
void snd_opl3_control(void *p, int type, snd_midi_channel_t *chan)
|
||||
void snd_opl3_control(void *p, int type, struct snd_midi_channel *chan)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = p;
|
||||
#ifdef DEBUG_MIDI
|
||||
@ -846,10 +846,10 @@ void snd_opl3_control(void *p, int type, snd_midi_channel_t *chan)
|
||||
/*
|
||||
* NRPN events
|
||||
*/
|
||||
void snd_opl3_nrpn(void *p, snd_midi_channel_t *chan,
|
||||
snd_midi_channel_set_t *chset)
|
||||
void snd_opl3_nrpn(void *p, struct snd_midi_channel *chan,
|
||||
struct snd_midi_channel_set *chset)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = p;
|
||||
#ifdef DEBUG_MIDI
|
||||
@ -862,9 +862,9 @@ void snd_opl3_nrpn(void *p, snd_midi_channel_t *chan,
|
||||
* receive sysex
|
||||
*/
|
||||
void snd_opl3_sysex(void *p, unsigned char *buf, int len,
|
||||
int parsed, snd_midi_channel_set_t *chset)
|
||||
int parsed, struct snd_midi_channel_set *chset)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = p;
|
||||
#ifdef DEBUG_MIDI
|
||||
|
@ -21,11 +21,11 @@
|
||||
#include "opl3_voice.h"
|
||||
#include <linux/slab.h>
|
||||
|
||||
static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure);
|
||||
static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg);
|
||||
static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg);
|
||||
static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count);
|
||||
static int snd_opl3_reset_seq_oss(snd_seq_oss_arg_t *arg);
|
||||
static int snd_opl3_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure);
|
||||
static int snd_opl3_close_seq_oss(struct snd_seq_oss_arg *arg);
|
||||
static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg);
|
||||
static int snd_opl3_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format, const char __user *buf, int offs, int count);
|
||||
static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg);
|
||||
|
||||
/* */
|
||||
|
||||
@ -43,9 +43,9 @@ static inline void snd_leave_user(mm_segment_t fs)
|
||||
|
||||
/* operators */
|
||||
|
||||
extern snd_midi_op_t opl3_ops;
|
||||
extern struct snd_midi_op opl3_ops;
|
||||
|
||||
static snd_seq_oss_callback_t oss_callback = {
|
||||
static struct snd_seq_oss_callback oss_callback = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = snd_opl3_open_seq_oss,
|
||||
.close = snd_opl3_close_seq_oss,
|
||||
@ -54,10 +54,10 @@ static snd_seq_oss_callback_t oss_callback = {
|
||||
.reset = snd_opl3_reset_seq_oss,
|
||||
};
|
||||
|
||||
static int snd_opl3_oss_event_input(snd_seq_event_t *ev, int direct,
|
||||
static int snd_opl3_oss_event_input(struct snd_seq_event *ev, int direct,
|
||||
void *private_data, int atomic, int hop)
|
||||
{
|
||||
opl3_t *opl3 = private_data;
|
||||
struct snd_opl3 *opl3 = private_data;
|
||||
|
||||
if (ev->type != SNDRV_SEQ_EVENT_OSS)
|
||||
snd_midi_process_event(&opl3_ops, ev, opl3->oss_chset);
|
||||
@ -68,14 +68,14 @@ static int snd_opl3_oss_event_input(snd_seq_event_t *ev, int direct,
|
||||
|
||||
static void snd_opl3_oss_free_port(void *private_data)
|
||||
{
|
||||
opl3_t *opl3 = private_data;
|
||||
struct snd_opl3 *opl3 = private_data;
|
||||
|
||||
snd_midi_channel_free_set(opl3->oss_chset);
|
||||
}
|
||||
|
||||
static int snd_opl3_oss_create_port(opl3_t * opl3)
|
||||
static int snd_opl3_oss_create_port(struct snd_opl3 * opl3)
|
||||
{
|
||||
snd_seq_port_callback_t callbacks;
|
||||
struct snd_seq_port_callback callbacks;
|
||||
char name[32];
|
||||
int voices, opl_ver;
|
||||
|
||||
@ -113,13 +113,13 @@ static int snd_opl3_oss_create_port(opl3_t * opl3)
|
||||
/* ------------------------------ */
|
||||
|
||||
/* register OSS synth */
|
||||
void snd_opl3_init_seq_oss(opl3_t *opl3, char *name)
|
||||
void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name)
|
||||
{
|
||||
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(opl3->card, 0, SNDRV_SEQ_DEV_ID_OSS,
|
||||
sizeof(snd_seq_oss_reg_t), &dev) < 0)
|
||||
sizeof(struct snd_seq_oss_reg), &dev) < 0)
|
||||
return;
|
||||
|
||||
opl3->oss_seq_dev = dev;
|
||||
@ -143,7 +143,7 @@ void snd_opl3_init_seq_oss(opl3_t *opl3, char *name)
|
||||
}
|
||||
|
||||
/* unregister */
|
||||
void snd_opl3_free_seq_oss(opl3_t *opl3)
|
||||
void snd_opl3_free_seq_oss(struct snd_opl3 *opl3)
|
||||
{
|
||||
if (opl3->oss_seq_dev) {
|
||||
snd_device_free(opl3->card, opl3->oss_seq_dev);
|
||||
@ -154,9 +154,9 @@ void snd_opl3_free_seq_oss(opl3_t *opl3)
|
||||
/* ------------------------------ */
|
||||
|
||||
/* open OSS sequencer */
|
||||
static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
|
||||
static int snd_opl3_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
|
||||
{
|
||||
opl3_t *opl3 = closure;
|
||||
struct snd_opl3 *opl3 = closure;
|
||||
int err;
|
||||
|
||||
snd_assert(arg != NULL, return -ENXIO);
|
||||
@ -177,9 +177,9 @@ static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
|
||||
}
|
||||
|
||||
/* close OSS sequencer */
|
||||
static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg)
|
||||
static int snd_opl3_close_seq_oss(struct snd_seq_oss_arg *arg)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
snd_assert(arg != NULL, return -ENXIO);
|
||||
opl3 = arg->private_data;
|
||||
@ -206,10 +206,10 @@ static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg)
|
||||
/* from sound_config.h */
|
||||
#define SBFM_MAXINSTR 256
|
||||
|
||||
static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
|
||||
static int snd_opl3_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
|
||||
const char __user *buf, int offs, int count)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
int err = -EINVAL;
|
||||
|
||||
snd_assert(arg != NULL, return -ENXIO);
|
||||
@ -219,11 +219,11 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
|
||||
struct sbi_instrument sbi;
|
||||
|
||||
size_t size;
|
||||
snd_seq_instr_header_t *put;
|
||||
snd_seq_instr_data_t *data;
|
||||
fm_xinstrument_t *xinstr;
|
||||
struct snd_seq_instr_header *put;
|
||||
struct snd_seq_instr_data *data;
|
||||
struct fm_xinstrument *xinstr;
|
||||
|
||||
snd_seq_event_t ev;
|
||||
struct snd_seq_event ev;
|
||||
int i;
|
||||
|
||||
mm_segment_t fs;
|
||||
@ -240,7 +240,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
size = sizeof(*put) + sizeof(fm_xinstrument_t);
|
||||
size = sizeof(*put) + sizeof(struct fm_xinstrument);
|
||||
put = kzalloc(size, GFP_KERNEL);
|
||||
if (put == NULL)
|
||||
return -ENOMEM;
|
||||
@ -249,7 +249,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
|
||||
data->type = SNDRV_SEQ_INSTR_ATYPE_DATA;
|
||||
strcpy(data->data.format, SNDRV_SEQ_INSTR_ID_OPL2_3);
|
||||
/* build data section */
|
||||
xinstr = (fm_xinstrument_t *)(data + 1);
|
||||
xinstr = (struct fm_xinstrument *)(data + 1);
|
||||
xinstr->stype = FM_STRU_INSTR;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
@ -296,7 +296,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
|
||||
err = snd_seq_instr_event(&opl3->fm_ops, opl3->ilist, &ev,
|
||||
opl3->seq_client, 0, 0);
|
||||
if (err == -EBUSY) {
|
||||
snd_seq_instr_header_t remove;
|
||||
struct snd_seq_instr_header remove;
|
||||
|
||||
memset (&remove, 0, sizeof(remove));
|
||||
remove.cmd = SNDRV_SEQ_INSTR_FREE_CMD_SINGLE;
|
||||
@ -319,10 +319,10 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
|
||||
}
|
||||
|
||||
/* ioctl */
|
||||
static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd,
|
||||
static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
|
||||
unsigned long ioarg)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
snd_assert(arg != NULL, return -ENXIO);
|
||||
opl3 = arg->private_data;
|
||||
@ -345,9 +345,9 @@ static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd,
|
||||
}
|
||||
|
||||
/* reset device */
|
||||
static int snd_opl3_reset_seq_oss(snd_seq_oss_arg_t *arg)
|
||||
static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
snd_assert(arg != NULL, return -ENXIO);
|
||||
opl3 = arg->private_data;
|
||||
|
@ -35,7 +35,7 @@ int use_internal_drums = 0;
|
||||
module_param(use_internal_drums, bool, 0444);
|
||||
MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums.");
|
||||
|
||||
int snd_opl3_synth_use_inc(opl3_t * opl3)
|
||||
int snd_opl3_synth_use_inc(struct snd_opl3 * opl3)
|
||||
{
|
||||
if (!try_module_get(opl3->card->module))
|
||||
return -EFAULT;
|
||||
@ -43,12 +43,12 @@ int snd_opl3_synth_use_inc(opl3_t * opl3)
|
||||
|
||||
}
|
||||
|
||||
void snd_opl3_synth_use_dec(opl3_t * opl3)
|
||||
void snd_opl3_synth_use_dec(struct snd_opl3 * opl3)
|
||||
{
|
||||
module_put(opl3->card->module);
|
||||
}
|
||||
|
||||
int snd_opl3_synth_setup(opl3_t * opl3)
|
||||
int snd_opl3_synth_setup(struct snd_opl3 * opl3)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -78,7 +78,7 @@ int snd_opl3_synth_setup(opl3_t * opl3)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void snd_opl3_synth_cleanup(opl3_t * opl3)
|
||||
void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
@ -96,9 +96,9 @@ void snd_opl3_synth_cleanup(opl3_t * opl3)
|
||||
up(&opl3->access_mutex);
|
||||
}
|
||||
|
||||
static int snd_opl3_synth_use(void *private_data, snd_seq_port_subscribe_t * info)
|
||||
static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info)
|
||||
{
|
||||
opl3_t *opl3 = private_data;
|
||||
struct snd_opl3 *opl3 = private_data;
|
||||
int err;
|
||||
|
||||
if ((err = snd_opl3_synth_setup(opl3)) < 0)
|
||||
@ -123,9 +123,9 @@ static int snd_opl3_synth_use(void *private_data, snd_seq_port_subscribe_t * inf
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_synth_unuse(void *private_data, snd_seq_port_subscribe_t * info)
|
||||
static int snd_opl3_synth_unuse(void *private_data, struct snd_seq_port_subscribe * info)
|
||||
{
|
||||
opl3_t *opl3 = private_data;
|
||||
struct snd_opl3 *opl3 = private_data;
|
||||
|
||||
snd_opl3_synth_cleanup(opl3);
|
||||
|
||||
@ -137,7 +137,7 @@ static int snd_opl3_synth_unuse(void *private_data, snd_seq_port_subscribe_t * i
|
||||
/*
|
||||
* MIDI emulation operators
|
||||
*/
|
||||
snd_midi_op_t opl3_ops = {
|
||||
struct snd_midi_op opl3_ops = {
|
||||
.note_on = snd_opl3_note_on,
|
||||
.note_off = snd_opl3_note_off,
|
||||
.key_press = snd_opl3_key_press,
|
||||
@ -147,10 +147,10 @@ snd_midi_op_t opl3_ops = {
|
||||
.sysex = snd_opl3_sysex,
|
||||
};
|
||||
|
||||
static int snd_opl3_synth_event_input(snd_seq_event_t * ev, int direct,
|
||||
static int snd_opl3_synth_event_input(struct snd_seq_event * ev, int direct,
|
||||
void *private_data, int atomic, int hop)
|
||||
{
|
||||
opl3_t *opl3 = private_data;
|
||||
struct snd_opl3 *opl3 = private_data;
|
||||
|
||||
if (ev->type >= SNDRV_SEQ_EVENT_INSTR_BEGIN &&
|
||||
ev->type <= SNDRV_SEQ_EVENT_INSTR_CHANGE) {
|
||||
@ -168,14 +168,14 @@ static int snd_opl3_synth_event_input(snd_seq_event_t * ev, int direct,
|
||||
|
||||
static void snd_opl3_synth_free_port(void *private_data)
|
||||
{
|
||||
opl3_t *opl3 = private_data;
|
||||
struct snd_opl3 *opl3 = private_data;
|
||||
|
||||
snd_midi_channel_free_set(opl3->chset);
|
||||
}
|
||||
|
||||
static int snd_opl3_synth_create_port(opl3_t * opl3)
|
||||
static int snd_opl3_synth_create_port(struct snd_opl3 * opl3)
|
||||
{
|
||||
snd_seq_port_callback_t callbacks;
|
||||
struct snd_seq_port_callback callbacks;
|
||||
char name[32];
|
||||
int voices, opl_ver;
|
||||
|
||||
@ -215,15 +215,15 @@ static int snd_opl3_synth_create_port(opl3_t * opl3)
|
||||
|
||||
/* ------------------------------ */
|
||||
|
||||
static int snd_opl3_seq_new_device(snd_seq_device_t *dev)
|
||||
static int snd_opl3_seq_new_device(struct snd_seq_device *dev)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
int client;
|
||||
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 opl_ver;
|
||||
|
||||
opl3 = *(opl3_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
|
||||
opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
|
||||
if (opl3 == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
@ -273,11 +273,11 @@ static int snd_opl3_seq_new_device(snd_seq_device_t *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_seq_delete_device(snd_seq_device_t *dev)
|
||||
static int snd_opl3_seq_delete_device(struct snd_seq_device *dev)
|
||||
{
|
||||
opl3_t *opl3;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
opl3 = *(opl3_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
|
||||
opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
|
||||
if (opl3 == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
@ -295,14 +295,14 @@ static int snd_opl3_seq_delete_device(snd_seq_device_t *dev)
|
||||
|
||||
static int __init alsa_opl3_seq_init(void)
|
||||
{
|
||||
static snd_seq_dev_ops_t ops =
|
||||
static struct snd_seq_dev_ops ops =
|
||||
{
|
||||
snd_opl3_seq_new_device,
|
||||
snd_opl3_seq_delete_device
|
||||
};
|
||||
|
||||
return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL3, &ops,
|
||||
sizeof(opl3_t*));
|
||||
sizeof(struct snd_opl3 *));
|
||||
}
|
||||
|
||||
static void __exit alsa_opl3_seq_exit(void)
|
||||
|
@ -61,20 +61,20 @@ char snd_opl3_regmap[MAX_OPL2_VOICES][4] =
|
||||
/*
|
||||
* prototypes
|
||||
*/
|
||||
static int snd_opl3_play_note(opl3_t * opl3, snd_dm_fm_note_t * note);
|
||||
static int snd_opl3_set_voice(opl3_t * opl3, snd_dm_fm_voice_t * voice);
|
||||
static int snd_opl3_set_params(opl3_t * opl3, snd_dm_fm_params_t * params);
|
||||
static int snd_opl3_set_mode(opl3_t * opl3, int mode);
|
||||
static int snd_opl3_set_connection(opl3_t * opl3, int connection);
|
||||
static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note);
|
||||
static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice);
|
||||
static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params);
|
||||
static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode);
|
||||
static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection);
|
||||
|
||||
/* ------------------------------ */
|
||||
|
||||
/*
|
||||
* open the device exclusively
|
||||
*/
|
||||
int snd_opl3_open(snd_hwdep_t * hw, struct file *file)
|
||||
int snd_opl3_open(struct snd_hwdep * hw, struct file *file)
|
||||
{
|
||||
opl3_t *opl3 = hw->private_data;
|
||||
struct snd_opl3 *opl3 = hw->private_data;
|
||||
|
||||
down(&opl3->access_mutex);
|
||||
if (opl3->used) {
|
||||
@ -90,10 +90,10 @@ int snd_opl3_open(snd_hwdep_t * hw, struct file *file)
|
||||
/*
|
||||
* ioctl for hwdep device:
|
||||
*/
|
||||
int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
opl3_t *opl3 = hw->private_data;
|
||||
struct snd_opl3 *opl3 = hw->private_data;
|
||||
void __user *argp = (void __user *)arg;
|
||||
|
||||
snd_assert(opl3 != NULL, return -EINVAL);
|
||||
@ -102,11 +102,11 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
/* get information */
|
||||
case SNDRV_DM_FM_IOCTL_INFO:
|
||||
{
|
||||
snd_dm_fm_info_t info;
|
||||
struct snd_dm_fm_info info;
|
||||
|
||||
info.fm_mode = opl3->fm_mode;
|
||||
info.rhythm = opl3->rhythm;
|
||||
if (copy_to_user(argp, &info, sizeof(snd_dm_fm_info_t)))
|
||||
if (copy_to_user(argp, &info, sizeof(struct snd_dm_fm_info)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
@ -123,8 +123,8 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
case SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE:
|
||||
#endif
|
||||
{
|
||||
snd_dm_fm_note_t note;
|
||||
if (copy_from_user(¬e, argp, sizeof(snd_dm_fm_note_t)))
|
||||
struct snd_dm_fm_note note;
|
||||
if (copy_from_user(¬e, argp, sizeof(struct snd_dm_fm_note)))
|
||||
return -EFAULT;
|
||||
return snd_opl3_play_note(opl3, ¬e);
|
||||
}
|
||||
@ -134,8 +134,8 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
case SNDRV_DM_FM_OSS_IOCTL_SET_VOICE:
|
||||
#endif
|
||||
{
|
||||
snd_dm_fm_voice_t voice;
|
||||
if (copy_from_user(&voice, argp, sizeof(snd_dm_fm_voice_t)))
|
||||
struct snd_dm_fm_voice voice;
|
||||
if (copy_from_user(&voice, argp, sizeof(struct snd_dm_fm_voice)))
|
||||
return -EFAULT;
|
||||
return snd_opl3_set_voice(opl3, &voice);
|
||||
}
|
||||
@ -145,8 +145,8 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
case SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS:
|
||||
#endif
|
||||
{
|
||||
snd_dm_fm_params_t params;
|
||||
if (copy_from_user(¶ms, argp, sizeof(snd_dm_fm_params_t)))
|
||||
struct snd_dm_fm_params params;
|
||||
if (copy_from_user(¶ms, argp, sizeof(struct snd_dm_fm_params)))
|
||||
return -EFAULT;
|
||||
return snd_opl3_set_params(opl3, ¶ms);
|
||||
}
|
||||
@ -174,9 +174,9 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
|
||||
/*
|
||||
* close the device
|
||||
*/
|
||||
int snd_opl3_release(snd_hwdep_t * hw, struct file *file)
|
||||
int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
|
||||
{
|
||||
opl3_t *opl3 = hw->private_data;
|
||||
struct snd_opl3 *opl3 = hw->private_data;
|
||||
|
||||
snd_opl3_reset(opl3);
|
||||
down(&opl3->access_mutex);
|
||||
@ -188,7 +188,7 @@ int snd_opl3_release(snd_hwdep_t * hw, struct file *file)
|
||||
|
||||
/* ------------------------------ */
|
||||
|
||||
void snd_opl3_reset(opl3_t * opl3)
|
||||
void snd_opl3_reset(struct snd_opl3 * opl3)
|
||||
{
|
||||
unsigned short opl3_reg;
|
||||
|
||||
@ -229,7 +229,7 @@ void snd_opl3_reset(opl3_t * opl3)
|
||||
}
|
||||
|
||||
|
||||
static int snd_opl3_play_note(opl3_t * opl3, snd_dm_fm_note_t * note)
|
||||
static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note)
|
||||
{
|
||||
unsigned short reg_side;
|
||||
unsigned char voice_offset;
|
||||
@ -276,7 +276,7 @@ static int snd_opl3_play_note(opl3_t * opl3, snd_dm_fm_note_t * note)
|
||||
}
|
||||
|
||||
|
||||
static int snd_opl3_set_voice(opl3_t * opl3, snd_dm_fm_voice_t * voice)
|
||||
static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice)
|
||||
{
|
||||
unsigned short reg_side;
|
||||
unsigned char op_offset;
|
||||
@ -378,7 +378,7 @@ static int snd_opl3_set_voice(opl3_t * opl3, snd_dm_fm_voice_t * voice)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_set_params(opl3_t * opl3, snd_dm_fm_params_t * params)
|
||||
static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params)
|
||||
{
|
||||
unsigned char reg_val;
|
||||
|
||||
@ -418,7 +418,7 @@ static int snd_opl3_set_params(opl3_t * opl3, snd_dm_fm_params_t * params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_set_mode(opl3_t * opl3, int mode)
|
||||
static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode)
|
||||
{
|
||||
if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3))
|
||||
return -EINVAL;
|
||||
@ -430,7 +430,7 @@ static int snd_opl3_set_mode(opl3_t * opl3, int mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_opl3_set_connection(opl3_t * opl3, int connection)
|
||||
static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection)
|
||||
{
|
||||
unsigned char reg_val;
|
||||
|
||||
|
@ -22,31 +22,31 @@
|
||||
#include <sound/opl3.h>
|
||||
|
||||
/* Prototypes for opl3_seq.c */
|
||||
int snd_opl3_synth_use_inc(opl3_t * opl3);
|
||||
void snd_opl3_synth_use_dec(opl3_t * opl3);
|
||||
int snd_opl3_synth_setup(opl3_t * opl3);
|
||||
void snd_opl3_synth_cleanup(opl3_t * opl3);
|
||||
int snd_opl3_synth_use_inc(struct snd_opl3 * opl3);
|
||||
void snd_opl3_synth_use_dec(struct snd_opl3 * opl3);
|
||||
int snd_opl3_synth_setup(struct snd_opl3 * opl3);
|
||||
void snd_opl3_synth_cleanup(struct snd_opl3 * opl3);
|
||||
|
||||
/* Prototypes for opl3_midi.c */
|
||||
void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
|
||||
void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
|
||||
void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan);
|
||||
void snd_opl3_terminate_note(void *p, int note, snd_midi_channel_t *chan);
|
||||
void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan);
|
||||
void snd_opl3_control(void *p, int type, struct snd_midi_channel *chan);
|
||||
void snd_opl3_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset);
|
||||
void snd_opl3_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset);
|
||||
void snd_opl3_nrpn(void *p, struct snd_midi_channel *chan, struct snd_midi_channel_set *chset);
|
||||
void snd_opl3_sysex(void *p, unsigned char *buf, int len, int parsed, struct snd_midi_channel_set *chset);
|
||||
|
||||
void snd_opl3_calc_volume(unsigned char *reg, int vel, snd_midi_channel_t *chan);
|
||||
void snd_opl3_calc_volume(unsigned char *reg, int vel, struct snd_midi_channel *chan);
|
||||
void snd_opl3_timer_func(unsigned long data);
|
||||
|
||||
/* Prototypes for opl3_drums.c */
|
||||
void snd_opl3_load_drums(opl3_t *opl3);
|
||||
void snd_opl3_drum_switch(opl3_t *opl3, int note, int on_off, int vel, snd_midi_channel_t *chan);
|
||||
void snd_opl3_load_drums(struct snd_opl3 *opl3);
|
||||
void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
|
||||
|
||||
/* Prototypes for opl3_oss.c */
|
||||
#ifdef CONFIG_SND_SEQUENCER_OSS
|
||||
void snd_opl3_init_seq_oss(opl3_t *opl3, char *name);
|
||||
void snd_opl3_free_seq_oss(opl3_t *opl3);
|
||||
void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name);
|
||||
void snd_opl3_free_seq_oss(struct snd_opl3 *opl3);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user