Commit bee1a5be authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] Remove xxx_t typedefs: PCI Trident



Modules: Trident driver

Remove xxx_t typedefs from the PCI Trident driver.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent abfd67bd
Loading
Loading
Loading
Loading
+77 −74
Original line number Diff line number Diff line
@@ -253,43 +253,43 @@ enum serial_intf_ctrl_bits {
#define T4D_DEFAULT_PCM_RVOL	127	/* 0 - 127 */
#define T4D_DEFAULT_PCM_CVOL	127	/* 0 - 127 */

typedef struct _snd_trident trident_t;
typedef struct _snd_trident_voice snd_trident_voice_t;
typedef struct _snd_trident_pcm_mixer snd_trident_pcm_mixer_t;

typedef struct {
	void (*sample_start)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_position_t position);
	void (*sample_stop)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_stop_mode_t mode);
	void (*sample_freq)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_frequency_t freq);
	void (*sample_volume)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_ev_volume_t *volume);
	void (*sample_loop)(trident_t *card, snd_trident_voice_t *voice, snd_seq_ev_loop_t *loop);
	void (*sample_pos)(trident_t *card, snd_trident_voice_t *voice, snd_seq_position_t position);
	void (*sample_private1)(trident_t *card, snd_trident_voice_t *voice, unsigned char *data);
} snd_trident_sample_ops_t;

typedef struct {
	snd_midi_channel_set_t * chset;
	trident_t * trident;
struct snd_trident;
struct snd_trident_voice;
struct snd_trident_pcm_mixer;

struct snd_trident_sample_ops {
	void (*sample_start)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_position_t position);
	void (*sample_stop)(struct snd_trident *gus, struct snd_trident_voice *voice, int mode);
	void (*sample_freq)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_frequency_t freq);
	void (*sample_volume)(struct snd_trident *gus, struct snd_trident_voice *voice, struct snd_seq_ev_volume *volume);
	void (*sample_loop)(struct snd_trident *card, struct snd_trident_voice *voice, struct snd_seq_ev_loop *loop);
	void (*sample_pos)(struct snd_trident *card, struct snd_trident_voice *voice, snd_seq_position_t position);
	void (*sample_private1)(struct snd_trident *card, struct snd_trident_voice *voice, unsigned char *data);
};

struct snd_trident_port {
	struct snd_midi_channel_set * chset;
	struct snd_trident * trident;
	int mode;		/* operation mode */
	int client;		/* sequencer client number */
	int port;		/* sequencer port number */
	unsigned int midi_has_voices: 1;
} snd_trident_port_t;
};

typedef struct snd_trident_memblk_arg {
struct snd_trident_memblk_arg {
	short first_page, last_page;
} snd_trident_memblk_arg_t;
};

typedef struct {
struct snd_trident_tlb {
	unsigned int * entries;		/* 16k-aligned TLB table */
	dma_addr_t entries_dmaaddr;	/* 16k-aligned PCI address to TLB table */
	unsigned long * shadow_entries;	/* shadow entries with virtual addresses */
	struct snd_dma_buffer buffer;
	snd_util_memhdr_t * memhdr;	/* page allocation list */
	struct snd_util_memhdr * memhdr;	/* page allocation list */
	struct snd_dma_buffer silent_page;
} snd_trident_tlb_t;
};

struct _snd_trident_voice {
struct snd_trident_voice {
	unsigned int number;
	unsigned int use: 1,
	    pcm: 1,
@@ -300,8 +300,8 @@ struct _snd_trident_voice {
	unsigned char port;
	unsigned char index;

	snd_seq_instr_t instr;
	snd_trident_sample_ops_t *sample_ops;
	struct snd_seq_instr instr;
	struct snd_trident_sample_ops *sample_ops;

	/* channel parameters */
	unsigned int CSO;		/* 24 bits (16 on DX) */
@@ -323,13 +323,13 @@ struct _snd_trident_voice {

	unsigned int negCSO;	/* nonzero - use negative CSO */

	snd_util_memblk_t *memblk;	/* memory block if TLB enabled */
	struct snd_util_memblk *memblk;	/* memory block if TLB enabled */

	/* PCM data */

	trident_t *trident;
	snd_pcm_substream_t *substream;
	snd_trident_voice_t *extra;	/* extra PCM voice (acts as interrupt generator) */
	struct snd_trident *trident;
	struct snd_pcm_substream *substream;
	struct snd_trident_voice *extra;	/* extra PCM voice (acts as interrupt generator) */
	unsigned int running: 1,
            capture: 1,
            spdif: 1,
@@ -347,25 +347,25 @@ struct _snd_trident_voice {
	/* --- */

	void *private_data;
	void (*private_free)(snd_trident_voice_t *voice);
	void (*private_free)(struct snd_trident_voice *voice);
};

struct _snd_4dwave {
struct snd_4dwave {
	int seq_client;

	snd_trident_port_t seq_ports[4];
	snd_simple_ops_t simple_ops;
	snd_seq_kinstr_list_t *ilist;
	struct snd_trident_port seq_ports[4];
	struct snd_simple_ops simple_ops;
	struct snd_seq_kinstr_list *ilist;

	snd_trident_voice_t voices[64];	
	struct snd_trident_voice voices[64];	

	int ChanSynthCount;		/* number of allocated synth channels */
	int max_size;			/* maximum synth memory size in bytes */
	int current_size;		/* current allocated synth mem in bytes */
};

struct _snd_trident_pcm_mixer {
	snd_trident_voice_t *voice;	/* active voice */
struct snd_trident_pcm_mixer {
	struct snd_trident_voice *voice;	/* active voice */
	unsigned short vol;		/* front volume */
	unsigned char pan;		/* pan control */
	unsigned char rvol;		/* rear volume */
@@ -373,7 +373,7 @@ struct _snd_trident_pcm_mixer {
	unsigned char pad;
};

struct _snd_trident {
struct snd_trident {
	int irq;

	unsigned int device;	/* device ID */
@@ -386,13 +386,13 @@ struct _snd_trident {
	unsigned int spurious_irq_count;
	unsigned int spurious_irq_max_delta;

        snd_trident_tlb_t tlb;	/* TLB entries for NX cards */
        struct snd_trident_tlb tlb;	/* TLB entries for NX cards */

	unsigned char spdif_ctrl;
	unsigned char spdif_pcm_ctrl;
	unsigned int spdif_bits;
	unsigned int spdif_pcm_bits;
	snd_kcontrol_t *spdif_pcm_ctl;	/* S/PDIF settings */
	struct snd_kcontrol *spdif_pcm_ctl;	/* S/PDIF settings */
	unsigned int ac97_ctrl;
        
        unsigned int ChanMap[2];	/* allocation map for hardware channels */
@@ -403,7 +403,7 @@ struct _snd_trident {
	unsigned int ac97_detect: 1;	/* 1 = AC97 in detection phase */
	unsigned int in_suspend: 1;	/* 1 during suspend/resume */

	struct _snd_4dwave synth;	/* synth specific variables */
	struct snd_4dwave synth;	/* synth specific variables */

	spinlock_t event_lock;
	spinlock_t voice_alloc;
@@ -411,52 +411,55 @@ struct _snd_trident {
	struct snd_dma_device dma_dev;

	struct pci_dev *pci;
	snd_card_t *card;
	snd_pcm_t *pcm;		/* ADC/DAC PCM */
	snd_pcm_t *foldback;	/* Foldback PCM */
	snd_pcm_t *spdif;	/* SPDIF PCM */
	snd_rawmidi_t *rmidi;
	snd_seq_device_t *seq_dev;
	struct snd_card *card;
	struct snd_pcm *pcm;		/* ADC/DAC PCM */
	struct snd_pcm *foldback;	/* Foldback PCM */
	struct snd_pcm *spdif;	/* SPDIF PCM */
	struct snd_rawmidi *rmidi;
	struct snd_seq_device *seq_dev;

	ac97_bus_t *ac97_bus;
	ac97_t *ac97;
	ac97_t *ac97_sec;
	struct snd_ac97_bus *ac97_bus;
	struct snd_ac97 *ac97;
	struct snd_ac97 *ac97_sec;

	unsigned int musicvol_wavevol;
	snd_trident_pcm_mixer_t pcm_mixer[32];
	snd_kcontrol_t *ctl_vol;	/* front volume */
	snd_kcontrol_t *ctl_pan;	/* pan */
	snd_kcontrol_t *ctl_rvol;	/* rear volume */
	snd_kcontrol_t *ctl_cvol;	/* center volume */
	struct snd_trident_pcm_mixer pcm_mixer[32];
	struct snd_kcontrol *ctl_vol;	/* front volume */
	struct snd_kcontrol *ctl_pan;	/* pan */
	struct snd_kcontrol *ctl_rvol;	/* rear volume */
	struct snd_kcontrol *ctl_cvol;	/* center volume */

	spinlock_t reg_lock;

	struct gameport *gameport;
};

int snd_trident_create(snd_card_t * card,
int snd_trident_create(struct snd_card *card,
		       struct pci_dev *pci,
		       int pcm_streams,
		       int pcm_spdif_device,
		       int max_wavetable_size,
		       trident_t ** rtrident);
int snd_trident_create_gameport(trident_t *trident);

int snd_trident_pcm(trident_t * trident, int device, snd_pcm_t **rpcm);
int snd_trident_foldback_pcm(trident_t * trident, int device, snd_pcm_t **rpcm);
int snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t **rpcm);
int snd_trident_attach_synthesizer(trident_t * trident);
snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port);
void snd_trident_free_voice(trident_t * trident, snd_trident_voice_t *voice);
void snd_trident_start_voice(trident_t * trident, unsigned int voice);
void snd_trident_stop_voice(trident_t * trident, unsigned int voice);
void snd_trident_write_voice_regs(trident_t * trident, snd_trident_voice_t *voice);
		       struct snd_trident ** rtrident);
int snd_trident_create_gameport(struct snd_trident *trident);

int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
int snd_trident_spdif_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
int snd_trident_attach_synthesizer(struct snd_trident * trident);
struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type,
					     int client, int port);
void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice);
void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice);
void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice);
void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice);

/* TLB memory allocation */
snd_util_memblk_t *snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream);
int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk);
snd_util_memblk_t *snd_trident_synth_alloc(trident_t *trident, unsigned int size);
int snd_trident_synth_free(trident_t *trident, snd_util_memblk_t *blk);
int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char __user *data, int size);
struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident,
						struct snd_pcm_substream *substream);
int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk);
struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size);
int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk);
int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk,
				     int offset, const char __user *data, int size);

#endif /* __SOUND_TRIDENT_H */
+2 −2
Original line number Diff line number Diff line
@@ -76,8 +76,8 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
				       const struct pci_device_id *pci_id)
{
	static int dev;
	snd_card_t *card;
	trident_t *trident;
	struct snd_card *card;
	struct snd_trident *trident;
	const char *str;
	int err, pcm_dev = 0;

+381 −327

File changed.

Preview size limit exceeded, changes collapsed.

+51 −41
Original line number Diff line number Diff line
@@ -68,13 +68,14 @@
#define page_to_addr(trident,page)	__tlb_to_addr(trident, (page) << 1)

/* fill TLB entries -- we need to fill two entries */
static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr, dma_addr_t addr)
static inline void set_tlb_bus(struct snd_trident *trident, int page,
			       unsigned long ptr, dma_addr_t addr)
{
	page <<= 1;
	__set_tlb_bus(trident, page, ptr, addr);
	__set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE, addr + SNDRV_TRIDENT_PAGE_SIZE);
}
static inline void set_silent_tlb(trident_t *trident, int page)
static inline void set_silent_tlb(struct snd_trident *trident, int page)
{
	page <<= 1;
	__set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
@@ -97,7 +98,8 @@ static inline void set_silent_tlb(trident_t *trident, int page)
#define page_to_addr(trident,page)	__tlb_to_addr(trident, (page) * UNIT_PAGES)

/* fill TLB entries -- UNIT_PAGES entries must be filled */
static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr, dma_addr_t addr)
static inline void set_tlb_bus(struct snd_trident *trident, int page,
			       unsigned long ptr, dma_addr_t addr)
{
	int i;
	page *= UNIT_PAGES;
@@ -107,7 +109,7 @@ static inline void set_tlb_bus(trident_t *trident, int page, unsigned long ptr,
		addr += SNDRV_TRIDENT_PAGE_SIZE;
	}
}
static inline void set_silent_tlb(trident_t *trident, int page)
static inline void set_silent_tlb(struct snd_trident *trident, int page)
{
	int i;
	page *= UNIT_PAGES;
@@ -118,7 +120,7 @@ static inline void set_silent_tlb(trident_t *trident, int page)
#endif /* PAGE_SIZE */

/* calculate buffer pointer from offset address */
static inline void *offset_ptr(trident_t *trident, int offset)
static inline void *offset_ptr(struct snd_trident *trident, int offset)
{
	char *ptr;
	ptr = page_to_ptr(trident, get_aligned_page(offset));
@@ -127,16 +129,16 @@ static inline void *offset_ptr(trident_t *trident, int offset)
}

/* first and last (aligned) pages of memory block */
#define firstpg(blk)	(((snd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->first_page)
#define lastpg(blk)	(((snd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->last_page)
#define firstpg(blk)	(((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page)
#define lastpg(blk)	(((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page)

/*
 * search empty pages which may contain given size
 */
static snd_util_memblk_t *
search_empty(snd_util_memhdr_t *hdr, int size)
static struct snd_util_memblk *
search_empty(struct snd_util_memhdr *hdr, int size)
{
	snd_util_memblk_t *blk, *prev;
	struct snd_util_memblk *blk, *prev;
	int page, psize;
	struct list_head *p;

@@ -144,7 +146,7 @@ search_empty(snd_util_memhdr_t *hdr, int size)
	prev = NULL;
	page = 0;
	list_for_each(p, &hdr->block) {
		blk = list_entry(p, snd_util_memblk_t, list);
		blk = list_entry(p, struct snd_util_memblk, list);
		if (page + psize <= firstpg(blk))
			goto __found_pages;
		page = lastpg(blk) + 1;
@@ -183,12 +185,13 @@ static int is_valid_page(unsigned long ptr)
/*
 * page allocation for DMA (Scatter-Gather version)
 */
static snd_util_memblk_t *
snd_trident_alloc_sg_pages(trident_t *trident, snd_pcm_substream_t *substream)
static struct snd_util_memblk *
snd_trident_alloc_sg_pages(struct snd_trident *trident,
			   struct snd_pcm_substream *substream)
{
	snd_util_memhdr_t *hdr;
	snd_util_memblk_t *blk;
	snd_pcm_runtime_t *runtime = substream->runtime;
	struct snd_util_memhdr *hdr;
	struct snd_util_memblk *blk;
	struct snd_pcm_runtime *runtime = substream->runtime;
	int idx, page;
	struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);

@@ -230,13 +233,14 @@ snd_trident_alloc_sg_pages(trident_t *trident, snd_pcm_substream_t *substream)
/*
 * page allocation for DMA (contiguous version)
 */
static snd_util_memblk_t *
snd_trident_alloc_cont_pages(trident_t *trident, snd_pcm_substream_t *substream)
static struct snd_util_memblk *
snd_trident_alloc_cont_pages(struct snd_trident *trident,
			     struct snd_pcm_substream *substream)
{
	snd_util_memhdr_t *hdr;
	snd_util_memblk_t *blk;
	struct snd_util_memhdr *hdr;
	struct snd_util_memblk *blk;
	int page;
	snd_pcm_runtime_t *runtime = substream->runtime;
	struct snd_pcm_runtime *runtime = substream->runtime;
	dma_addr_t addr;
	unsigned long ptr;

@@ -270,8 +274,9 @@ snd_trident_alloc_cont_pages(trident_t *trident, snd_pcm_substream_t *substream)
/*
 * page allocation for DMA
 */
snd_util_memblk_t *
snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream)
struct snd_util_memblk *
snd_trident_alloc_pages(struct snd_trident *trident,
			struct snd_pcm_substream *substream)
{
	snd_assert(trident != NULL, return NULL);
	snd_assert(substream != NULL, return NULL);
@@ -285,9 +290,10 @@ snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream)
/*
 * release DMA buffer from page table
 */
int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk)
int snd_trident_free_pages(struct snd_trident *trident,
			   struct snd_util_memblk *blk)
{
	snd_util_memhdr_t *hdr;
	struct snd_util_memhdr *hdr;
	int page;

	snd_assert(trident != NULL, return -EINVAL);
@@ -314,17 +320,17 @@ int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk)

/*
 */
static int synth_alloc_pages(trident_t *hw, snd_util_memblk_t *blk);
static int synth_free_pages(trident_t *hw, snd_util_memblk_t *blk);
static int synth_alloc_pages(struct snd_trident *hw, struct snd_util_memblk *blk);
static int synth_free_pages(struct snd_trident *hw, struct snd_util_memblk *blk);

/*
 * allocate a synth sample area
 */
snd_util_memblk_t *
snd_trident_synth_alloc(trident_t *hw, unsigned int size)
struct snd_util_memblk *
snd_trident_synth_alloc(struct snd_trident *hw, unsigned int size)
{
	snd_util_memblk_t *blk;
	snd_util_memhdr_t *hdr = hw->tlb.memhdr; 
	struct snd_util_memblk *blk;
	struct snd_util_memhdr *hdr = hw->tlb.memhdr; 

	down(&hdr->block_mutex);
	blk = __snd_util_mem_alloc(hdr, size);
@@ -346,9 +352,9 @@ snd_trident_synth_alloc(trident_t *hw, unsigned int size)
 * free a synth sample area
 */
int
snd_trident_synth_free(trident_t *hw, snd_util_memblk_t *blk)
snd_trident_synth_free(struct snd_trident *hw, struct snd_util_memblk *blk)
{
	snd_util_memhdr_t *hdr = hw->tlb.memhdr; 
	struct snd_util_memhdr *hdr = hw->tlb.memhdr; 

	down(&hdr->block_mutex);
	synth_free_pages(hw, blk);
@@ -361,7 +367,7 @@ snd_trident_synth_free(trident_t *hw, snd_util_memblk_t *blk)
/*
 * reset TLB entry and free kernel page
 */
static void clear_tlb(trident_t *trident, int page)
static void clear_tlb(struct snd_trident *trident, int page)
{
	void *ptr = page_to_ptr(trident, page);
	dma_addr_t addr = page_to_addr(trident, page);
@@ -378,20 +384,22 @@ static void clear_tlb(trident_t *trident, int page)
}

/* check new allocation range */
static void get_single_page_range(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk, int *first_page_ret, int *last_page_ret)
static void get_single_page_range(struct snd_util_memhdr *hdr,
				  struct snd_util_memblk *blk,
				  int *first_page_ret, int *last_page_ret)
{
	struct list_head *p;
	snd_util_memblk_t *q;
	struct snd_util_memblk *q;
	int first_page, last_page;
	first_page = firstpg(blk);
	if ((p = blk->list.prev) != &hdr->block) {
		q = list_entry(p, snd_util_memblk_t, list);
		q = list_entry(p, struct snd_util_memblk, list);
		if (lastpg(q) == first_page)
			first_page++;  /* first page was already allocated */
	}
	last_page = lastpg(blk);
	if ((p = blk->list.next) != &hdr->block) {
		q = list_entry(p, snd_util_memblk_t, list);
		q = list_entry(p, struct snd_util_memblk, list);
		if (firstpg(q) == last_page)
			last_page--; /* last page was already allocated */
	}
@@ -402,7 +410,7 @@ static void get_single_page_range(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk
/*
 * allocate kernel pages and assign them to TLB
 */
static int synth_alloc_pages(trident_t *hw, snd_util_memblk_t *blk)
static int synth_alloc_pages(struct snd_trident *hw, struct snd_util_memblk *blk)
{
	int page, first_page, last_page;
	struct snd_dma_buffer dmab;
@@ -438,7 +446,7 @@ static int synth_alloc_pages(trident_t *hw, snd_util_memblk_t *blk)
/*
 * free pages
 */
static int synth_free_pages(trident_t *trident, snd_util_memblk_t *blk)
static int synth_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk)
{
	int page, first_page, last_page;

@@ -452,7 +460,9 @@ static int synth_free_pages(trident_t *trident, snd_util_memblk_t *blk)
/*
 * copy_from_user(blk + offset, data, size)
 */
int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char __user *data, int size)
int snd_trident_synth_copy_from_user(struct snd_trident *trident,
				     struct snd_util_memblk *blk,
				     int offset, const char __user *data, int size)
{
	int page, nextofs, end_offset, temp, temp1;

+81 −78
Original line number Diff line number Diff line
@@ -192,15 +192,15 @@ static unsigned short log_from_linear( unsigned short value )
 * Sample handling operations
 */

static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position);
static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode);
static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_seq_frequency_t freq);
static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_volume_t * volume);
static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_loop_t * loop);
static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position);
static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, unsigned char *data);

static snd_trident_sample_ops_t sample_ops =
static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode);
static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq);
static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume);
static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop);
static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data);

static struct snd_trident_sample_ops sample_ops =
{
	sample_start,
	sample_stop,
@@ -211,7 +211,7 @@ static snd_trident_sample_ops_t sample_ops =
	sample_private1
};

static void snd_trident_simple_init(snd_trident_voice_t * voice)
static void snd_trident_simple_init(struct snd_trident_voice * voice)
{
	//voice->handler_wave = interrupt_wave;
	//voice->handler_volume = interrupt_volume;
@@ -220,10 +220,10 @@ static void snd_trident_simple_init(snd_trident_voice_t * voice)
	voice->sample_ops = &sample_ops;
}

static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position)
static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
{
	simple_instrument_t *simple;
	snd_seq_kinstr_t *instr;
	struct simple_instrument *simple;
	struct snd_seq_kinstr *instr;
	unsigned long flags;
	unsigned int loop_start, loop_end, sample_start, sample_end, start_offset;
	unsigned int value;
@@ -305,7 +305,7 @@ static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_s
	snd_seq_instr_free_use(trident->synth.ilist, instr);
}

static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode)
static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode)
{
	unsigned long flags;

@@ -329,7 +329,7 @@ static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_se
	}
}

static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_seq_frequency_t freq)
static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq)
{
	unsigned long flags;
	freq >>= 4;
@@ -355,7 +355,7 @@ static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_se
	spin_unlock_irqrestore(&trident->reg_lock, flags);
}

static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_volume_t * volume)
static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume)
{
	unsigned long flags;
	unsigned short value;
@@ -407,11 +407,11 @@ static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_
	spin_unlock_irqrestore(&trident->reg_lock, flags);
}

static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_loop_t * loop)
static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop)
{
	unsigned long flags;
	simple_instrument_t *simple;
	snd_seq_kinstr_t *instr;
	struct simple_instrument *simple;
	struct snd_seq_kinstr *instr;
	unsigned int loop_start, loop_end;

	instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
@@ -446,11 +446,11 @@ static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_se
	snd_seq_instr_free_use(trident->synth.ilist, instr);
}

static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position)
static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
{
	unsigned long flags;
	simple_instrument_t *simple;
	snd_seq_kinstr_t *instr;
	struct simple_instrument *simple;
	struct snd_seq_kinstr *instr;
	unsigned int value;

	instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
@@ -496,7 +496,7 @@ static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq
	snd_seq_instr_free_use(trident->synth.ilist, instr);
}

static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, unsigned char *data)
static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data)
{
}

@@ -504,10 +504,11 @@ static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, un
 * Memory management / sample loading
 */

static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t * instr,
static int snd_trident_simple_put_sample(void *private_data,
					 struct simple_instrument * instr,
					 char __user *data, long len, int atomic)
{
	trident_t *trident = private_data;
	struct snd_trident *trident = private_data;
	int size = instr->size;
	int shift = 0;

@@ -529,7 +530,7 @@ static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t
		return -EFAULT;

	if (trident->tlb.entries) {
		snd_util_memblk_t *memblk;
		struct snd_util_memblk *memblk;
		memblk = snd_trident_synth_alloc(trident, size); 
		if (memblk == NULL)
			return -ENOMEM;
@@ -557,10 +558,11 @@ static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t
	return 0;
}

static int snd_trident_simple_get_sample(void *private_data, simple_instrument_t * instr,
static int snd_trident_simple_get_sample(void *private_data,
					 struct simple_instrument * instr,
					 char __user *data, long len, int atomic)
{
	//trident_t *trident = private_data;
	//struct snd_trident *trident = private_data;
	int size = instr->size;
	int shift = 0;

@@ -578,10 +580,11 @@ static int snd_trident_simple_get_sample(void *private_data, simple_instrument_t
	return -EBUSY;
}

static int snd_trident_simple_remove_sample(void *private_data, simple_instrument_t * instr,
static int snd_trident_simple_remove_sample(void *private_data,
					    struct simple_instrument * instr,
					    int atomic)
{
	trident_t *trident = private_data;
	struct snd_trident *trident = private_data;
	int size = instr->size;

	if (instr->format & SIMPLE_WAVE_16BIT)
@@ -590,7 +593,7 @@ static int snd_trident_simple_remove_sample(void *private_data, simple_instrumen
		size <<= 1;

	if (trident->tlb.entries) {
		snd_util_memblk_t *memblk = (snd_util_memblk_t*)instr->address.ptr;
		struct snd_util_memblk *memblk = (struct snd_util_memblk *)instr->address.ptr;
		if (memblk)
			snd_trident_synth_free(trident, memblk);
		else
@@ -612,9 +615,9 @@ static int snd_trident_simple_remove_sample(void *private_data, simple_instrumen
	return 0;
}

static void select_instrument(trident_t * trident, snd_trident_voice_t * v)
static void select_instrument(struct snd_trident * trident, struct snd_trident_voice * v)
{
	snd_seq_kinstr_t *instr;
	struct snd_seq_kinstr *instr;
	instr = snd_seq_instr_find(trident->synth.ilist, &v->instr, 0, 1);
	if (instr != NULL) {
		if (instr->ops) {
@@ -629,7 +632,7 @@ static void select_instrument(trident_t * trident, snd_trident_voice_t * v)

 */

static void event_sample(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_sample(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_stop)
		v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY);
@@ -643,7 +646,7 @@ static void event_sample(snd_seq_event_t * ev, snd_trident_port_t * p, snd_tride
	select_instrument(p->trident, v);
}

static void event_cluster(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_cluster(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_stop)
		v->sample_ops->sample_stop(p->trident, v, SAMPLE_STOP_IMMEDIATELY);
@@ -651,49 +654,49 @@ static void event_cluster(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trid
	select_instrument(p->trident, v);
}

static void event_start(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_start(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_start)
		v->sample_ops->sample_start(p->trident, v, ev->data.sample.param.position);
}

static void event_stop(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_stop(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_stop)
		v->sample_ops->sample_stop(p->trident, v, ev->data.sample.param.stop_mode);
}

static void event_freq(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_freq(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_freq)
		v->sample_ops->sample_freq(p->trident, v, ev->data.sample.param.frequency);
}

static void event_volume(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_volume(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_volume)
		v->sample_ops->sample_volume(p->trident, v, &ev->data.sample.param.volume);
}

static void event_loop(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_loop(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_loop)
		v->sample_ops->sample_loop(p->trident, v, &ev->data.sample.param.loop);
}

static void event_position(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_position(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_pos)
		v->sample_ops->sample_pos(p->trident, v, ev->data.sample.param.position);
}

static void event_private1(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
static void event_private1(struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
{
	if (v->sample_ops && v->sample_ops->sample_private1)
		v->sample_ops->sample_private1(p->trident, v, (unsigned char *) &ev->data.sample.param.raw8);
}

typedef void (trident_sample_event_handler_t) (snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v);
typedef void (trident_sample_event_handler_t) (struct snd_seq_event * ev, struct snd_trident_port * p, struct snd_trident_voice * v);

static trident_sample_event_handler_t *trident_sample_event_handlers[9] =
{
@@ -708,11 +711,11 @@ static trident_sample_event_handler_t *trident_sample_event_handlers[9] =
	event_private1
};

static void snd_trident_sample_event(snd_seq_event_t * ev, snd_trident_port_t * p)
static void snd_trident_sample_event(struct snd_seq_event * ev, struct snd_trident_port * p)
{
	int idx, voice;
	trident_t *trident = p->trident;
	snd_trident_voice_t *v;
	struct snd_trident *trident = p->trident;
	struct snd_trident_voice *v;
	unsigned long flags;

	idx = ev->type - SNDRV_SEQ_EVENT_SAMPLE;
@@ -735,10 +738,10 @@ static void snd_trident_sample_event(snd_seq_event_t * ev, snd_trident_port_t *

 */

static void snd_trident_synth_free_voices(trident_t * trident, int client, int port)
static void snd_trident_synth_free_voices(struct snd_trident * trident, int client, int port)
{
	int idx;
	snd_trident_voice_t *voice;
	struct snd_trident_voice *voice;

	for (idx = 0; idx < 32; idx++) {
		voice = &trident->synth.voices[idx];
@@ -747,11 +750,11 @@ static void snd_trident_synth_free_voices(trident_t * trident, int client, int p
	}
}

static int snd_trident_synth_use(void *private_data, snd_seq_port_subscribe_t * info)
static int snd_trident_synth_use(void *private_data, struct snd_seq_port_subscribe * info)
{
	snd_trident_port_t *port = (snd_trident_port_t *) private_data;
	trident_t *trident = port->trident;
	snd_trident_voice_t *voice;
	struct snd_trident_port *port = private_data;
	struct snd_trident *trident = port->trident;
	struct snd_trident_voice *voice;
	unsigned int idx;
	unsigned long flags;

@@ -786,10 +789,10 @@ static int snd_trident_synth_use(void *private_data, snd_seq_port_subscribe_t *
	return 0;
}

static int snd_trident_synth_unuse(void *private_data, snd_seq_port_subscribe_t * info)
static int snd_trident_synth_unuse(void *private_data, struct snd_seq_port_subscribe * info)
{
	snd_trident_port_t *port = (snd_trident_port_t *) private_data;
	trident_t *trident = port->trident;
	struct snd_trident_port *port = private_data;
	struct snd_trident *trident = port->trident;
	unsigned long flags;

	spin_lock_irqsave(&trident->reg_lock, flags);
@@ -802,18 +805,18 @@ static int snd_trident_synth_unuse(void *private_data, snd_seq_port_subscribe_t

 */

static void snd_trident_synth_free_private_instruments(snd_trident_port_t * p, int client)
static void snd_trident_synth_free_private_instruments(struct snd_trident_port * p, int client)
{
	snd_seq_instr_header_t ifree;
	struct snd_seq_instr_header ifree;

	memset(&ifree, 0, sizeof(ifree));
	ifree.cmd = SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE;
	snd_seq_instr_list_free_cond(p->trident->synth.ilist, &ifree, client, 0);
}

static int snd_trident_synth_event_input(snd_seq_event_t * ev, int direct, void *private_data, int atomic, int hop)
static int snd_trident_synth_event_input(struct snd_seq_event * ev, int direct, void *private_data, int atomic, int hop)
{
	snd_trident_port_t *p = (snd_trident_port_t *) private_data;
	struct snd_trident_port *p = (struct snd_trident_port *) private_data;

	if (p == NULL)
		return -EINVAL;
@@ -841,12 +844,12 @@ static int snd_trident_synth_event_input(snd_seq_event_t * ev, int direct, void
}

static void snd_trident_synth_instr_notify(void *private_data,
					   snd_seq_kinstr_t * instr,
					   struct snd_seq_kinstr * instr,
					   int what)
{
	int idx;
	trident_t *trident = private_data;
	snd_trident_voice_t *pvoice;
	struct snd_trident *trident = private_data;
	struct snd_trident_voice *pvoice;
	unsigned long flags;

	spin_lock_irqsave(&trident->event_lock, flags);
@@ -870,16 +873,16 @@ static void snd_trident_synth_instr_notify(void *private_data,

static void snd_trident_synth_free_port(void *private_data)
{
	snd_trident_port_t *p = (snd_trident_port_t *) private_data;
	struct snd_trident_port *p = (struct snd_trident_port *) private_data;

	if (p)
		snd_midi_channel_free_set(p->chset);
}

static int snd_trident_synth_create_port(trident_t * trident, int idx)
static int snd_trident_synth_create_port(struct snd_trident * trident, int idx)
{
	snd_trident_port_t *p;
	snd_seq_port_callback_t callbacks;
	struct snd_trident_port *p;
	struct snd_seq_port_callback callbacks;
	char name[32];
	char *str;
	int result;
@@ -927,17 +930,17 @@ static int snd_trident_synth_create_port(trident_t * trident, int idx)

 */

static int snd_trident_synth_new_device(snd_seq_device_t *dev)
static int snd_trident_synth_new_device(struct snd_seq_device *dev)
{
	trident_t *trident;
	struct snd_trident *trident;
	int client, i;
	snd_seq_client_callback_t callbacks;
	snd_seq_client_info_t cinfo;
	snd_seq_port_subscribe_t sub;
	snd_simple_ops_t *simpleops;
	struct snd_seq_client_callback callbacks;
	struct snd_seq_client_info cinfo;
	struct snd_seq_port_subscribe sub;
	struct snd_simple_ops *simpleops;
	char *str;

	trident = *(trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
	trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
	if (trident == NULL)
		return -EINVAL;

@@ -993,11 +996,11 @@ static int snd_trident_synth_new_device(snd_seq_device_t *dev)
	return 0;
}

static int snd_trident_synth_delete_device(snd_seq_device_t *dev)
static int snd_trident_synth_delete_device(struct snd_seq_device *dev)
{
	trident_t *trident;
	struct snd_trident *trident;

	trident = *(trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
	trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
	if (trident == NULL)
		return -EINVAL;

@@ -1012,14 +1015,14 @@ static int snd_trident_synth_delete_device(snd_seq_device_t *dev)

static int __init alsa_trident_synth_init(void)
{
	static snd_seq_dev_ops_t ops =
	static struct snd_seq_dev_ops ops =
	{
		snd_trident_synth_new_device,
		snd_trident_synth_delete_device
	};

	return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_TRIDENT, &ops,
					      sizeof(trident_t*));
					      sizeof(struct snd_trident *));
}

static void __exit alsa_trident_synth_exit(void)