From e4a3d145455159955d6ac1df976b2ed2a135b858 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 14:55:40 +0100 Subject: [ALSA] Remove xxx_t typedefs: PCI CA0106 Modules: CA0106 driver Remove xxx_t typedefs from the PCI CA0106 driver. Signed-off-by: Takashi Iwai --- sound/pci/ca0106/ca0106.h | 54 +++++----- sound/pci/ca0106/ca0106_main.c | 234 ++++++++++++++++++++-------------------- sound/pci/ca0106/ca0106_mixer.c | 99 +++++++++-------- sound/pci/ca0106/ca0106_proc.c | 60 +++++------ sound/pci/ca0106/ca_midi.c | 49 +++++---- sound/pci/ca0106/ca_midi.h | 25 ++--- 6 files changed, 263 insertions(+), 258 deletions(-) (limited to 'sound/pci/ca0106') diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h index 9a4b640..7088317 100644 --- a/sound/pci/ca0106/ca0106.h +++ b/sound/pci/ca0106/ca0106.h @@ -554,37 +554,35 @@ #include "ca_midi.h" -typedef struct snd_ca0106_channel ca0106_channel_t; -typedef struct snd_ca0106 ca0106_t; -typedef struct snd_ca0106_pcm ca0106_pcm_t; +struct snd_ca0106; struct snd_ca0106_channel { - ca0106_t *emu; + struct snd_ca0106 *emu; int number; int use; - void (*interrupt)(ca0106_t *emu, ca0106_channel_t *channel); - ca0106_pcm_t *epcm; + void (*interrupt)(struct snd_ca0106 *emu, struct snd_ca0106_channel *channel); + struct snd_ca0106_pcm *epcm; }; struct snd_ca0106_pcm { - ca0106_t *emu; - snd_pcm_substream_t *substream; + struct snd_ca0106 *emu; + struct snd_pcm_substream *substream; int channel_id; unsigned short running; }; -typedef struct { +struct snd_ca0106_details { u32 serial; char * name; int ac97; int gpio_type; int i2c_adc; -} ca0106_details_t; +}; // definition of the chip-specific record struct snd_ca0106 { - snd_card_t *card; - ca0106_details_t *details; + struct snd_card *card; + struct snd_ca0106_details *details; struct pci_dev *pci; unsigned long port; @@ -597,11 +595,11 @@ struct snd_ca0106 { spinlock_t emu_lock; - ac97_t *ac97; - snd_pcm_t *pcm; + struct snd_ac97 *ac97; + struct snd_pcm *pcm; - ca0106_channel_t playback_channels[4]; - ca0106_channel_t capture_channels[4]; + struct snd_ca0106_channel playback_channels[4]; + struct snd_ca0106_channel capture_channels[4]; u32 spdif_bits[4]; /* s/pdif out setup */ int spdif_enable; int capture_source; @@ -609,22 +607,22 @@ struct snd_ca0106 { struct snd_dma_buffer buffer; - ca_midi_t midi; - ca_midi_t midi2; + struct snd_ca_midi midi; + struct snd_ca_midi midi2; }; -int __devinit snd_ca0106_mixer(ca0106_t *emu); -int __devinit snd_ca0106_proc_init(ca0106_t * emu); +int snd_ca0106_mixer(struct snd_ca0106 *emu); +int snd_ca0106_proc_init(struct snd_ca0106 * emu); -unsigned int snd_ca0106_ptr_read(ca0106_t * emu, - unsigned int reg, - unsigned int chn); +unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu, + unsigned int reg, + unsigned int chn); -void snd_ca0106_ptr_write(ca0106_t *emu, - unsigned int reg, - unsigned int chn, - unsigned int data); +void snd_ca0106_ptr_write(struct snd_ca0106 *emu, + unsigned int reg, + unsigned int chn, + unsigned int data); -int snd_ca0106_i2c_write(ca0106_t *emu, u32 reg, u32 value); +int snd_ca0106_i2c_write(struct snd_ca0106 *emu, u32 reg, u32 value); diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 0120c46..744f971 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -164,7 +164,7 @@ MODULE_PARM_DESC(enable, "Enable the CA0106 soundcard."); #include "ca0106.h" -static ca0106_details_t ca0106_chip_details[] = { +static struct snd_ca0106_details ca0106_chip_details[] = { /* AudigyLS[SB0310] */ { .serial = 0x10021102, .name = "AudigyLS [SB0310]", @@ -201,7 +201,7 @@ static ca0106_details_t ca0106_chip_details[] = { }; /* hardware definition */ -static snd_pcm_hardware_t snd_ca0106_playback_hw = { +static struct snd_pcm_hardware snd_ca0106_playback_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -221,7 +221,7 @@ static snd_pcm_hardware_t snd_ca0106_playback_hw = { .fifo_size = 0, }; -static snd_pcm_hardware_t snd_ca0106_capture_hw = { +static struct snd_pcm_hardware snd_ca0106_capture_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -241,7 +241,7 @@ static snd_pcm_hardware_t snd_ca0106_capture_hw = { .fifo_size = 0, }; -unsigned int snd_ca0106_ptr_read(ca0106_t * emu, +unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu, unsigned int reg, unsigned int chn) { @@ -257,7 +257,7 @@ unsigned int snd_ca0106_ptr_read(ca0106_t * emu, return val; } -void snd_ca0106_ptr_write(ca0106_t *emu, +void snd_ca0106_ptr_write(struct snd_ca0106 *emu, unsigned int reg, unsigned int chn, unsigned int data) @@ -273,7 +273,7 @@ void snd_ca0106_ptr_write(ca0106_t *emu, spin_unlock_irqrestore(&emu->emu_lock, flags); } -int snd_ca0106_i2c_write(ca0106_t *emu, +int snd_ca0106_i2c_write(struct snd_ca0106 *emu, u32 reg, u32 value) { @@ -325,7 +325,7 @@ int snd_ca0106_i2c_write(ca0106_t *emu, } -static void snd_ca0106_intr_enable(ca0106_t *emu, unsigned int intrenb) +static void snd_ca0106_intr_enable(struct snd_ca0106 *emu, unsigned int intrenb) { unsigned long flags; unsigned int enable; @@ -336,7 +336,7 @@ static void snd_ca0106_intr_enable(ca0106_t *emu, unsigned int intrenb) spin_unlock_irqrestore(&emu->emu_lock, flags); } -static void snd_ca0106_intr_disable(ca0106_t *emu, unsigned int intrenb) +static void snd_ca0106_intr_disable(struct snd_ca0106 *emu, unsigned int intrenb) { unsigned long flags; unsigned int enable; @@ -348,18 +348,19 @@ static void snd_ca0106_intr_disable(ca0106_t *emu, unsigned int intrenb) } -static void snd_ca0106_pcm_free_substream(snd_pcm_runtime_t *runtime) +static void snd_ca0106_pcm_free_substream(struct snd_pcm_runtime *runtime) { kfree(runtime->private_data); } /* open_playback callback */ -static int snd_ca0106_pcm_open_playback_channel(snd_pcm_substream_t *substream, int channel_id) +static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substream, + int channel_id) { - ca0106_t *chip = snd_pcm_substream_chip(substream); - ca0106_channel_t *channel = &(chip->playback_channels[channel_id]); - ca0106_pcm_t *epcm; - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); + struct snd_ca0106_channel *channel = &(chip->playback_channels[channel_id]); + struct snd_ca0106_pcm *epcm; + struct snd_pcm_runtime *runtime = substream->runtime; int err; epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); @@ -390,43 +391,44 @@ static int snd_ca0106_pcm_open_playback_channel(snd_pcm_substream_t *substream, } /* close callback */ -static int snd_ca0106_pcm_close_playback(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_close_playback(struct snd_pcm_substream *substream) { - ca0106_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; - chip->playback_channels[epcm->channel_id].use=0; -/* FIXME: maybe zero others */ + struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; + chip->playback_channels[epcm->channel_id].use = 0; + /* FIXME: maybe zero others */ return 0; } -static int snd_ca0106_pcm_open_playback_front(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_playback_front(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL); } -static int snd_ca0106_pcm_open_playback_center_lfe(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_playback_center_lfe(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_playback_channel(substream, PCM_CENTER_LFE_CHANNEL); } -static int snd_ca0106_pcm_open_playback_unknown(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_playback_unknown(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_playback_channel(substream, PCM_UNKNOWN_CHANNEL); } -static int snd_ca0106_pcm_open_playback_rear(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_playback_rear(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_playback_channel(substream, PCM_REAR_CHANNEL); } /* open_capture callback */ -static int snd_ca0106_pcm_open_capture_channel(snd_pcm_substream_t *substream, int channel_id) +static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substream, + int channel_id) { - ca0106_t *chip = snd_pcm_substream_chip(substream); - ca0106_channel_t *channel = &(chip->capture_channels[channel_id]); - ca0106_pcm_t *epcm; - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); + struct snd_ca0106_channel *channel = &(chip->capture_channels[channel_id]); + struct snd_ca0106_pcm *epcm; + struct snd_pcm_runtime *runtime = substream->runtime; int err; epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); @@ -449,7 +451,7 @@ static int snd_ca0106_pcm_open_capture_channel(snd_pcm_substream_t *substream, i channel->use = 1; //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); //channel->interrupt = snd_ca0106_pcm_channel_interrupt; - channel->epcm = epcm; + channel->epcm = epcm; if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) return err; //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); @@ -459,70 +461,70 @@ static int snd_ca0106_pcm_open_capture_channel(snd_pcm_substream_t *substream, i } /* close callback */ -static int snd_ca0106_pcm_close_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_close_capture(struct snd_pcm_substream *substream) { - ca0106_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; - chip->capture_channels[epcm->channel_id].use=0; -/* FIXME: maybe zero others */ + struct snd_ca0106 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; + chip->capture_channels[epcm->channel_id].use = 0; + /* FIXME: maybe zero others */ return 0; } -static int snd_ca0106_pcm_open_0_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_0_capture(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_capture_channel(substream, 0); } -static int snd_ca0106_pcm_open_1_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_1_capture(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_capture_channel(substream, 1); } -static int snd_ca0106_pcm_open_2_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_2_capture(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_capture_channel(substream, 2); } -static int snd_ca0106_pcm_open_3_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_3_capture(struct snd_pcm_substream *substream) { return snd_ca0106_pcm_open_capture_channel(substream, 3); } /* hw_params callback */ -static int snd_ca0106_pcm_hw_params_playback(snd_pcm_substream_t *substream, - snd_pcm_hw_params_t * hw_params) +static int snd_ca0106_pcm_hw_params_playback(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); } /* hw_free callback */ -static int snd_ca0106_pcm_hw_free_playback(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_hw_free_playback(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } /* hw_params callback */ -static int snd_ca0106_pcm_hw_params_capture(snd_pcm_substream_t *substream, - snd_pcm_hw_params_t * hw_params) +static int snd_ca0106_pcm_hw_params_capture(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); } /* hw_free callback */ -static int snd_ca0106_pcm_hw_free_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_hw_free_capture(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } /* prepare playback callback */ -static int snd_ca0106_pcm_prepare_playback(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream) { - ca0106_t *emu = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; + struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; int channel = epcm->channel_id; u32 *table_base = (u32 *)(emu->buffer.area+(8*16*channel)); u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); @@ -619,11 +621,11 @@ static int snd_ca0106_pcm_prepare_playback(snd_pcm_substream_t *substream) } /* prepare capture callback */ -static int snd_ca0106_pcm_prepare_capture(snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream) { - ca0106_t *emu = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; + struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; int channel = epcm->channel_id; u32 hcfg_mask = HCFG_CAPTURE_S32_LE; u32 hcfg_set = 0x00000000; @@ -690,16 +692,16 @@ static int snd_ca0106_pcm_prepare_capture(snd_pcm_substream_t *substream) } /* trigger_playback callback */ -static int snd_ca0106_pcm_trigger_playback(snd_pcm_substream_t *substream, +static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, int cmd) { - ca0106_t *emu = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime; - ca0106_pcm_t *epcm; + struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime; + struct snd_ca0106_pcm *epcm; int channel; int result = 0; struct list_head *pos; - snd_pcm_substream_t *s; + struct snd_pcm_substream *s; u32 basic = 0; u32 extended = 0; int running=0; @@ -743,12 +745,12 @@ static int snd_ca0106_pcm_trigger_playback(snd_pcm_substream_t *substream, } /* trigger_capture callback */ -static int snd_ca0106_pcm_trigger_capture(snd_pcm_substream_t *substream, +static int snd_ca0106_pcm_trigger_capture(struct snd_pcm_substream *substream, int cmd) { - ca0106_t *emu = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; + struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; int channel = epcm->channel_id; int result = 0; @@ -772,11 +774,11 @@ static int snd_ca0106_pcm_trigger_capture(snd_pcm_substream_t *substream, /* pointer_playback callback */ static snd_pcm_uframes_t -snd_ca0106_pcm_pointer_playback(snd_pcm_substream_t *substream) +snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream) { - ca0106_t *emu = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; + struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; snd_pcm_uframes_t ptr, ptr1, ptr2,ptr3,ptr4 = 0; int channel = epcm->channel_id; @@ -799,11 +801,11 @@ snd_ca0106_pcm_pointer_playback(snd_pcm_substream_t *substream) /* pointer_capture callback */ static snd_pcm_uframes_t -snd_ca0106_pcm_pointer_capture(snd_pcm_substream_t *substream) +snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream) { - ca0106_t *emu = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ca0106_pcm_t *epcm = runtime->private_data; + struct snd_ca0106 *emu = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_ca0106_pcm *epcm = runtime->private_data; snd_pcm_uframes_t ptr, ptr1, ptr2 = 0; int channel = channel=epcm->channel_id; @@ -821,7 +823,7 @@ snd_ca0106_pcm_pointer_capture(snd_pcm_substream_t *substream) } /* operators */ -static snd_pcm_ops_t snd_ca0106_playback_front_ops = { +static struct snd_pcm_ops snd_ca0106_playback_front_ops = { .open = snd_ca0106_pcm_open_playback_front, .close = snd_ca0106_pcm_close_playback, .ioctl = snd_pcm_lib_ioctl, @@ -832,7 +834,7 @@ static snd_pcm_ops_t snd_ca0106_playback_front_ops = { .pointer = snd_ca0106_pcm_pointer_playback, }; -static snd_pcm_ops_t snd_ca0106_capture_0_ops = { +static struct snd_pcm_ops snd_ca0106_capture_0_ops = { .open = snd_ca0106_pcm_open_0_capture, .close = snd_ca0106_pcm_close_capture, .ioctl = snd_pcm_lib_ioctl, @@ -843,7 +845,7 @@ static snd_pcm_ops_t snd_ca0106_capture_0_ops = { .pointer = snd_ca0106_pcm_pointer_capture, }; -static snd_pcm_ops_t snd_ca0106_capture_1_ops = { +static struct snd_pcm_ops snd_ca0106_capture_1_ops = { .open = snd_ca0106_pcm_open_1_capture, .close = snd_ca0106_pcm_close_capture, .ioctl = snd_pcm_lib_ioctl, @@ -854,7 +856,7 @@ static snd_pcm_ops_t snd_ca0106_capture_1_ops = { .pointer = snd_ca0106_pcm_pointer_capture, }; -static snd_pcm_ops_t snd_ca0106_capture_2_ops = { +static struct snd_pcm_ops snd_ca0106_capture_2_ops = { .open = snd_ca0106_pcm_open_2_capture, .close = snd_ca0106_pcm_close_capture, .ioctl = snd_pcm_lib_ioctl, @@ -865,7 +867,7 @@ static snd_pcm_ops_t snd_ca0106_capture_2_ops = { .pointer = snd_ca0106_pcm_pointer_capture, }; -static snd_pcm_ops_t snd_ca0106_capture_3_ops = { +static struct snd_pcm_ops snd_ca0106_capture_3_ops = { .open = snd_ca0106_pcm_open_3_capture, .close = snd_ca0106_pcm_close_capture, .ioctl = snd_pcm_lib_ioctl, @@ -876,7 +878,7 @@ static snd_pcm_ops_t snd_ca0106_capture_3_ops = { .pointer = snd_ca0106_pcm_pointer_capture, }; -static snd_pcm_ops_t snd_ca0106_playback_center_lfe_ops = { +static struct snd_pcm_ops snd_ca0106_playback_center_lfe_ops = { .open = snd_ca0106_pcm_open_playback_center_lfe, .close = snd_ca0106_pcm_close_playback, .ioctl = snd_pcm_lib_ioctl, @@ -887,7 +889,7 @@ static snd_pcm_ops_t snd_ca0106_playback_center_lfe_ops = { .pointer = snd_ca0106_pcm_pointer_playback, }; -static snd_pcm_ops_t snd_ca0106_playback_unknown_ops = { +static struct snd_pcm_ops snd_ca0106_playback_unknown_ops = { .open = snd_ca0106_pcm_open_playback_unknown, .close = snd_ca0106_pcm_close_playback, .ioctl = snd_pcm_lib_ioctl, @@ -898,7 +900,7 @@ static snd_pcm_ops_t snd_ca0106_playback_unknown_ops = { .pointer = snd_ca0106_pcm_pointer_playback, }; -static snd_pcm_ops_t snd_ca0106_playback_rear_ops = { +static struct snd_pcm_ops snd_ca0106_playback_rear_ops = { .open = snd_ca0106_pcm_open_playback_rear, .close = snd_ca0106_pcm_close_playback, .ioctl = snd_pcm_lib_ioctl, @@ -910,10 +912,10 @@ static snd_pcm_ops_t snd_ca0106_playback_rear_ops = { }; -static unsigned short snd_ca0106_ac97_read(ac97_t *ac97, +static unsigned short snd_ca0106_ac97_read(struct snd_ac97 *ac97, unsigned short reg) { - ca0106_t *emu = ac97->private_data; + struct snd_ca0106 *emu = ac97->private_data; unsigned long flags; unsigned short val; @@ -924,10 +926,10 @@ static unsigned short snd_ca0106_ac97_read(ac97_t *ac97, return val; } -static void snd_ca0106_ac97_write(ac97_t *ac97, +static void snd_ca0106_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { - ca0106_t *emu = ac97->private_data; + struct snd_ca0106 *emu = ac97->private_data; unsigned long flags; spin_lock_irqsave(&emu->emu_lock, flags); @@ -936,12 +938,12 @@ static void snd_ca0106_ac97_write(ac97_t *ac97, spin_unlock_irqrestore(&emu->emu_lock, flags); } -static int snd_ca0106_ac97(ca0106_t *chip) +static int snd_ca0106_ac97(struct snd_ca0106 *chip) { - ac97_bus_t *pbus; - ac97_template_t ac97; + struct snd_ac97_bus *pbus; + struct snd_ac97_template ac97; int err; - static ac97_bus_ops_t ops = { + static struct snd_ac97_bus_ops ops = { .write = snd_ca0106_ac97_write, .read = snd_ca0106_ac97_read, }; @@ -956,7 +958,7 @@ static int snd_ca0106_ac97(ca0106_t *chip) return snd_ac97_mixer(pbus, &ac97, &chip->ac97); } -static int snd_ca0106_free(ca0106_t *chip) +static int snd_ca0106_free(struct snd_ca0106 *chip) { if (chip->res_port != NULL) { /* avoid access to already used hardware */ // disable interrupts @@ -989,9 +991,9 @@ static int snd_ca0106_free(ca0106_t *chip) return 0; } -static int snd_ca0106_dev_free(snd_device_t *device) +static int snd_ca0106_dev_free(struct snd_device *device) { - ca0106_t *chip = device->device_data; + struct snd_ca0106 *chip = device->device_data; return snd_ca0106_free(chip); } @@ -1000,14 +1002,13 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id, { unsigned int status; - ca0106_t *chip = dev_id; + struct snd_ca0106 *chip = dev_id; int i; int mask; unsigned int stat76; - ca0106_channel_t *pchannel; + struct snd_ca0106_channel *pchannel; status = inl(chip->port + IPR); - if (! status) return IRQ_NONE; @@ -1059,10 +1060,10 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id, return IRQ_HANDLED; } -static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm) +static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct snd_pcm **rpcm) { - snd_pcm_t *pcm; - snd_pcm_substream_t *substream; + struct snd_pcm *pcm; + struct snd_pcm_substream *substream; int err; if (rpcm) @@ -1122,15 +1123,15 @@ static int __devinit snd_ca0106_pcm(ca0106_t *emu, int device, snd_pcm_t **rpcm) return 0; } -static int __devinit snd_ca0106_create(snd_card_t *card, +static int __devinit snd_ca0106_create(struct snd_card *card, struct pci_dev *pci, - ca0106_t **rchip) + struct snd_ca0106 **rchip) { - ca0106_t *chip; - ca0106_details_t *c; + struct snd_ca0106 *chip; + struct snd_ca0106_details *c; int err; int ch; - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_ca0106_dev_free, }; @@ -1314,39 +1315,40 @@ static int __devinit snd_ca0106_create(snd_card_t *card, } -static void ca0106_midi_interrupt_enable(ca_midi_t *midi, int intr) +static void ca0106_midi_interrupt_enable(struct snd_ca_midi *midi, int intr) { - snd_ca0106_intr_enable((ca0106_t *)(midi->dev_id), intr); + snd_ca0106_intr_enable((struct snd_ca0106 *)(midi->dev_id), intr); } -static void ca0106_midi_interrupt_disable(ca_midi_t *midi, int intr) +static void ca0106_midi_interrupt_disable(struct snd_ca_midi *midi, int intr) { - snd_ca0106_intr_disable((ca0106_t *)(midi->dev_id), intr); + snd_ca0106_intr_disable((struct snd_ca0106 *)(midi->dev_id), intr); } -static unsigned char ca0106_midi_read(ca_midi_t *midi, int idx) +static unsigned char ca0106_midi_read(struct snd_ca_midi *midi, int idx) { - return (unsigned char)snd_ca0106_ptr_read((ca0106_t *)(midi->dev_id), midi->port + idx, 0); + return (unsigned char)snd_ca0106_ptr_read((struct snd_ca0106 *)(midi->dev_id), + midi->port + idx, 0); } -static void ca0106_midi_write(ca_midi_t *midi, int data, int idx) +static void ca0106_midi_write(struct snd_ca_midi *midi, int data, int idx) { - snd_ca0106_ptr_write((ca0106_t *)(midi->dev_id), midi->port + idx, 0, data); + snd_ca0106_ptr_write((struct snd_ca0106 *)(midi->dev_id), midi->port + idx, 0, data); } -static snd_card_t *ca0106_dev_id_card(void *dev_id) +static struct snd_card *ca0106_dev_id_card(void *dev_id) { - return ((ca0106_t *)dev_id)->card; + return ((struct snd_ca0106 *)dev_id)->card; } static int ca0106_dev_id_port(void *dev_id) { - return ((ca0106_t *)dev_id)->port; + return ((struct snd_ca0106 *)dev_id)->port; } -static int __devinit snd_ca0106_midi(ca0106_t *chip, unsigned int channel) +static int __devinit snd_ca0106_midi(struct snd_ca0106 *chip, unsigned int channel) { - ca_midi_t *midi; + struct snd_ca_midi *midi; char *name; int err; @@ -1399,8 +1401,8 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { static int dev; - snd_card_t *card; - ca0106_t *chip; + struct snd_card *card; + struct snd_ca0106 *chip; int err; if (dev >= SNDRV_CARDS) diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c index 0730dc7..39100cb 100644 --- a/sound/pci/ca0106/ca0106_mixer.c +++ b/sound/pci/ca0106/ca0106_mixer.c @@ -73,7 +73,8 @@ #include "ca0106.h" -static int snd_ca0106_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_ca0106_shared_spdif_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -82,19 +83,19 @@ static int snd_ca0106_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i return 0; } -static int snd_ca0106_shared_spdif_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_shared_spdif_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = emu->spdif_enable; return 0; } -static int snd_ca0106_shared_spdif_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_shared_spdif_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int val; int change = 0; u32 mask; @@ -125,7 +126,8 @@ static int snd_ca0106_shared_spdif_put(snd_kcontrol_t * kcontrol, return change; } -static int snd_ca0106_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_ca0106_capture_source_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { static char *texts[6] = { "SPDIF out", "i2s mixer out", "SPDIF in", "i2s in", "AC97 in", "SRC out" @@ -140,19 +142,19 @@ static int snd_ca0106_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem return 0; } -static int snd_ca0106_capture_source_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_capture_source_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = emu->capture_source; return 0; } -static int snd_ca0106_capture_source_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int val; int change = 0; u32 mask; @@ -169,7 +171,8 @@ static int snd_ca0106_capture_source_put(snd_kcontrol_t * kcontrol, return change; } -static int snd_ca0106_capture_mic_line_in_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { static char *texts[2] = { "Line in", "Mic in" }; @@ -182,19 +185,19 @@ static int snd_ca0106_capture_mic_line_in_info(snd_kcontrol_t *kcontrol, snd_ctl return 0; } -static int snd_ca0106_capture_mic_line_in_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_capture_mic_line_in_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = emu->capture_mic_line_in; return 0; } -static int snd_ca0106_capture_mic_line_in_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int val; int change = 0; u32 tmp; @@ -219,7 +222,7 @@ static int snd_ca0106_capture_mic_line_in_put(snd_kcontrol_t * kcontrol, return change; } -static snd_kcontrol_new_t snd_ca0106_capture_mic_line_in __devinitdata = +static struct snd_kcontrol_new snd_ca0106_capture_mic_line_in __devinitdata = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic/Line in Capture", @@ -228,17 +231,18 @@ static snd_kcontrol_new_t snd_ca0106_capture_mic_line_in __devinitdata = .put = snd_ca0106_capture_mic_line_in_put }; -static int snd_ca0106_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; return 0; } -static int snd_ca0106_spdif_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_spdif_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff; @@ -248,8 +252,8 @@ static int snd_ca0106_spdif_get(snd_kcontrol_t * kcontrol, return 0; } -static int snd_ca0106_spdif_get_mask(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_spdif_get_mask(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { ucontrol->value.iec958.status[0] = 0xff; ucontrol->value.iec958.status[1] = 0xff; @@ -258,10 +262,10 @@ static int snd_ca0106_spdif_get_mask(snd_kcontrol_t * kcontrol, return 0; } -static int snd_ca0106_spdif_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_spdif_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int change; unsigned int val; @@ -278,7 +282,8 @@ static int snd_ca0106_spdif_put(snd_kcontrol_t * kcontrol, return change; } -static int snd_ca0106_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_ca0106_volume_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -287,10 +292,10 @@ static int snd_ca0106_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -static int snd_ca0106_volume_get(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_volume_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int value; int channel_id, reg; @@ -303,10 +308,10 @@ static int snd_ca0106_volume_get(snd_kcontrol_t * kcontrol, return 0; } -static int snd_ca0106_volume_put(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_ca0106_volume_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - ca0106_t *emu = snd_kcontrol_chip(kcontrol); + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); unsigned int oval, nval; int channel_id, reg; @@ -334,7 +339,7 @@ static int snd_ca0106_volume_put(snd_kcontrol_t * kcontrol, } -static snd_kcontrol_new_t snd_ca0106_volume_ctls[] __devinitdata = { +static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = { CA_VOLUME("Analog Front Playback Volume", CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2), CA_VOLUME("Analog Rear Playback Volume", @@ -388,18 +393,18 @@ static snd_kcontrol_new_t snd_ca0106_volume_ctls[] __devinitdata = { }, }; -static int __devinit remove_ctl(snd_card_t *card, const char *name) +static int __devinit remove_ctl(struct snd_card *card, const char *name) { - snd_ctl_elem_id_t id; + struct snd_ctl_elem_id id; memset(&id, 0, sizeof(id)); strcpy(id.name, name); id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; return snd_ctl_remove_id(card, &id); } -static snd_kcontrol_t __devinit *ctl_find(snd_card_t *card, const char *name) +static struct snd_kcontrol __devinit *ctl_find(struct snd_card *card, const char *name) { - snd_ctl_elem_id_t sid; + struct snd_ctl_elem_id sid; memset(&sid, 0, sizeof(sid)); /* FIXME: strcpy is bad. */ strcpy(sid.name, name); @@ -407,9 +412,9 @@ static snd_kcontrol_t __devinit *ctl_find(snd_card_t *card, const char *name) return snd_ctl_find_id(card, &sid); } -static int __devinit rename_ctl(snd_card_t *card, const char *src, const char *dst) +static int __devinit rename_ctl(struct snd_card *card, const char *src, const char *dst) { - snd_kcontrol_t *kctl = ctl_find(card, src); + struct snd_kcontrol *kctl = ctl_find(card, src); if (kctl) { strcpy(kctl->id.name, dst); return 0; @@ -417,10 +422,10 @@ static int __devinit rename_ctl(snd_card_t *card, const char *src, const char *d return -ENOENT; } -int __devinit snd_ca0106_mixer(ca0106_t *emu) +int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu) { int i, err; - snd_card_t *card = emu->card; + struct snd_card *card = emu->card; char **c; static char *ca0106_remove_ctls[] = { "Master Mono Playback Switch", diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c index 1c9cc82..94b6225 100644 --- a/sound/pci/ca0106/ca0106_proc.c +++ b/sound/pci/ca0106/ca0106_proc.c @@ -97,7 +97,7 @@ static struct snd_ca0106_category_str snd_ca0106_con_category[] = { }; -static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value) +static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 value) { int i; u32 status[4]; @@ -271,10 +271,10 @@ static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value) } } -static void snd_ca0106_proc_iec958(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_iec958(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; u32 value; value = snd_ca0106_ptr_read(emu, SAMPLE_RATE_TRACKER_STATUS, 0); @@ -293,10 +293,10 @@ static void snd_ca0106_proc_iec958(snd_info_entry_t *entry, snd_iprintf(buffer, "\n"); } -static void snd_ca0106_proc_reg_write32(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; unsigned long flags; char line[64]; u32 reg, val; @@ -311,10 +311,10 @@ static void snd_ca0106_proc_reg_write32(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_reg_read32(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; unsigned long value; unsigned long flags; int i; @@ -327,10 +327,10 @@ static void snd_ca0106_proc_reg_read32(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_reg_read16(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; unsigned int value; unsigned long flags; int i; @@ -343,10 +343,10 @@ static void snd_ca0106_proc_reg_read16(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_reg_read8(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; unsigned int value; unsigned long flags; int i; @@ -359,10 +359,10 @@ static void snd_ca0106_proc_reg_read8(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_reg_read1(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; unsigned long value; int i,j; @@ -377,10 +377,10 @@ static void snd_ca0106_proc_reg_read1(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_reg_read2(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; unsigned long value; int i,j; @@ -395,10 +395,10 @@ static void snd_ca0106_proc_reg_read2(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; char line[64]; unsigned int reg, channel_id , val; while (!snd_info_get_line(buffer, line, sizeof(line))) { @@ -409,10 +409,10 @@ static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry, } } -static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry, - snd_info_buffer_t * buffer) +static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { - ca0106_t *emu = entry->private_data; + struct snd_ca0106 *emu = entry->private_data; char line[64]; unsigned int reg, val; while (!snd_info_get_line(buffer, line, sizeof(line))) { @@ -424,9 +424,9 @@ static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry, } } -int __devinit snd_ca0106_proc_init(ca0106_t * emu) +int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; if(! snd_card_proc_new(emu->card, "iec958", &entry)) snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_iec958); diff --git a/sound/pci/ca0106/ca_midi.c b/sound/pci/ca0106/ca_midi.c index 2e08b27..2e6eab1 100644 --- a/sound/pci/ca0106/ca_midi.c +++ b/sound/pci/ca0106/ca_midi.c @@ -40,18 +40,20 @@ #define ca_midi_input_avail(midi) (!(ca_midi_read_stat(midi) & midi->input_avail)) #define ca_midi_output_ready(midi) (!(ca_midi_read_stat(midi) & midi->output_ready)) -static void ca_midi_clear_rx(ca_midi_t *midi) +static void ca_midi_clear_rx(struct snd_ca_midi *midi) { int timeout = 100000; for (; timeout > 0 && ca_midi_input_avail(midi); timeout--) ca_midi_read_data(midi); #ifdef CONFIG_SND_DEBUG if (timeout <= 0) - snd_printk(KERN_ERR "ca_midi_clear_rx: timeout (status = 0x%x)\n", ca_midi_read_stat(midi)); + snd_printk(KERN_ERR "ca_midi_clear_rx: timeout (status = 0x%x)\n", + ca_midi_read_stat(midi)); #endif } -static void ca_midi_interrupt(ca_midi_t *midi, unsigned int status) { +static void ca_midi_interrupt(struct snd_ca_midi *midi, unsigned int status) +{ unsigned char byte; if (midi->rmidi == NULL) { @@ -86,7 +88,7 @@ static void ca_midi_interrupt(ca_midi_t *midi, unsigned int status) { } -static void ca_midi_cmd(ca_midi_t *midi, unsigned char cmd, int ack) +static void ca_midi_cmd(struct snd_ca_midi *midi, unsigned char cmd, int ack) { unsigned long flags; int timeout, ok; @@ -119,9 +121,9 @@ static void ca_midi_cmd(ca_midi_t *midi, unsigned char cmd, int ack) ca_midi_read_data(midi)); } -static int ca_midi_input_open(snd_rawmidi_substream_t * substream) +static int ca_midi_input_open(struct snd_rawmidi_substream *substream) { - ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; + struct snd_ca_midi *midi = substream->rmidi->private_data; unsigned long flags; snd_assert(midi->dev_id, return -ENXIO); @@ -138,9 +140,9 @@ static int ca_midi_input_open(snd_rawmidi_substream_t * substream) return 0; } -static int ca_midi_output_open(snd_rawmidi_substream_t * substream) +static int ca_midi_output_open(struct snd_rawmidi_substream *substream) { - ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; + struct snd_ca_midi *midi = substream->rmidi->private_data; unsigned long flags; snd_assert(midi->dev_id, return -ENXIO); @@ -157,9 +159,9 @@ static int ca_midi_output_open(snd_rawmidi_substream_t * substream) return 0; } -static int ca_midi_input_close(snd_rawmidi_substream_t * substream) +static int ca_midi_input_close(struct snd_rawmidi_substream *substream) { - ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; + struct snd_ca_midi *midi = substream->rmidi->private_data; unsigned long flags; snd_assert(midi->dev_id, return -ENXIO); @@ -176,9 +178,9 @@ static int ca_midi_input_close(snd_rawmidi_substream_t * substream) return 0; } -static int ca_midi_output_close(snd_rawmidi_substream_t * substream) +static int ca_midi_output_close(struct snd_rawmidi_substream *substream) { - ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; + struct snd_ca_midi *midi = substream->rmidi->private_data; unsigned long flags; snd_assert(midi->dev_id, return -ENXIO); @@ -197,9 +199,9 @@ static int ca_midi_output_close(snd_rawmidi_substream_t * substream) return 0; } -static void ca_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) +static void ca_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) { - ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; + struct snd_ca_midi *midi = substream->rmidi->private_data; snd_assert(midi->dev_id, return); if (up) { @@ -209,9 +211,9 @@ static void ca_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) } } -static void ca_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) +static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) { - ca_midi_t *midi = (ca_midi_t *)substream->rmidi->private_data; + struct snd_ca_midi *midi = substream->rmidi->private_data; unsigned long flags; snd_assert(midi->dev_id, return); @@ -246,21 +248,22 @@ static void ca_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) } } -static snd_rawmidi_ops_t ca_midi_output = +static struct snd_rawmidi_ops ca_midi_output = { .open = ca_midi_output_open, .close = ca_midi_output_close, .trigger = ca_midi_output_trigger, }; -static snd_rawmidi_ops_t ca_midi_input = +static struct snd_rawmidi_ops ca_midi_input = { .open = ca_midi_input_open, .close = ca_midi_input_close, .trigger = ca_midi_input_trigger, }; -static void ca_midi_free(ca_midi_t *midi) { +static void ca_midi_free(struct snd_ca_midi *midi) +{ midi->interrupt = NULL; midi->interrupt_enable = NULL; midi->interrupt_disable = NULL; @@ -271,14 +274,14 @@ static void ca_midi_free(ca_midi_t *midi) { midi->rmidi = NULL; } -static void ca_rmidi_free(snd_rawmidi_t *rmidi) +static void ca_rmidi_free(struct snd_rawmidi *rmidi) { - ca_midi_free((ca_midi_t *)rmidi->private_data); + ca_midi_free(rmidi->private_data); } -int __devinit ca_midi_init(void *dev_id, ca_midi_t *midi, int device, char *name) +int __devinit ca_midi_init(void *dev_id, struct snd_ca_midi *midi, int device, char *name) { - snd_rawmidi_t *rmidi; + struct snd_rawmidi *rmidi; int err; if ((err = snd_rawmidi_new(midi->get_dev_id_card(midi->dev_id), name, device, 1, 1, &rmidi)) < 0) diff --git a/sound/pci/ca0106/ca_midi.h b/sound/pci/ca0106/ca_midi.h index b452cec..b72c093 100644 --- a/sound/pci/ca0106/ca_midi.h +++ b/sound/pci/ca0106/ca_midi.h @@ -29,12 +29,11 @@ #define CA_MIDI_MODE_INPUT MPU401_MODE_INPUT #define CA_MIDI_MODE_OUTPUT MPU401_MODE_OUTPUT -typedef struct ca_midi ca_midi_t; -struct ca_midi { +struct snd_ca_midi { - snd_rawmidi_t *rmidi; - snd_rawmidi_substream_t *substream_input; - snd_rawmidi_substream_t *substream_output; + struct snd_rawmidi *rmidi; + struct snd_rawmidi_substream *substream_input; + struct snd_rawmidi_substream *substream_output; void *dev_id; @@ -52,18 +51,16 @@ struct ca_midi { int input_avail, output_ready; int ack, reset, enter_uart; - void (*interrupt)(ca_midi_t *midi, unsigned int status); - void (*interrupt_enable)(ca_midi_t *midi, int intr); - void (*interrupt_disable)(ca_midi_t *midi, int intr); + void (*interrupt)(struct snd_ca_midi *midi, unsigned int status); + void (*interrupt_enable)(struct snd_ca_midi *midi, int intr); + void (*interrupt_disable)(struct snd_ca_midi *midi, int intr); - unsigned char (*read)(ca_midi_t *midi, int idx); - void (*write)(ca_midi_t *midi, int data, int idx); + unsigned char (*read)(struct snd_ca_midi *midi, int idx); + void (*write)(struct snd_ca_midi *midi, int data, int idx); /* get info from dev_id */ - snd_card_t *(*get_dev_id_card)(void *dev_id); + struct snd_card *(*get_dev_id_card)(void *dev_id); int (*get_dev_id_port)(void *dev_id); }; -int __devinit ca_midi_init(void *card, ca_midi_t *midi, int device, char *name); - - +int ca_midi_init(void *card, struct snd_ca_midi *midi, int device, char *name); -- cgit v1.1