Commit e4a3d145 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: PCI CA0106

Modules: CA0106 driver

Remove xxx_t typedefs from the PCI CA0106 driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2fd16874
......@@ -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 snd_ca0106_ptr_read(struct snd_ca0106 * emu,
unsigned int reg,
unsigned int chn);
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);
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);
This diff is collapsed.
......@@ -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",
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment