Skip to content

Commit

Permalink
[ALSA] Remove xxx_t typedefs: OPL4
Browse files Browse the repository at this point in the history
Modules: OPL4

Remove xxx_t typedefs from the OPL4 driver

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 5b1646a commit a42dd42
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 265 deletions.
6 changes: 3 additions & 3 deletions include/sound/opl4.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

#include <sound/opl3.h>

typedef struct opl4 opl4_t;
struct snd_opl4;

extern int snd_opl4_create(snd_card_t *card,
extern int snd_opl4_create(struct snd_card *card,
unsigned long fm_port, unsigned long pcm_port,
int seq_device,
opl3_t **opl3, opl4_t **opl4);
struct snd_opl3 **opl3, struct snd_opl4 **opl4);

#endif /* __SOUND_OPL4_H */
40 changes: 20 additions & 20 deletions sound/drivers/opl4/opl4_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -144,27 +144,27 @@ 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;
}
return 0;
}
#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);
Expand All @@ -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
};

Expand Down
68 changes: 34 additions & 34 deletions sound/drivers/opl4/opl4_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 */
16 changes: 8 additions & 8 deletions sound/drivers/opl4/opl4_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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",
Expand All @@ -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");
Expand Down
Loading

0 comments on commit a42dd42

Please sign in to comment.