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

[ALSA] Remove xxx_t typedefs: ISA SB8/SB16/SBAWE



Remove xxx_t typedefs from the ISA SB8/SB16/SBAWE drivers.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d3a7e476
Loading
Loading
Loading
Loading
+20 −19
Original line number Original line Diff line number Diff line
@@ -56,9 +56,9 @@ enum {
 * some of the channels may be used for other things so max_channels is
 * some of the channels may be used for other things so max_channels is
 * the number in use for wave voices.
 * the number in use for wave voices.
 */
 */
typedef struct snd_emu8000 {
struct snd_emu8000 {


	snd_emux_t *emu;
	struct snd_emux *emu;


	int index;		/* sequencer client index */
	int index;		/* sequencer client index */
	int seq_ports;		/* number of sequencer ports */
	int seq_ports;		/* number of sequencer ports */
@@ -77,44 +77,45 @@ typedef struct snd_emu8000 {


	int dram_checked;
	int dram_checked;


	snd_card_t *card;		/* The card that this belongs to */
	struct snd_card *card;		/* The card that this belongs to */


	int chorus_mode;
	int chorus_mode;
	int reverb_mode;
	int reverb_mode;
	int bass_level;
	int bass_level;
	int treble_level;
	int treble_level;


	snd_util_memhdr_t *memhdr;
	struct snd_util_memhdr *memhdr;


	spinlock_t control_lock;
	spinlock_t control_lock;
	snd_kcontrol_t *controls[EMU8000_NUM_CONTROLS];
	struct snd_kcontrol *controls[EMU8000_NUM_CONTROLS];


	snd_pcm_t *pcm; /* pcm on emu8000 wavetable */
	struct snd_pcm *pcm; /* pcm on emu8000 wavetable */


} emu8000_t;
};


/* sequencer device id */
/* sequencer device id */
#define SNDRV_SEQ_DEV_ID_EMU8000	"emu8000-synth"
#define SNDRV_SEQ_DEV_ID_EMU8000	"emu8000-synth"




/* exported functions */
/* exported functions */
int snd_emu8000_new(snd_card_t *card, int device, long port, int seq_ports, snd_seq_device_t **ret);
int snd_emu8000_new(struct snd_card *card, int device, long port, int seq_ports,
void snd_emu8000_poke(emu8000_t *emu, unsigned int port, unsigned int reg,
		    struct snd_seq_device **ret);
void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
		      unsigned int val);
		      unsigned int val);
unsigned short snd_emu8000_peek(emu8000_t *emu, unsigned int port,
unsigned short snd_emu8000_peek(struct snd_emu8000 *emu, unsigned int port,
				unsigned int reg);
				unsigned int reg);
void snd_emu8000_poke_dw(emu8000_t *emu, unsigned int port, unsigned int reg,
void snd_emu8000_poke_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
			 unsigned int val);
			 unsigned int val);
unsigned int snd_emu8000_peek_dw(emu8000_t *emu, unsigned int port,
unsigned int snd_emu8000_peek_dw(struct snd_emu8000 *emu, unsigned int port,
				 unsigned int reg);
				 unsigned int reg);
void snd_emu8000_dma_chan(emu8000_t *emu, int ch, int mode);
void snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode);


void snd_emu8000_init_fm(emu8000_t *emu);
void snd_emu8000_init_fm(struct snd_emu8000 *emu);


void snd_emu8000_update_chorus_mode(emu8000_t *emu);
void snd_emu8000_update_chorus_mode(struct snd_emu8000 *emu);
void snd_emu8000_update_reverb_mode(emu8000_t *emu);
void snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu);
void snd_emu8000_update_equalizer(emu8000_t *emu);
void snd_emu8000_update_equalizer(struct snd_emu8000 *emu);
int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len);
int snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len);
int snd_emu8000_load_reverb_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);


#endif /* __SOUND_EMU8000_H */
#endif /* __SOUND_EMU8000_H */
+32 −34
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ enum sb_hw_type {


#define SB_MPU_INPUT		1
#define SB_MPU_INPUT		1


struct _snd_sb {
struct snd_sb {
	unsigned long port;		/* base port of DSP chip */
	unsigned long port;		/* base port of DSP chip */
	struct resource *res_port;
	struct resource *res_port;
	unsigned long mpu_port;		/* MPU port for SB DSP 4.0+ */
	unsigned long mpu_port;		/* MPU port for SB DSP 4.0+ */
@@ -92,25 +92,23 @@ struct _snd_sb {


	void *csp; /* used only when CONFIG_SND_SB16_CSP is set */
	void *csp; /* used only when CONFIG_SND_SB16_CSP is set */


	snd_card_t *card;
	struct snd_card *card;
	snd_pcm_t *pcm;
	struct snd_pcm *pcm;
	snd_pcm_substream_t *playback_substream;
	struct snd_pcm_substream *playback_substream;
	snd_pcm_substream_t *capture_substream;
	struct snd_pcm_substream *capture_substream;


	snd_rawmidi_t *rmidi;
	struct snd_rawmidi *rmidi;
	snd_rawmidi_substream_t *midi_substream_input;
	struct snd_rawmidi_substream *midi_substream_input;
	snd_rawmidi_substream_t *midi_substream_output;
	struct snd_rawmidi_substream *midi_substream_output;
	irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs);
	irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs);


	spinlock_t reg_lock;
	spinlock_t reg_lock;
	spinlock_t open_lock;
	spinlock_t open_lock;
	spinlock_t midi_input_lock;
	spinlock_t midi_input_lock;


	snd_info_entry_t *proc_entry;
	struct snd_info_entry *proc_entry;
};
};


typedef struct _snd_sb sb_t;

/* I/O ports */
/* I/O ports */


#define SBP(chip, x)		((chip)->port + s_b_SB_##x)
#define SBP(chip, x)		((chip)->port + s_b_SB_##x)
@@ -267,48 +265,48 @@ typedef struct _snd_sb sb_t;
 *
 *
 */
 */


static inline void snd_sb_ack_8bit(sb_t *chip)
static inline void snd_sb_ack_8bit(struct snd_sb *chip)
{
{
	inb(SBP(chip, DATA_AVAIL));
	inb(SBP(chip, DATA_AVAIL));
}
}


static inline void snd_sb_ack_16bit(sb_t *chip)
static inline void snd_sb_ack_16bit(struct snd_sb *chip)
{
{
	inb(SBP(chip, DATA_AVAIL_16));
	inb(SBP(chip, DATA_AVAIL_16));
}
}


/* sb_common.c */
/* sb_common.c */
int snd_sbdsp_command(sb_t *chip, unsigned char val);
int snd_sbdsp_command(struct snd_sb *chip, unsigned char val);
int snd_sbdsp_get_byte(sb_t *chip);
int snd_sbdsp_get_byte(struct snd_sb *chip);
int snd_sbdsp_reset(sb_t *chip);
int snd_sbdsp_reset(struct snd_sb *chip);
int snd_sbdsp_create(snd_card_t *card,
int snd_sbdsp_create(struct snd_card *card,
		     unsigned long port,
		     unsigned long port,
		     int irq,
		     int irq,
		     irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
		     irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
		     int dma8, int dma16,
		     int dma8, int dma16,
		     unsigned short hardware,
		     unsigned short hardware,
		     sb_t **r_chip);
		     struct snd_sb **r_chip);
/* sb_mixer.c */
/* sb_mixer.c */
void snd_sbmixer_write(sb_t *chip, unsigned char reg, unsigned char data);
void snd_sbmixer_write(struct snd_sb *chip, unsigned char reg, unsigned char data);
unsigned char snd_sbmixer_read(sb_t *chip, unsigned char reg);
unsigned char snd_sbmixer_read(struct snd_sb *chip, unsigned char reg);
int snd_sbmixer_new(sb_t *chip);
int snd_sbmixer_new(struct snd_sb *chip);


/* sb8_init.c */
/* sb8_init.c */
int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm);
int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm);
/* sb8.c */
/* sb8.c */
irqreturn_t snd_sb8dsp_interrupt(sb_t *chip);
irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip);
int snd_sb8_playback_open(snd_pcm_substream_t *substream);
int snd_sb8_playback_open(struct snd_pcm_substream *substream);
int snd_sb8_capture_open(snd_pcm_substream_t *substream);
int snd_sb8_capture_open(struct snd_pcm_substream *substream);
int snd_sb8_playback_close(snd_pcm_substream_t *substream);
int snd_sb8_playback_close(struct snd_pcm_substream *substream);
int snd_sb8_capture_close(snd_pcm_substream_t *substream);
int snd_sb8_capture_close(struct snd_pcm_substream *substream);
/* midi8.c */
/* midi8.c */
irqreturn_t snd_sb8dsp_midi_interrupt(sb_t *chip);
irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip);
int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi);
int snd_sb8dsp_midi(struct snd_sb *chip, int device, struct snd_rawmidi ** rrawmidi);


/* sb16_init.c */
/* sb16_init.c */
int snd_sb16dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm);
int snd_sb16dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm);
const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction);
const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction);
int snd_sb16dsp_configure(sb_t *chip);
int snd_sb16dsp_configure(struct snd_sb *chip);
/* sb16.c */
/* sb16.c */
irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs);


@@ -328,7 +326,7 @@ enum {
#define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \
#define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \
  ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24))
  ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24))


int snd_sbmixer_add_ctl(sb_t *chip, const char *name, int index, int type, unsigned long value);
int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int type, unsigned long value);


/* for ease of use */
/* for ease of use */
struct sbmix_elem {
struct sbmix_elem {
@@ -352,7 +350,7 @@ struct sbmix_elem {
  .type = SB_MIX_INPUT_SW, \
  .type = SB_MIX_INPUT_SW, \
  .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) }
  .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) }


static inline int snd_sbmixer_add_ctl_elem(sb_t *chip, const struct sbmix_elem *c)
static inline int snd_sbmixer_add_ctl_elem(struct snd_sb *chip, const struct sbmix_elem *c)
{
{
	return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value);
	return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value);
}
}
+26 −26
Original line number Original line Diff line number Diff line
@@ -63,25 +63,25 @@
#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE	0x3000
#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE	0x3000


/* microcode header */
/* microcode header */
typedef struct snd_sb_csp_mc_header {
struct snd_sb_csp_mc_header {
	char codec_name[16];		/* id name of codec */
	char codec_name[16];		/* id name of codec */
	unsigned short func_req;	/* requested function */
	unsigned short func_req;	/* requested function */
} snd_sb_csp_mc_header_t;
};


/* microcode to be loaded */
/* microcode to be loaded */
typedef struct snd_sb_csp_microcode {
struct snd_sb_csp_microcode {
	snd_sb_csp_mc_header_t info;
	struct snd_sb_csp_mc_header info;
	unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
	unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
} snd_sb_csp_microcode_t;
};


/* start CSP with sample_width in mono/stereo */
/* start CSP with sample_width in mono/stereo */
typedef struct snd_sb_csp_start {
struct snd_sb_csp_start {
	int sample_width;	/* sample width, look above */
	int sample_width;	/* sample width, look above */
	int channels;		/* channels, look above */
	int channels;		/* channels, look above */
} snd_sb_csp_start_t;
};


/* CSP information */
/* CSP information */
typedef struct snd_sb_csp_info {
struct snd_sb_csp_info {
	char codec_name[16];		/* id name of codec */
	char codec_name[16];		/* id name of codec */
	unsigned short func_nr;		/* function number */
	unsigned short func_nr;		/* function number */
	unsigned int acc_format;	/* accepted PCM formats */
	unsigned int acc_format;	/* accepted PCM formats */
@@ -93,17 +93,17 @@ typedef struct snd_sb_csp_info {
	unsigned short run_width;	/* current sample width */
	unsigned short run_width;	/* current sample width */
	unsigned short version;		/* version id: 0x10 - 0x1f */
	unsigned short version;		/* version id: 0x10 - 0x1f */
	unsigned short state;		/* state bits */
	unsigned short state;		/* state bits */
} snd_sb_csp_info_t;
};


/* HWDEP controls */
/* HWDEP controls */
/* get CSP information */
/* get CSP information */
#define SNDRV_SB_CSP_IOCTL_INFO		_IOR('H', 0x10, snd_sb_csp_info_t)
#define SNDRV_SB_CSP_IOCTL_INFO		_IOR('H', 0x10, struct snd_sb_csp_info)
/* load microcode to CSP */
/* load microcode to CSP */
#define SNDRV_SB_CSP_IOCTL_LOAD_CODE	_IOW('H', 0x11, snd_sb_csp_microcode_t)
#define SNDRV_SB_CSP_IOCTL_LOAD_CODE	_IOW('H', 0x11, struct snd_sb_csp_microcode)
/* unload microcode from CSP */
/* unload microcode from CSP */
#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE	_IO('H', 0x12)
#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE	_IO('H', 0x12)
/* start CSP */
/* start CSP */
#define SNDRV_SB_CSP_IOCTL_START		_IOW('H', 0x13, snd_sb_csp_start_t)
#define SNDRV_SB_CSP_IOCTL_START		_IOW('H', 0x13, struct snd_sb_csp_start)
/* stop CSP */
/* stop CSP */
#define SNDRV_SB_CSP_IOCTL_STOP		_IO('H', 0x14)
#define SNDRV_SB_CSP_IOCTL_STOP		_IO('H', 0x14)
/* pause CSP and DMA transfer */
/* pause CSP and DMA transfer */
@@ -115,25 +115,25 @@ typedef struct snd_sb_csp_info {
#include "sb.h"
#include "sb.h"
#include "hwdep.h"
#include "hwdep.h"


typedef struct snd_sb_csp snd_sb_csp_t;
struct snd_sb_csp;


/*
/*
 * CSP operators
 * CSP operators
 */
 */
typedef struct {
struct snd_sb_csp_ops {
	int (*csp_use) (snd_sb_csp_t * p);
	int (*csp_use) (struct snd_sb_csp * p);
	int (*csp_unuse) (snd_sb_csp_t * p);
	int (*csp_unuse) (struct snd_sb_csp * p);
	int (*csp_autoload) (snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode);
	int (*csp_autoload) (struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode);
	int (*csp_start) (snd_sb_csp_t * p, int sample_width, int channels);
	int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
	int (*csp_stop) (snd_sb_csp_t * p);
	int (*csp_stop) (struct snd_sb_csp * p);
	int (*csp_qsound_transfer) (snd_sb_csp_t * p);
	int (*csp_qsound_transfer) (struct snd_sb_csp * p);
} snd_sb_csp_ops_t;
};


/*
/*
 * CSP private data
 * CSP private data
 */
 */
struct snd_sb_csp {
struct snd_sb_csp {
	sb_t *chip;		/* SB16 DSP */
	struct snd_sb *chip;		/* SB16 DSP */
	int used;		/* usage flag - exclusive */
	int used;		/* usage flag - exclusive */
	char codec_name[16];	/* name of codec */
	char codec_name[16];	/* name of codec */
	unsigned short func_nr;	/* function number */
	unsigned short func_nr;	/* function number */
@@ -147,7 +147,7 @@ struct snd_sb_csp {
	int version;		/* CSP version (0x10 - 0x1f) */
	int version;		/* CSP version (0x10 - 0x1f) */
	int running;		/* running state */
	int running;		/* running state */


	snd_sb_csp_ops_t ops;	/* operators */
	struct snd_sb_csp_ops ops;	/* operators */


	spinlock_t q_lock;	/* locking */
	spinlock_t q_lock;	/* locking */
	int q_enabled;		/* enabled flag */
	int q_enabled;		/* enabled flag */
@@ -155,13 +155,13 @@ struct snd_sb_csp {
	int qpos_right;		/* right position */
	int qpos_right;		/* right position */
	int qpos_changed;	/* position changed flag */
	int qpos_changed;	/* position changed flag */


	snd_kcontrol_t *qsound_switch;
	struct snd_kcontrol *qsound_switch;
	snd_kcontrol_t *qsound_space;
	struct snd_kcontrol *qsound_space;


	struct semaphore access_mutex;	/* locking */
	struct semaphore access_mutex;	/* locking */
};
};


int snd_sb_csp_new(sb_t *chip, int device, snd_hwdep_t ** rhwdep);
int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
#endif
#endif


#endif /* __SOUND_SB16_CSP */
#endif /* __SOUND_SB16_CSP */
+61 −60
Original line number Original line Diff line number Diff line
@@ -45,7 +45,7 @@
 * directly.  The macros handle the port number and command word.
 * directly.  The macros handle the port number and command word.
 */
 */
/* Write a word */
/* Write a word */
void snd_emu8000_poke(emu8000_t *emu, unsigned int port, unsigned int reg, unsigned int val)
void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port, unsigned int reg, unsigned int val)
{
{
	unsigned long flags;
	unsigned long flags;
	spin_lock_irqsave(&emu->reg_lock, flags);
	spin_lock_irqsave(&emu->reg_lock, flags);
@@ -58,7 +58,7 @@ void snd_emu8000_poke(emu8000_t *emu, unsigned int port, unsigned int reg, unsig
}
}


/* Read a word */
/* Read a word */
unsigned short snd_emu8000_peek(emu8000_t *emu, unsigned int port, unsigned int reg)
unsigned short snd_emu8000_peek(struct snd_emu8000 *emu, unsigned int port, unsigned int reg)
{
{
	unsigned short res;
	unsigned short res;
	unsigned long flags;
	unsigned long flags;
@@ -73,7 +73,7 @@ unsigned short snd_emu8000_peek(emu8000_t *emu, unsigned int port, unsigned int
}
}


/* Write a double word */
/* Write a double word */
void snd_emu8000_poke_dw(emu8000_t *emu, unsigned int port, unsigned int reg, unsigned int val)
void snd_emu8000_poke_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg, unsigned int val)
{
{
	unsigned long flags;
	unsigned long flags;
	spin_lock_irqsave(&emu->reg_lock, flags);
	spin_lock_irqsave(&emu->reg_lock, flags);
@@ -87,7 +87,7 @@ void snd_emu8000_poke_dw(emu8000_t *emu, unsigned int port, unsigned int reg, un
}
}


/* Read a double word */
/* Read a double word */
unsigned int snd_emu8000_peek_dw(emu8000_t *emu, unsigned int port, unsigned int reg)
unsigned int snd_emu8000_peek_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg)
{
{
	unsigned short low;
	unsigned short low;
	unsigned int res;
	unsigned int res;
@@ -107,7 +107,7 @@ unsigned int snd_emu8000_peek_dw(emu8000_t *emu, unsigned int port, unsigned int
 * Set up / close a channel to be used for DMA.
 * Set up / close a channel to be used for DMA.
 */
 */
/*exported*/ void
/*exported*/ void
snd_emu8000_dma_chan(emu8000_t *emu, int ch, int mode)
snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode)
{
{
	unsigned right_bit = (mode & EMU8000_RAM_RIGHT) ? 0x01000000 : 0;
	unsigned right_bit = (mode & EMU8000_RAM_RIGHT) ? 0x01000000 : 0;
	mode &= EMU8000_RAM_MODE_MASK;
	mode &= EMU8000_RAM_MODE_MASK;
@@ -132,7 +132,7 @@ snd_emu8000_dma_chan(emu8000_t *emu, int ch, int mode)
/*
/*
 */
 */
static void __init
static void __init
snd_emu8000_read_wait(emu8000_t *emu)
snd_emu8000_read_wait(struct snd_emu8000 *emu)
{
{
	while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) {
	while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) {
		schedule_timeout_interruptible(1);
		schedule_timeout_interruptible(1);
@@ -144,7 +144,7 @@ snd_emu8000_read_wait(emu8000_t *emu)
/*
/*
 */
 */
static void __init
static void __init
snd_emu8000_write_wait(emu8000_t *emu)
snd_emu8000_write_wait(struct snd_emu8000 *emu)
{
{
	while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
	while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
		schedule_timeout_interruptible(1);
		schedule_timeout_interruptible(1);
@@ -157,7 +157,7 @@ snd_emu8000_write_wait(emu8000_t *emu)
 * detect a card at the given port
 * detect a card at the given port
 */
 */
static int __init
static int __init
snd_emu8000_detect(emu8000_t *emu)
snd_emu8000_detect(struct snd_emu8000 *emu)
{
{
	/* Initialise */
	/* Initialise */
	EMU8000_HWCF1_WRITE(emu, 0x0059);
	EMU8000_HWCF1_WRITE(emu, 0x0059);
@@ -183,7 +183,7 @@ snd_emu8000_detect(emu8000_t *emu)
 * intiailize audio channels
 * intiailize audio channels
 */
 */
static void __init
static void __init
init_audio(emu8000_t *emu)
init_audio(struct snd_emu8000 *emu)
{
{
	int ch;
	int ch;


@@ -224,7 +224,7 @@ init_audio(emu8000_t *emu)
 * initialize DMA address
 * initialize DMA address
 */
 */
static void __init
static void __init
init_dma(emu8000_t *emu)
init_dma(struct snd_emu8000 *emu)
{
{
	EMU8000_SMALR_WRITE(emu, 0);
	EMU8000_SMALR_WRITE(emu, 0);
	EMU8000_SMARR_WRITE(emu, 0);
	EMU8000_SMARR_WRITE(emu, 0);
@@ -328,7 +328,7 @@ static unsigned short init4[128] /*__devinitdata*/ = {
 * is meant to work
 * is meant to work
 */
 */
static void __init
static void __init
send_array(emu8000_t *emu, unsigned short *data, int size)
send_array(struct snd_emu8000 *emu, unsigned short *data, int size)
{
{
	int i;
	int i;
	unsigned short *p;
	unsigned short *p;
@@ -350,7 +350,7 @@ send_array(emu8000_t *emu, unsigned short *data, int size)
 * initialisation sequence in the adip.
 * initialisation sequence in the adip.
 */
 */
static void __init
static void __init
init_arrays(emu8000_t *emu)
init_arrays(struct snd_emu8000 *emu)
{
{
	send_array(emu, init1, ARRAY_SIZE(init1)/4);
	send_array(emu, init1, ARRAY_SIZE(init1)/4);


@@ -376,7 +376,7 @@ init_arrays(emu8000_t *emu)
 * reallocating between read and write.
 * reallocating between read and write.
 */
 */
static void __init
static void __init
size_dram(emu8000_t *emu)
size_dram(struct snd_emu8000 *emu)
{
{
	int i, size;
	int i, size;


@@ -455,7 +455,7 @@ size_dram(emu8000_t *emu)
 * and therefore lose 2 voices.
 * and therefore lose 2 voices.
 */
 */
/*exported*/ void
/*exported*/ void
snd_emu8000_init_fm(emu8000_t *emu)
snd_emu8000_init_fm(struct snd_emu8000 *emu)
{
{
	unsigned long flags;
	unsigned long flags;


@@ -501,7 +501,7 @@ snd_emu8000_init_fm(emu8000_t *emu)
 * The main initialization routine.
 * The main initialization routine.
 */
 */
static void __init
static void __init
snd_emu8000_init_hw(emu8000_t *emu)
snd_emu8000_init_hw(struct snd_emu8000 *emu)
{
{
	int i;
	int i;


@@ -585,7 +585,7 @@ static unsigned short treble_parm[12][9] = {
 * set Emu8000 digital equalizer; from 0 to 11 [-12dB - 12dB]
 * set Emu8000 digital equalizer; from 0 to 11 [-12dB - 12dB]
 */
 */
/*exported*/ void
/*exported*/ void
snd_emu8000_update_equalizer(emu8000_t *emu)
snd_emu8000_update_equalizer(struct snd_emu8000 *emu)
{
{
	unsigned short w;
	unsigned short w;
	int bass = emu->bass_level;
	int bass = emu->bass_level;
@@ -628,17 +628,17 @@ snd_emu8000_update_equalizer(emu8000_t *emu)
/* user can define chorus modes up to 32 */
/* user can define chorus modes up to 32 */
#define SNDRV_EMU8000_CHORUS_NUMBERS	32
#define SNDRV_EMU8000_CHORUS_NUMBERS	32


typedef struct soundfont_chorus_fx_t {
struct soundfont_chorus_fx {
	unsigned short feedback;	/* feedback level (0xE600-0xE6FF) */
	unsigned short feedback;	/* feedback level (0xE600-0xE6FF) */
	unsigned short delay_offset;	/* delay (0-0x0DA3) [1/44100 sec] */
	unsigned short delay_offset;	/* delay (0-0x0DA3) [1/44100 sec] */
	unsigned short lfo_depth;	/* LFO depth (0xBC00-0xBCFF) */
	unsigned short lfo_depth;	/* LFO depth (0xBC00-0xBCFF) */
	unsigned int delay;	/* right delay (0-0xFFFFFFFF) [1/256/44100 sec] */
	unsigned int delay;	/* right delay (0-0xFFFFFFFF) [1/256/44100 sec] */
	unsigned int lfo_freq;		/* LFO freq LFO freq (0-0xFFFFFFFF) */
	unsigned int lfo_freq;		/* LFO freq LFO freq (0-0xFFFFFFFF) */
} soundfont_chorus_fx_t;
};


/* 5 parameters for each chorus mode; 3 x 16bit, 2 x 32bit */
/* 5 parameters for each chorus mode; 3 x 16bit, 2 x 32bit */
static char chorus_defined[SNDRV_EMU8000_CHORUS_NUMBERS];
static char chorus_defined[SNDRV_EMU8000_CHORUS_NUMBERS];
static soundfont_chorus_fx_t chorus_parm[SNDRV_EMU8000_CHORUS_NUMBERS] = {
static struct soundfont_chorus_fx chorus_parm[SNDRV_EMU8000_CHORUS_NUMBERS] = {
	{0xE600, 0x03F6, 0xBC2C ,0x00000000, 0x0000006D}, /* chorus 1 */
	{0xE600, 0x03F6, 0xBC2C ,0x00000000, 0x0000006D}, /* chorus 1 */
	{0xE608, 0x031A, 0xBC6E, 0x00000000, 0x0000017C}, /* chorus 2 */
	{0xE608, 0x031A, 0xBC6E, 0x00000000, 0x0000017C}, /* chorus 2 */
	{0xE610, 0x031A, 0xBC84, 0x00000000, 0x00000083}, /* chorus 3 */
	{0xE610, 0x031A, 0xBC84, 0x00000000, 0x00000083}, /* chorus 3 */
@@ -650,9 +650,9 @@ static soundfont_chorus_fx_t chorus_parm[SNDRV_EMU8000_CHORUS_NUMBERS] = {
};
};


/*exported*/ int
/*exported*/ int
snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len)
snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len)
{
{
	soundfont_chorus_fx_t rec;
	struct soundfont_chorus_fx rec;
	if (mode < SNDRV_EMU8000_CHORUS_PREDEFINED || mode >= SNDRV_EMU8000_CHORUS_NUMBERS) {
	if (mode < SNDRV_EMU8000_CHORUS_PREDEFINED || mode >= SNDRV_EMU8000_CHORUS_NUMBERS) {
		snd_printk(KERN_WARNING "invalid chorus mode %d for uploading\n", mode);
		snd_printk(KERN_WARNING "invalid chorus mode %d for uploading\n", mode);
		return -EINVAL;
		return -EINVAL;
@@ -665,7 +665,7 @@ snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, lon
}
}


/*exported*/ void
/*exported*/ void
snd_emu8000_update_chorus_mode(emu8000_t *emu)
snd_emu8000_update_chorus_mode(struct snd_emu8000 *emu)
{
{
	int effect = emu->chorus_mode;
	int effect = emu->chorus_mode;
	if (effect < 0 || effect >= SNDRV_EMU8000_CHORUS_NUMBERS ||
	if (effect < 0 || effect >= SNDRV_EMU8000_CHORUS_NUMBERS ||
@@ -699,15 +699,15 @@ snd_emu8000_update_chorus_mode(emu8000_t *emu)
/* user can define reverb modes up to 32 */
/* user can define reverb modes up to 32 */
#define SNDRV_EMU8000_REVERB_NUMBERS	32
#define SNDRV_EMU8000_REVERB_NUMBERS	32


typedef struct soundfont_reverb_fx_t {
struct soundfont_reverb_fx {
	unsigned short parms[28];
	unsigned short parms[28];
} soundfont_reverb_fx_t;
};


/* reverb mode settings; write the following 28 data of 16 bit length
/* reverb mode settings; write the following 28 data of 16 bit length
 *   on the corresponding ports in the reverb_cmds array
 *   on the corresponding ports in the reverb_cmds array
 */
 */
static char reverb_defined[SNDRV_EMU8000_CHORUS_NUMBERS];
static char reverb_defined[SNDRV_EMU8000_CHORUS_NUMBERS];
static soundfont_reverb_fx_t reverb_parm[SNDRV_EMU8000_REVERB_NUMBERS] = {
static struct soundfont_reverb_fx reverb_parm[SNDRV_EMU8000_REVERB_NUMBERS] = {
{{  /* room 1 */
{{  /* room 1 */
	0xB488, 0xA450, 0x9550, 0x84B5, 0x383A, 0x3EB5, 0x72F4,
	0xB488, 0xA450, 0x9550, 0x84B5, 0x383A, 0x3EB5, 0x72F4,
	0x72A4, 0x7254, 0x7204, 0x7204, 0x7204, 0x4416, 0x4516,
	0x72A4, 0x7254, 0x7204, 0x7204, 0x7204, 0x4416, 0x4516,
@@ -777,9 +777,9 @@ static struct reverb_cmd_pair {
};
};


/*exported*/ int
/*exported*/ int
snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len)
snd_emu8000_load_reverb_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len)
{
{
	soundfont_reverb_fx_t rec;
	struct soundfont_reverb_fx rec;


	if (mode < SNDRV_EMU8000_REVERB_PREDEFINED || mode >= SNDRV_EMU8000_REVERB_NUMBERS) {
	if (mode < SNDRV_EMU8000_REVERB_PREDEFINED || mode >= SNDRV_EMU8000_REVERB_NUMBERS) {
		snd_printk(KERN_WARNING "invalid reverb mode %d for uploading\n", mode);
		snd_printk(KERN_WARNING "invalid reverb mode %d for uploading\n", mode);
@@ -793,7 +793,7 @@ snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, lon
}
}


/*exported*/ void
/*exported*/ void
snd_emu8000_update_reverb_mode(emu8000_t *emu)
snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu)
{
{
	int effect = emu->reverb_mode;
	int effect = emu->reverb_mode;
	int i;
	int i;
@@ -819,7 +819,7 @@ snd_emu8000_update_reverb_mode(emu8000_t *emu)
/*
/*
 * bass/treble
 * bass/treble
 */
 */
static int mixer_bass_treble_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
static int mixer_bass_treble_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 1;
	uinfo->count = 1;
@@ -828,17 +828,17 @@ static int mixer_bass_treble_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
	return 0;
	return 0;
}
}


static int mixer_bass_treble_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
static int mixer_bass_treble_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
{
	emu8000_t *emu = snd_kcontrol_chip(kcontrol);
	struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
	
	
	ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->treble_level : emu->bass_level;
	ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->treble_level : emu->bass_level;
	return 0;
	return 0;
}
}


static int mixer_bass_treble_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
static int mixer_bass_treble_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
{
	emu8000_t *emu = snd_kcontrol_chip(kcontrol);
	struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
	unsigned long flags;
	unsigned long flags;
	int change;
	int change;
	unsigned short val1;
	unsigned short val1;
@@ -857,7 +857,7 @@ static int mixer_bass_treble_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
	return change;
	return change;
}
}


static snd_kcontrol_new_t mixer_bass_control =
static struct snd_kcontrol_new mixer_bass_control =
{
{
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Synth Tone Control - Bass",
	.name = "Synth Tone Control - Bass",
@@ -867,7 +867,7 @@ static snd_kcontrol_new_t mixer_bass_control =
	.private_value = 0,
	.private_value = 0,
};
};


static snd_kcontrol_new_t mixer_treble_control =
static struct snd_kcontrol_new mixer_treble_control =
{
{
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Synth Tone Control - Treble",
	.name = "Synth Tone Control - Treble",
@@ -880,7 +880,7 @@ static snd_kcontrol_new_t mixer_treble_control =
/*
/*
 * chorus/reverb mode
 * chorus/reverb mode
 */
 */
static int mixer_chorus_reverb_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
static int mixer_chorus_reverb_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 1;
	uinfo->count = 1;
@@ -889,17 +889,17 @@ static int mixer_chorus_reverb_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_
	return 0;
	return 0;
}
}


static int mixer_chorus_reverb_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
static int mixer_chorus_reverb_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
{
	emu8000_t *emu = snd_kcontrol_chip(kcontrol);
	struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
	
	
	ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->chorus_mode : emu->reverb_mode;
	ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->chorus_mode : emu->reverb_mode;
	return 0;
	return 0;
}
}


static int mixer_chorus_reverb_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
static int mixer_chorus_reverb_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
{
	emu8000_t *emu = snd_kcontrol_chip(kcontrol);
	struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
	unsigned long flags;
	unsigned long flags;
	int change;
	int change;
	unsigned short val1;
	unsigned short val1;
@@ -924,7 +924,7 @@ static int mixer_chorus_reverb_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
	return change;
	return change;
}
}


static snd_kcontrol_new_t mixer_chorus_mode_control =
static struct snd_kcontrol_new mixer_chorus_mode_control =
{
{
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Chorus Mode",
	.name = "Chorus Mode",
@@ -934,7 +934,7 @@ static snd_kcontrol_new_t mixer_chorus_mode_control =
	.private_value = 1,
	.private_value = 1,
};
};


static snd_kcontrol_new_t mixer_reverb_mode_control =
static struct snd_kcontrol_new mixer_reverb_mode_control =
{
{
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Reverb Mode",
	.name = "Reverb Mode",
@@ -947,7 +947,7 @@ static snd_kcontrol_new_t mixer_reverb_mode_control =
/*
/*
 * FM OPL3 chorus/reverb depth
 * FM OPL3 chorus/reverb depth
 */
 */
static int mixer_fm_depth_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
static int mixer_fm_depth_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 1;
	uinfo->count = 1;
@@ -956,17 +956,17 @@ static int mixer_fm_depth_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * u
	return 0;
	return 0;
}
}


static int mixer_fm_depth_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
static int mixer_fm_depth_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
{
	emu8000_t *emu = snd_kcontrol_chip(kcontrol);
	struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
	
	
	ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->fm_chorus_depth : emu->fm_reverb_depth;
	ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->fm_chorus_depth : emu->fm_reverb_depth;
	return 0;
	return 0;
}
}


static int mixer_fm_depth_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
static int mixer_fm_depth_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
{
	emu8000_t *emu = snd_kcontrol_chip(kcontrol);
	struct snd_emu8000 *emu = snd_kcontrol_chip(kcontrol);
	unsigned long flags;
	unsigned long flags;
	int change;
	int change;
	unsigned short val1;
	unsigned short val1;
@@ -986,7 +986,7 @@ static int mixer_fm_depth_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
	return change;
	return change;
}
}


static snd_kcontrol_new_t mixer_fm_chorus_depth_control =
static struct snd_kcontrol_new mixer_fm_chorus_depth_control =
{
{
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "FM Chorus Depth",
	.name = "FM Chorus Depth",
@@ -996,7 +996,7 @@ static snd_kcontrol_new_t mixer_fm_chorus_depth_control =
	.private_value = 1,
	.private_value = 1,
};
};


static snd_kcontrol_new_t mixer_fm_reverb_depth_control =
static struct snd_kcontrol_new mixer_fm_reverb_depth_control =
{
{
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "FM Reverb Depth",
	.name = "FM Reverb Depth",
@@ -1007,7 +1007,7 @@ static snd_kcontrol_new_t mixer_fm_reverb_depth_control =
};
};




static snd_kcontrol_new_t *mixer_defs[EMU8000_NUM_CONTROLS] = {
static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = {
	&mixer_bass_control,
	&mixer_bass_control,
	&mixer_treble_control,
	&mixer_treble_control,
	&mixer_chorus_mode_control,
	&mixer_chorus_mode_control,
@@ -1020,7 +1020,7 @@ static snd_kcontrol_new_t *mixer_defs[EMU8000_NUM_CONTROLS] = {
 * create and attach mixer elements for WaveTable treble/bass controls
 * create and attach mixer elements for WaveTable treble/bass controls
 */
 */
static int __init
static int __init
snd_emu8000_create_mixer(snd_card_t *card, emu8000_t *emu)
snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
{
{
	int i, err = 0;
	int i, err = 0;


@@ -1049,7 +1049,7 @@ snd_emu8000_create_mixer(snd_card_t *card, emu8000_t *emu)
/*
/*
 * free resources
 * free resources
 */
 */
static int snd_emu8000_free(emu8000_t *hw)
static int snd_emu8000_free(struct snd_emu8000 *hw)
{
{
	release_and_free_resource(hw->res_port1);
	release_and_free_resource(hw->res_port1);
	release_and_free_resource(hw->res_port2);
	release_and_free_resource(hw->res_port2);
@@ -1060,9 +1060,9 @@ static int snd_emu8000_free(emu8000_t *hw)


/*
/*
 */
 */
static int snd_emu8000_dev_free(snd_device_t *device)
static int snd_emu8000_dev_free(struct snd_device *device)
{
{
	emu8000_t *hw = device->device_data;
	struct snd_emu8000 *hw = device->device_data;
	return snd_emu8000_free(hw);
	return snd_emu8000_free(hw);
}
}


@@ -1070,12 +1070,13 @@ static int snd_emu8000_dev_free(snd_device_t *device)
 * initialize and register emu8000 synth device.
 * initialize and register emu8000 synth device.
 */
 */
int __init
int __init
snd_emu8000_new(snd_card_t *card, int index, long port, int seq_ports, snd_seq_device_t **awe_ret)
snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports,
		struct snd_seq_device **awe_ret)
{
{
	snd_seq_device_t *awe;
	struct snd_seq_device *awe;
	emu8000_t *hw;
	struct snd_emu8000 *hw;
	int err;
	int err;
	static snd_device_ops_t ops = {
	static struct snd_device_ops ops = {
		.dev_free = snd_emu8000_dev_free,
		.dev_free = snd_emu8000_dev_free,
	};
	};


@@ -1127,9 +1128,9 @@ snd_emu8000_new(snd_card_t *card, int index, long port, int seq_ports, snd_seq_d
	}
	}
#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
	if (snd_seq_device_new(card, index, SNDRV_SEQ_DEV_ID_EMU8000,
	if (snd_seq_device_new(card, index, SNDRV_SEQ_DEV_ID_EMU8000,
			       sizeof(emu8000_t*), &awe) >= 0) {
			       sizeof(struct snd_emu8000*), &awe) >= 0) {
		strcpy(awe->name, "EMU-8000");
		strcpy(awe->name, "EMU-8000");
		*(emu8000_t**)SNDRV_SEQ_DEVICE_ARGPTR(awe) = hw;
		*(struct snd_emu8000 **)SNDRV_SEQ_DEVICE_ARGPTR(awe) = hw;
	}
	}
#else
#else
	awe = NULL;
	awe = NULL;
+55 −52

File changed.

Preview size limit exceeded, changes collapsed.

Loading