Skip to content

Commit

Permalink
[ALSA] Remove xxx_t typedefs: PCI emu10k1
Browse files Browse the repository at this point in the history
Modules: EMU10K1/EMU10K2 driver

Remove xxx_t typedefs from the PCI emu10k1 driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 3d19f80 commit eb4698f
Show file tree
Hide file tree
Showing 19 changed files with 1,022 additions and 946 deletions.
336 changes: 171 additions & 165 deletions include/sound/emu10k1.h

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions include/sound/emu10k1_synth.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#define SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH "emu10k1-synth"

/* argument for snd_seq_device_new */
typedef struct snd_emu10k1_synth_arg {
emu10k1_t *hwptr; /* chip */
struct snd_emu10k1_synth_arg {
struct snd_emu10k1 *hwptr; /* chip */
int index; /* sequencer client index */
int seq_ports; /* number of sequencer ports to be created */
int max_voices; /* maximum number of voices for wavetable */
} snd_emu10k1_synth_arg_t;
};

#define EMU10K1_MAX_MEMSIZE (32 * 1024 * 1024) /* 32MB */

Expand Down
10 changes: 5 additions & 5 deletions sound/pci/emu10k1/emu10k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
static int dev;
snd_card_t *card;
emu10k1_t *emu;
struct snd_card *card;
struct snd_emu10k1 *emu;
#ifdef ENABLE_SYNTH
snd_seq_device_t *wave = NULL;
struct snd_seq_device *wave = NULL;
#endif
int err;

Expand Down Expand Up @@ -186,11 +186,11 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
}
#ifdef ENABLE_SYNTH
if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH,
sizeof(snd_emu10k1_synth_arg_t), &wave) < 0 ||
sizeof(struct snd_emu10k1_synth_arg), &wave) < 0 ||
wave == NULL) {
snd_printk(KERN_WARNING "can't initialize Emu10k1 wavetable synth\n");
} else {
snd_emu10k1_synth_arg_t *arg;
struct snd_emu10k1_synth_arg *arg;
arg = SNDRV_SEQ_DEVICE_ARGPTR(wave);
strcpy(wave->name, "Emu-10k1 Synth");
arg->hwptr = emu;
Expand Down
105 changes: 54 additions & 51 deletions sound/pci/emu10k1/emu10k1_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,28 @@ enum {
};

/* Keeps track of what we are finding */
typedef struct best_voice {
struct best_voice {
unsigned int time;
int voice;
} best_voice_t;
};

/*
* prototypes
*/
static void lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_only);
static snd_emux_voice_t *get_voice(snd_emux_t *emu, snd_emux_port_t *port);
static int start_voice(snd_emux_voice_t *vp);
static void trigger_voice(snd_emux_voice_t *vp);
static void release_voice(snd_emux_voice_t *vp);
static void update_voice(snd_emux_voice_t *vp, int update);
static void terminate_voice(snd_emux_voice_t *vp);
static void free_voice(snd_emux_voice_t *vp);

static void set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp);
static void set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp);
static void set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp);
static void lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
struct best_voice *best, int active_only);
static struct snd_emux_voice *get_voice(struct snd_emux *emu,
struct snd_emux_port *port);
static int start_voice(struct snd_emux_voice *vp);
static void trigger_voice(struct snd_emux_voice *vp);
static void release_voice(struct snd_emux_voice *vp);
static void update_voice(struct snd_emux_voice *vp, int update);
static void terminate_voice(struct snd_emux_voice *vp);
static void free_voice(struct snd_emux_voice *vp);

static void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);

/*
* Ensure a value is between two points
Expand All @@ -59,7 +61,7 @@ static void set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp);
/*
* set up operators
*/
static snd_emux_operators_t emu10k1_ops = {
static struct snd_emux_operators emu10k1_ops = {
.owner = THIS_MODULE,
.get_voice = get_voice,
.prepare = start_voice,
Expand All @@ -73,7 +75,7 @@ static snd_emux_operators_t emu10k1_ops = {
};

void
snd_emu10k1_ops_setup(snd_emux_t *emu)
snd_emu10k1_ops_setup(struct snd_emux *emu)
{
emu->ops = emu10k1_ops;
}
Expand All @@ -85,11 +87,11 @@ snd_emu10k1_ops_setup(snd_emux_t *emu)
* terminate most inactive voice and give it as a pcm voice.
*/
int
snd_emu10k1_synth_get_voice(emu10k1_t *hw)
snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
{
snd_emux_t *emu;
snd_emux_voice_t *vp;
best_voice_t best[V_END];
struct snd_emux *emu;
struct snd_emux_voice *vp;
struct best_voice best[V_END];
unsigned long flags;
int i;

Expand Down Expand Up @@ -123,10 +125,10 @@ snd_emu10k1_synth_get_voice(emu10k1_t *hw)
* turn off the voice (not terminated)
*/
static void
release_voice(snd_emux_voice_t *vp)
release_voice(struct snd_emux_voice *vp)
{
int dcysusv;
emu10k1_t *hw;
struct snd_emu10k1 *hw;

hw = vp->hw;
dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease;
Expand All @@ -140,16 +142,16 @@ release_voice(snd_emux_voice_t *vp)
* terminate the voice
*/
static void
terminate_voice(snd_emux_voice_t *vp)
terminate_voice(struct snd_emux_voice *vp)
{
emu10k1_t *hw;
struct snd_emu10k1 *hw;

snd_assert(vp, return);
hw = vp->hw;
snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
if (vp->block) {
emu10k1_memblk_t *emem;
emem = (emu10k1_memblk_t *)vp->block;
struct snd_emu10k1_memblk *emem;
emem = (struct snd_emu10k1_memblk *)vp->block;
if (emem->map_locked > 0)
emem->map_locked--;
}
Expand All @@ -159,9 +161,9 @@ terminate_voice(snd_emux_voice_t *vp)
* release the voice to system
*/
static void
free_voice(snd_emux_voice_t *vp)
free_voice(struct snd_emux_voice *vp)
{
emu10k1_t *hw;
struct snd_emu10k1 *hw;

hw = vp->hw;
if (vp->ch >= 0) {
Expand All @@ -181,9 +183,9 @@ free_voice(snd_emux_voice_t *vp)
* update registers
*/
static void
update_voice(snd_emux_voice_t *vp, int update)
update_voice(struct snd_emux_voice *vp, int update)
{
emu10k1_t *hw;
struct snd_emu10k1 *hw;

hw = vp->hw;
if (update & SNDRV_EMUX_UPDATE_VOLUME)
Expand All @@ -210,10 +212,11 @@ update_voice(snd_emux_voice_t *vp, int update)
*/
/* spinlock held! */
static void
lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_only)
lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
struct best_voice *best, int active_only)
{
snd_emux_voice_t *vp;
best_voice_t *bp;
struct snd_emux_voice *vp;
struct best_voice *bp;
int i;

for (i = 0; i < V_END; i++) {
Expand Down Expand Up @@ -274,12 +277,12 @@ lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_onl
*
* emu->voice_lock is already held.
*/
static snd_emux_voice_t *
get_voice(snd_emux_t *emu, snd_emux_port_t *port)
static struct snd_emux_voice *
get_voice(struct snd_emux *emu, struct snd_emux_port *port)
{
emu10k1_t *hw;
snd_emux_voice_t *vp;
best_voice_t best[V_END];
struct snd_emu10k1 *hw;
struct snd_emux_voice *vp;
struct best_voice best[V_END];
int i;

hw = emu->hw;
Expand All @@ -290,7 +293,7 @@ get_voice(snd_emux_t *emu, snd_emux_port_t *port)
vp = &emu->voices[best[i].voice];
if (vp->ch < 0) {
/* allocate a voice */
emu10k1_voice_t *hwvoice;
struct snd_emu10k1_voice *hwvoice;
if (snd_emu10k1_voice_alloc(hw, EMU10K1_SYNTH, 1, &hwvoice) < 0 || hwvoice == NULL)
continue;
vp->ch = hwvoice->number;
Expand All @@ -308,21 +311,21 @@ get_voice(snd_emux_t *emu, snd_emux_port_t *port)
* prepare envelopes and LFOs
*/
static int
start_voice(snd_emux_voice_t *vp)
start_voice(struct snd_emux_voice *vp)
{
unsigned int temp;
int ch;
unsigned int addr, mapped_offset;
snd_midi_channel_t *chan;
emu10k1_t *hw;
emu10k1_memblk_t *emem;
struct snd_midi_channel *chan;
struct snd_emu10k1 *hw;
struct snd_emu10k1_memblk *emem;

hw = vp->hw;
ch = vp->ch;
snd_assert(ch >= 0, return -EINVAL);
chan = vp->chan;

emem = (emu10k1_memblk_t *)vp->block;
emem = (struct snd_emu10k1_memblk *)vp->block;
if (emem == NULL)
return -EINVAL;
emem->map_locked++;
Expand Down Expand Up @@ -463,15 +466,15 @@ start_voice(snd_emux_voice_t *vp)
* Start envelope
*/
static void
trigger_voice(snd_emux_voice_t *vp)
trigger_voice(struct snd_emux_voice *vp)
{
unsigned int temp, ptarget;
emu10k1_t *hw;
emu10k1_memblk_t *emem;
struct snd_emu10k1 *hw;
struct snd_emu10k1_memblk *emem;

hw = vp->hw;

emem = (emu10k1_memblk_t *)vp->block;
emem = (struct snd_emu10k1_memblk *)vp->block;
if (! emem || emem->mapped_page < 0)
return; /* not mapped */

Expand All @@ -495,7 +498,7 @@ trigger_voice(snd_emux_voice_t *vp)

/* set lfo1 modulation height and cutoff */
static void
set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp)
set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
{
unsigned short fmmod;
short pitch;
Expand All @@ -513,7 +516,7 @@ set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp)

/* set lfo2 pitch & frequency */
static void
set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp)
set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
{
unsigned short fm2frq2;
short pitch;
Expand All @@ -531,7 +534,7 @@ set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp)

/* set filterQ */
static void
set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp)
set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
{
unsigned int val;
val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE;
Expand Down
Loading

0 comments on commit eb4698f

Please sign in to comment.