* playback.
*/
-typedef struct snd_emu10k1x_voice emu10k1x_voice_t;
-typedef struct snd_emu10k1x emu10k1x_t;
-typedef struct snd_emu10k1x_pcm emu10k1x_pcm_t;
-
-struct snd_emu10k1x_voice {
- emu10k1x_t *emu;
+struct emu10k1x_voice {
+ struct emu10k1x *emu;
int number;
int use;
- emu10k1x_pcm_t *epcm;
+ struct emu10k1x_pcm *epcm;
};
-struct snd_emu10k1x_pcm {
- emu10k1x_t *emu;
- snd_pcm_substream_t *substream;
- emu10k1x_voice_t *voice;
+struct emu10k1x_pcm {
+ struct emu10k1x *emu;
+ struct snd_pcm_substream *substream;
+ struct emu10k1x_voice *voice;
unsigned short running;
};
-typedef struct {
- struct snd_emu10k1x *emu;
- snd_rawmidi_t *rmidi;
- snd_rawmidi_substream_t *substream_input;
- snd_rawmidi_substream_t *substream_output;
+struct emu10k1x_midi {
+ struct emu10k1x *emu;
+ struct snd_rawmidi *rmidi;
+ struct snd_rawmidi_substream *substream_input;
+ struct snd_rawmidi_substream *substream_output;
unsigned int midi_mode;
spinlock_t input_lock;
spinlock_t output_lock;
int tx_enable, rx_enable;
int port;
int ipr_tx, ipr_rx;
- void (*interrupt)(emu10k1x_t *emu, unsigned int status);
-} emu10k1x_midi_t;
+ void (*interrupt)(struct emu10k1x *emu, unsigned int status);
+};
// definition of the chip-specific record
-struct snd_emu10k1x {
- snd_card_t *card;
+struct emu10k1x {
+ struct snd_card *card;
struct pci_dev *pci;
unsigned long port;
spinlock_t emu_lock;
spinlock_t voice_lock;
- ac97_t *ac97;
- snd_pcm_t *pcm;
+ struct snd_ac97 *ac97;
+ struct snd_pcm *pcm;
- emu10k1x_voice_t voices[3];
- emu10k1x_voice_t capture_voice;
+ struct emu10k1x_voice voices[3];
+ struct emu10k1x_voice capture_voice;
u32 spdif_bits[3]; // SPDIF out setup
struct snd_dma_buffer dma_buffer;
- emu10k1x_midi_t midi;
+ struct emu10k1x_midi midi;
};
/* hardware definition */
-static snd_pcm_hardware_t snd_emu10k1x_playback_hw = {
+static struct snd_pcm_hardware snd_emu10k1x_playback_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
.fifo_size = 0,
};
-static snd_pcm_hardware_t snd_emu10k1x_capture_hw = {
+static struct snd_pcm_hardware snd_emu10k1x_capture_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
.fifo_size = 0,
};
-static unsigned int snd_emu10k1x_ptr_read(emu10k1x_t * emu,
+static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
unsigned int reg,
unsigned int chn)
{
return val;
}
-static void snd_emu10k1x_ptr_write(emu10k1x_t *emu,
+static void snd_emu10k1x_ptr_write(struct emu10k1x *emu,
unsigned int reg,
unsigned int chn,
unsigned int data)
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-static void snd_emu10k1x_intr_enable(emu10k1x_t *emu, unsigned int intrenb)
+static void snd_emu10k1x_intr_enable(struct emu10k1x *emu, unsigned int intrenb)
{
unsigned long flags;
unsigned int enable;
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-static void snd_emu10k1x_intr_disable(emu10k1x_t *emu, unsigned int intrenb)
+static void snd_emu10k1x_intr_disable(struct emu10k1x *emu, unsigned int intrenb)
{
unsigned long flags;
unsigned int enable;
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-static void snd_emu10k1x_gpio_write(emu10k1x_t *emu, unsigned int value)
+static void snd_emu10k1x_gpio_write(struct emu10k1x *emu, unsigned int value)
{
unsigned long flags;
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-static void snd_emu10k1x_pcm_free_substream(snd_pcm_runtime_t *runtime)
+static void snd_emu10k1x_pcm_free_substream(struct snd_pcm_runtime *runtime)
{
kfree(runtime->private_data);
}
-static void snd_emu10k1x_pcm_interrupt(emu10k1x_t *emu, emu10k1x_voice_t *voice)
+static void snd_emu10k1x_pcm_interrupt(struct emu10k1x *emu, struct emu10k1x_voice *voice)
{
- emu10k1x_pcm_t *epcm;
+ struct emu10k1x_pcm *epcm;
if ((epcm = voice->epcm) == NULL)
return;
}
/* open callback */
-static int snd_emu10k1x_playback_open(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream)
{
- emu10k1x_t *chip = snd_pcm_substream_chip(substream);
- emu10k1x_pcm_t *epcm;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct emu10k1x *chip = snd_pcm_substream_chip(substream);
+ struct emu10k1x_pcm *epcm;
+ struct snd_pcm_runtime *runtime = substream->runtime;
int err;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) {
}
/* close callback */
-static int snd_emu10k1x_playback_close(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_playback_close(struct snd_pcm_substream *substream)
{
return 0;
}
/* hw_params callback */
-static int snd_emu10k1x_pcm_hw_params(snd_pcm_substream_t *substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
if (! epcm->voice) {
epcm->voice = &epcm->emu->voices[substream->pcm->device];
}
/* hw_free callback */
-static int snd_emu10k1x_pcm_hw_free(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm;
if (runtime->private_data == NULL)
return 0;
}
/* prepare callback */
-static int snd_emu10k1x_pcm_prepare(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_pcm_prepare(struct snd_pcm_substream *substream)
{
- emu10k1x_t *emu = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct emu10k1x *emu = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
int voice = epcm->voice->number;
u32 *table_base = (u32 *)(emu->dma_buffer.area+1024*voice);
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
}
/* trigger callback */
-static int snd_emu10k1x_pcm_trigger(snd_pcm_substream_t *substream,
+static int snd_emu10k1x_pcm_trigger(struct snd_pcm_substream *substream,
int cmd)
{
- emu10k1x_t *emu = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct emu10k1x *emu = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
int channel = epcm->voice->number;
int result = 0;
/* pointer callback */
static snd_pcm_uframes_t
-snd_emu10k1x_pcm_pointer(snd_pcm_substream_t *substream)
+snd_emu10k1x_pcm_pointer(struct snd_pcm_substream *substream)
{
- emu10k1x_t *emu = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct emu10k1x *emu = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
int channel = epcm->voice->number;
snd_pcm_uframes_t ptr = 0, ptr1 = 0, ptr2= 0,ptr3 = 0,ptr4 = 0;
}
/* operators */
-static snd_pcm_ops_t snd_emu10k1x_playback_ops = {
+static struct snd_pcm_ops snd_emu10k1x_playback_ops = {
.open = snd_emu10k1x_playback_open,
.close = snd_emu10k1x_playback_close,
.ioctl = snd_pcm_lib_ioctl,
};
/* open_capture callback */
-static int snd_emu10k1x_pcm_open_capture(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream)
{
- emu10k1x_t *chip = snd_pcm_substream_chip(substream);
- emu10k1x_pcm_t *epcm;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct emu10k1x *chip = snd_pcm_substream_chip(substream);
+ struct emu10k1x_pcm *epcm;
+ struct snd_pcm_runtime *runtime = substream->runtime;
int err;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
}
/* close callback */
-static int snd_emu10k1x_pcm_close_capture(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_pcm_close_capture(struct snd_pcm_substream *substream)
{
return 0;
}
/* hw_params callback */
-static int snd_emu10k1x_pcm_hw_params_capture(snd_pcm_substream_t *substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
if (! epcm->voice) {
if (epcm->emu->capture_voice.use)
}
/* hw_free callback */
-static int snd_emu10k1x_pcm_hw_free_capture(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_pcm_hw_free_capture(struct snd_pcm_substream *substream)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm;
+ struct emu10k1x_pcm *epcm;
if (runtime->private_data == NULL)
return 0;
}
/* prepare capture callback */
-static int snd_emu10k1x_pcm_prepare_capture(snd_pcm_substream_t *substream)
+static int snd_emu10k1x_pcm_prepare_capture(struct snd_pcm_substream *substream)
{
- emu10k1x_t *emu = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct emu10k1x *emu = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr);
snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
}
/* trigger_capture callback */
-static int snd_emu10k1x_pcm_trigger_capture(snd_pcm_substream_t *substream,
+static int snd_emu10k1x_pcm_trigger_capture(struct snd_pcm_substream *substream,
int cmd)
{
- emu10k1x_t *emu = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct emu10k1x *emu = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
int result = 0;
switch (cmd) {
/* pointer_capture callback */
static snd_pcm_uframes_t
-snd_emu10k1x_pcm_pointer_capture(snd_pcm_substream_t *substream)
+snd_emu10k1x_pcm_pointer_capture(struct snd_pcm_substream *substream)
{
- emu10k1x_t *emu = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- emu10k1x_pcm_t *epcm = runtime->private_data;
+ struct emu10k1x *emu = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct emu10k1x_pcm *epcm = runtime->private_data;
snd_pcm_uframes_t ptr;
if (!epcm->running)
return ptr;
}
-static snd_pcm_ops_t snd_emu10k1x_capture_ops = {
+static struct snd_pcm_ops snd_emu10k1x_capture_ops = {
.open = snd_emu10k1x_pcm_open_capture,
.close = snd_emu10k1x_pcm_close_capture,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_emu10k1x_pcm_pointer_capture,
};
-static unsigned short snd_emu10k1x_ac97_read(ac97_t *ac97,
+static unsigned short snd_emu10k1x_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{
- emu10k1x_t *emu = ac97->private_data;
+ struct emu10k1x *emu = ac97->private_data;
unsigned long flags;
unsigned short val;
return val;
}
-static void snd_emu10k1x_ac97_write(ac97_t *ac97,
+static void snd_emu10k1x_ac97_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short val)
{
- emu10k1x_t *emu = ac97->private_data;
+ struct emu10k1x *emu = ac97->private_data;
unsigned long flags;
spin_lock_irqsave(&emu->emu_lock, flags);
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-static int snd_emu10k1x_ac97(emu10k1x_t *chip)
+static int snd_emu10k1x_ac97(struct emu10k1x *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_emu10k1x_ac97_write,
.read = snd_emu10k1x_ac97_read,
};
return snd_ac97_mixer(pbus, &ac97, &chip->ac97);
}
-static int snd_emu10k1x_free(emu10k1x_t *chip)
+static int snd_emu10k1x_free(struct emu10k1x *chip)
{
snd_emu10k1x_ptr_write(chip, TRIGGER_CHANNEL, 0, 0);
// disable interrupts
return 0;
}
-static int snd_emu10k1x_dev_free(snd_device_t *device)
+static int snd_emu10k1x_dev_free(struct snd_device *device)
{
- emu10k1x_t *chip = device->device_data;
+ struct emu10k1x *chip = device->device_data;
return snd_emu10k1x_free(chip);
}
{
unsigned int status;
- emu10k1x_t *chip = dev_id;
- emu10k1x_voice_t *pvoice = chip->voices;
+ struct emu10k1x *chip = dev_id;
+ struct emu10k1x_voice *pvoice = chip->voices;
int i;
int mask;
// capture interrupt
if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) {
- emu10k1x_voice_t *pvoice = &chip->capture_voice;
- if(pvoice->use)
+ struct emu10k1x_voice *pvoice = &chip->capture_voice;
+ if (pvoice->use)
snd_emu10k1x_pcm_interrupt(chip, pvoice);
else
snd_emu10k1x_intr_disable(chip,
return IRQ_HANDLED;
}
-static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **rpcm)
+static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct snd_pcm **rpcm)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
int capture = 0;
return 0;
}
-static int __devinit snd_emu10k1x_create(snd_card_t *card,
+static int __devinit snd_emu10k1x_create(struct snd_card *card,
struct pci_dev *pci,
- emu10k1x_t **rchip)
+ struct emu10k1x **rchip)
{
- emu10k1x_t *chip;
+ struct emu10k1x *chip;
int err;
int ch;
- static snd_device_ops_t ops = {
+ static struct snd_device_ops ops = {
.dev_free = snd_emu10k1x_dev_free,
};
return 0;
}
-static void snd_emu10k1x_proc_reg_read(snd_info_entry_t *entry,
- snd_info_buffer_t * buffer)
+static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
+ struct snd_info_buffer *buffer)
{
- emu10k1x_t *emu = entry->private_data;
+ struct emu10k1x *emu = entry->private_data;
unsigned long value,value1,value2;
unsigned long flags;
int i;
}
}
-static void snd_emu10k1x_proc_reg_write(snd_info_entry_t *entry,
- snd_info_buffer_t *buffer)
+static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
+ struct snd_info_buffer *buffer)
{
- emu10k1x_t *emu = entry->private_data;
+ struct emu10k1x *emu = entry->private_data;
char line[64];
unsigned int reg, channel_id , val;
}
}
-static int __devinit snd_emu10k1x_proc_init(emu10k1x_t * emu)
+static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu)
{
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1x_proc_reg_read);
return 0;
}
-static int snd_emu10k1x_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_emu10k1x_shared_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
return 0;
}
-static int snd_emu10k1x_shared_spdif_get(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_emu10k1x_shared_spdif_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- emu10k1x_t *emu = snd_kcontrol_chip(kcontrol);
+ struct emu10k1x *emu = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = (snd_emu10k1x_ptr_read(emu, SPDIF_SELECT, 0) == 0x700) ? 0 : 1;
return 0;
}
-static int snd_emu10k1x_shared_spdif_put(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- emu10k1x_t *emu = snd_kcontrol_chip(kcontrol);
+ struct emu10k1x *emu = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change = 0;
return change;
}
-static snd_kcontrol_new_t snd_emu10k1x_shared_spdif __devinitdata =
+static struct snd_kcontrol_new snd_emu10k1x_shared_spdif __devinitdata =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Analog/Digital Output Jack",
.put = snd_emu10k1x_shared_spdif_put
};
-static int snd_emu10k1x_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_emu10k1x_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_emu10k1x_spdif_get(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_emu10k1x_spdif_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- emu10k1x_t *emu = snd_kcontrol_chip(kcontrol);
+ struct emu10k1x *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;
return 0;
}
-static int snd_emu10k1x_spdif_get_mask(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_emu10k1x_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;
return 0;
}
-static int snd_emu10k1x_spdif_put(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_emu10k1x_spdif_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- emu10k1x_t *emu = snd_kcontrol_chip(kcontrol);
+ struct emu10k1x *emu = snd_kcontrol_chip(kcontrol);
unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
int change;
unsigned int val;
return change;
}
-static snd_kcontrol_new_t snd_emu10k1x_spdif_mask_control =
+static struct snd_kcontrol_new snd_emu10k1x_spdif_mask_control =
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
.get = snd_emu10k1x_spdif_get_mask
};
-static snd_kcontrol_new_t snd_emu10k1x_spdif_control =
+static struct snd_kcontrol_new snd_emu10k1x_spdif_control =
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
.put = snd_emu10k1x_spdif_put
};
-static int __devinit snd_emu10k1x_mixer(emu10k1x_t *emu)
+static int __devinit snd_emu10k1x_mixer(struct emu10k1x *emu)
{
int err;
- snd_kcontrol_t *kctl;
- snd_card_t *card = emu->card;
+ struct snd_kcontrol *kctl;
+ struct snd_card *card = emu->card;
if ((kctl = snd_ctl_new1(&snd_emu10k1x_spdif_mask_control, emu)) == NULL)
return -ENOMEM;
#define EMU10K1X_MIDI_MODE_INPUT (1<<0)
#define EMU10K1X_MIDI_MODE_OUTPUT (1<<1)
-static inline unsigned char mpu401_read(emu10k1x_t *emu, emu10k1x_midi_t *mpu, int idx)
+static inline unsigned char mpu401_read(struct emu10k1x *emu, struct emu10k1x_midi *mpu, int idx)
{
return (unsigned char)snd_emu10k1x_ptr_read(emu, mpu->port + idx, 0);
}
-static inline void mpu401_write(emu10k1x_t *emu, emu10k1x_midi_t *mpu, int data, int idx)
+static inline void mpu401_write(struct emu10k1x *emu, struct emu10k1x_midi *mpu, int data, int idx)
{
snd_emu10k1x_ptr_write(emu, mpu->port + idx, 0, data);
}
#define MPU401_ENTER_UART 0x3f
#define MPU401_ACK 0xfe
-static void mpu401_clear_rx(emu10k1x_t *emu, emu10k1x_midi_t *mpu)
+static void mpu401_clear_rx(struct emu10k1x *emu, struct emu10k1x_midi *mpu)
{
int timeout = 100000;
for (; timeout > 0 && mpu401_input_avail(emu, mpu); timeout--)
*/
-static void do_emu10k1x_midi_interrupt(emu10k1x_t *emu, emu10k1x_midi_t *midi, unsigned int status)
+static void do_emu10k1x_midi_interrupt(struct emu10k1x *emu,
+ struct emu10k1x_midi *midi, unsigned int status)
{
unsigned char byte;
spin_unlock(&midi->output_lock);
}
-static void snd_emu10k1x_midi_interrupt(emu10k1x_t *emu, unsigned int status)
+static void snd_emu10k1x_midi_interrupt(struct emu10k1x *emu, unsigned int status)
{
do_emu10k1x_midi_interrupt(emu, &emu->midi, status);
}
-static void snd_emu10k1x_midi_cmd(emu10k1x_t * emu, emu10k1x_midi_t *midi, unsigned char cmd, int ack)
+static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu,
+ struct emu10k1x_midi *midi, unsigned char cmd, int ack)
{
unsigned long flags;
int timeout, ok;
mpu401_read_data(emu, midi));
}
-static int snd_emu10k1x_midi_input_open(snd_rawmidi_substream_t * substream)
+static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
{
- emu10k1x_t *emu;
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;
+ struct emu10k1x *emu;
+ struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
emu = midi->emu;
return 0;
}
-static int snd_emu10k1x_midi_output_open(snd_rawmidi_substream_t * substream)
+static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream)
{
- emu10k1x_t *emu;
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;
+ struct emu10k1x *emu;
+ struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
emu = midi->emu;
return 0;
}
-static int snd_emu10k1x_midi_input_close(snd_rawmidi_substream_t * substream)
+static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream)
{
- emu10k1x_t *emu;
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;
+ struct emu10k1x *emu;
+ struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
emu = midi->emu;
return 0;
}
-static int snd_emu10k1x_midi_output_close(snd_rawmidi_substream_t * substream)
+static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream)
{
- emu10k1x_t *emu;
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;
+ struct emu10k1x *emu;
+ struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
emu = midi->emu;
return 0;
}
-static void snd_emu10k1x_midi_input_trigger(snd_rawmidi_substream_t * substream, int up)
+static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
{
- emu10k1x_t *emu;
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;
+ struct emu10k1x *emu;
+ struct emu10k1x_midi *midi = substream->rmidi->private_data;
emu = midi->emu;
snd_assert(emu, return);
snd_emu10k1x_intr_disable(emu, midi->rx_enable);
}
-static void snd_emu10k1x_midi_output_trigger(snd_rawmidi_substream_t * substream, int up)
+static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
{
- emu10k1x_t *emu;
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)substream->rmidi->private_data;
+ struct emu10k1x *emu;
+ struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
emu = midi->emu;
*/
-static snd_rawmidi_ops_t snd_emu10k1x_midi_output =
+static struct snd_rawmidi_ops snd_emu10k1x_midi_output =
{
.open = snd_emu10k1x_midi_output_open,
.close = snd_emu10k1x_midi_output_close,
.trigger = snd_emu10k1x_midi_output_trigger,
};
-static snd_rawmidi_ops_t snd_emu10k1x_midi_input =
+static struct snd_rawmidi_ops snd_emu10k1x_midi_input =
{
.open = snd_emu10k1x_midi_input_open,
.close = snd_emu10k1x_midi_input_close,
.trigger = snd_emu10k1x_midi_input_trigger,
};
-static void snd_emu10k1x_midi_free(snd_rawmidi_t *rmidi)
+static void snd_emu10k1x_midi_free(struct snd_rawmidi *rmidi)
{
- emu10k1x_midi_t *midi = (emu10k1x_midi_t *)rmidi->private_data;
+ struct emu10k1x_midi *midi = rmidi->private_data;
midi->interrupt = NULL;
midi->rmidi = NULL;
}
-static int __devinit emu10k1x_midi_init(emu10k1x_t *emu, emu10k1x_midi_t *midi, int device, char *name)
+static int __devinit emu10k1x_midi_init(struct emu10k1x *emu,
+ struct emu10k1x_midi *midi, int device, char *name)
{
- snd_rawmidi_t *rmidi;
+ struct snd_rawmidi *rmidi;
int err;
if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0)
return 0;
}
-static int __devinit snd_emu10k1x_midi(emu10k1x_t *emu)
+static int __devinit snd_emu10k1x_midi(struct emu10k1x *emu)
{
- emu10k1x_midi_t *midi = &emu->midi;
+ struct emu10k1x_midi *midi = &emu->midi;
int err;
if ((err = emu10k1x_midi_init(emu, midi, 0, "EMU10K1X MPU-401 (UART)")) < 0)
const struct pci_device_id *pci_id)
{
static int dev;
- snd_card_t *card;
- emu10k1x_t *chip;
+ struct snd_card *card;
+ struct emu10k1x *chip;
int err;
if (dev >= SNDRV_CARDS)