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

[ALSA] Remove xxx_t typedefs: MPU401

Modules: MPU401 UART

Remove xxx_t typedefs from the MPU401-UART and MPU401 drivers
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 87e1f0e2
...@@ -58,10 +58,8 @@ ...@@ -58,10 +58,8 @@
#define MPU401_MODE_INPUT_TIMER (1<<0) #define MPU401_MODE_INPUT_TIMER (1<<0)
#define MPU401_MODE_OUTPUT_TIMER (1<<1) #define MPU401_MODE_OUTPUT_TIMER (1<<1)
typedef struct _snd_mpu401 mpu401_t; struct snd_mpu401 {
struct snd_rawmidi *rmidi;
struct _snd_mpu401 {
snd_rawmidi_t *rmidi;
unsigned short hardware; /* MPU401_HW_XXXX */ unsigned short hardware; /* MPU401_HW_XXXX */
unsigned long port; /* base port of MPU-401 chip */ unsigned long port; /* base port of MPU-401 chip */
...@@ -73,14 +71,14 @@ struct _snd_mpu401 { ...@@ -73,14 +71,14 @@ struct _snd_mpu401 {
unsigned long mode; /* MPU401_MODE_XXXX */ unsigned long mode; /* MPU401_MODE_XXXX */
int timer_invoked; int timer_invoked;
int (*open_input) (mpu401_t * mpu); int (*open_input) (struct snd_mpu401 * mpu);
void (*close_input) (mpu401_t * mpu); void (*close_input) (struct snd_mpu401 * mpu);
int (*open_output) (mpu401_t * mpu); int (*open_output) (struct snd_mpu401 * mpu);
void (*close_output) (mpu401_t * mpu); void (*close_output) (struct snd_mpu401 * mpu);
void *private_data; void *private_data;
snd_rawmidi_substream_t *substream_input; struct snd_rawmidi_substream *substream_input;
snd_rawmidi_substream_t *substream_output; struct snd_rawmidi_substream *substream_output;
spinlock_t input_lock; spinlock_t input_lock;
spinlock_t output_lock; spinlock_t output_lock;
...@@ -88,8 +86,8 @@ struct _snd_mpu401 { ...@@ -88,8 +86,8 @@ struct _snd_mpu401 {
struct timer_list timer; struct timer_list timer;
void (*write) (mpu401_t * mpu, unsigned char data, unsigned long addr); void (*write) (struct snd_mpu401 * mpu, unsigned char data, unsigned long addr);
unsigned char (*read) (mpu401_t * mpu, unsigned long addr); unsigned char (*read) (struct snd_mpu401 *mpu, unsigned long addr);
}; };
/* I/O ports */ /* I/O ports */
...@@ -103,13 +101,13 @@ struct _snd_mpu401 { ...@@ -103,13 +101,13 @@ struct _snd_mpu401 {
irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs);
int snd_mpu401_uart_new(snd_card_t * card, int snd_mpu401_uart_new(struct snd_card *card,
int device, int device,
unsigned short hardware, unsigned short hardware,
unsigned long port, unsigned long port,
int integrated, int integrated,
int irq, int irq,
int irq_flags, int irq_flags,
snd_rawmidi_t ** rrawmidi); struct snd_rawmidi ** rrawmidi);
#endif /* __SOUND_MPU401_H */ #endif /* __SOUND_MPU401_H */
...@@ -56,12 +56,12 @@ MODULE_PARM_DESC(port, "Port # for MPU-401 device."); ...@@ -56,12 +56,12 @@ MODULE_PARM_DESC(port, "Port # for MPU-401 device.");
module_param_array(irq, int, NULL, 0444); module_param_array(irq, int, NULL, 0444);
MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device."); MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; static struct snd_card *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
static int pnp_registered = 0; static int pnp_registered = 0;
static int snd_mpu401_create(int dev, snd_card_t **rcard) static int snd_mpu401_create(int dev, struct snd_card **rcard)
{ {
snd_card_t *card; struct snd_card *card;
int err; int err;
*rcard = NULL; *rcard = NULL;
...@@ -152,7 +152,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev, ...@@ -152,7 +152,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
const struct pnp_device_id *id) const struct pnp_device_id *id)
{ {
static int dev; static int dev;
snd_card_t *card; struct snd_card *card;
int err; int err;
for ( ; dev < SNDRV_CARDS; ++dev) { for ( ; dev < SNDRV_CARDS; ++dev) {
...@@ -174,7 +174,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev, ...@@ -174,7 +174,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev) static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev)
{ {
snd_card_t *card = (snd_card_t *) pnp_get_drvdata(dev); struct snd_card *card = (struct snd_card *) pnp_get_drvdata(dev);
snd_card_disconnect(card); snd_card_disconnect(card);
snd_card_free_in_thread(card); snd_card_free_in_thread(card);
......
...@@ -43,8 +43,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); ...@@ -43,8 +43,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode"); MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static void snd_mpu401_uart_input_read(mpu401_t * mpu); static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu);
static void snd_mpu401_uart_output_write(mpu401_t * mpu); static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu);
/* /*
...@@ -58,28 +58,28 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu); ...@@ -58,28 +58,28 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu);
#define MPU401_ACK 0xfe #define MPU401_ACK 0xfe
/* Build in lowlevel io */ /* Build in lowlevel io */
static void mpu401_write_port(mpu401_t *mpu, unsigned char data, unsigned long addr) static void mpu401_write_port(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr)
{ {
outb(data, addr); outb(data, addr);
} }
static unsigned char mpu401_read_port(mpu401_t *mpu, unsigned long addr) static unsigned char mpu401_read_port(struct snd_mpu401 *mpu, unsigned long addr)
{ {
return inb(addr); return inb(addr);
} }
static void mpu401_write_mmio(mpu401_t *mpu, unsigned char data, unsigned long addr) static void mpu401_write_mmio(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr)
{ {
writeb(data, (void __iomem *)addr); writeb(data, (void __iomem *)addr);
} }
static unsigned char mpu401_read_mmio(mpu401_t *mpu, unsigned long addr) static unsigned char mpu401_read_mmio(struct snd_mpu401 *mpu, unsigned long addr)
{ {
return readb((void __iomem *)addr); return readb((void __iomem *)addr);
} }
/* */ /* */
static void snd_mpu401_uart_clear_rx(mpu401_t *mpu) static void snd_mpu401_uart_clear_rx(struct snd_mpu401 *mpu)
{ {
int timeout = 100000; int timeout = 100000;
for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--) for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--)
...@@ -90,7 +90,7 @@ static void snd_mpu401_uart_clear_rx(mpu401_t *mpu) ...@@ -90,7 +90,7 @@ static void snd_mpu401_uart_clear_rx(mpu401_t *mpu)
#endif #endif
} }
static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) static void _snd_mpu401_uart_interrupt(struct snd_mpu401 *mpu)
{ {
spin_lock(&mpu->input_lock); spin_lock(&mpu->input_lock);
if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
...@@ -118,7 +118,7 @@ static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) ...@@ -118,7 +118,7 @@ static void _snd_mpu401_uart_interrupt(mpu401_t *mpu)
*/ */
irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
mpu401_t *mpu = dev_id; struct snd_mpu401 *mpu = dev_id;
if (mpu == NULL) if (mpu == NULL)
return IRQ_NONE; return IRQ_NONE;
...@@ -132,7 +132,7 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *reg ...@@ -132,7 +132,7 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *reg
*/ */
static void snd_mpu401_uart_timer(unsigned long data) static void snd_mpu401_uart_timer(unsigned long data)
{ {
mpu401_t *mpu = (mpu401_t *)data; struct snd_mpu401 *mpu = (struct snd_mpu401 *)data;
spin_lock(&mpu->timer_lock); spin_lock(&mpu->timer_lock);
/*mpu->mode |= MPU401_MODE_TIMER;*/ /*mpu->mode |= MPU401_MODE_TIMER;*/
...@@ -146,7 +146,7 @@ static void snd_mpu401_uart_timer(unsigned long data) ...@@ -146,7 +146,7 @@ static void snd_mpu401_uart_timer(unsigned long data)
/* /*
* initialize the timer callback if not programmed yet * initialize the timer callback if not programmed yet
*/ */
static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input) static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input)
{ {
unsigned long flags; unsigned long flags;
...@@ -165,7 +165,7 @@ static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input) ...@@ -165,7 +165,7 @@ static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input)
/* /*
* remove the timer callback if still active * remove the timer callback if still active
*/ */
static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input) static void snd_mpu401_uart_remove_timer (struct snd_mpu401 *mpu, int input)
{ {
unsigned long flags; unsigned long flags;
...@@ -182,7 +182,7 @@ static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input) ...@@ -182,7 +182,7 @@ static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input)
*/ */
static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack) static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack)
{ {
unsigned long flags; unsigned long flags;
int timeout, ok; int timeout, ok;
...@@ -225,9 +225,9 @@ static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack) ...@@ -225,9 +225,9 @@ static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack)
/* /*
* input/output open/close - protected by open_mutex in rawmidi.c * input/output open/close - protected by open_mutex in rawmidi.c
*/ */
static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream) static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream)
{ {
mpu401_t *mpu; struct snd_mpu401 *mpu;
int err; int err;
mpu = substream->rmidi->private_data; mpu = substream->rmidi->private_data;
...@@ -242,9 +242,9 @@ static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream) ...@@ -242,9 +242,9 @@ static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream)
return 0; return 0;
} }
static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream) static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
{ {
mpu401_t *mpu; struct snd_mpu401 *mpu;
int err; int err;
mpu = substream->rmidi->private_data; mpu = substream->rmidi->private_data;
...@@ -259,9 +259,9 @@ static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream) ...@@ -259,9 +259,9 @@ static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream)
return 0; return 0;
} }
static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream) static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream)
{ {
mpu401_t *mpu; struct snd_mpu401 *mpu;
mpu = substream->rmidi->private_data; mpu = substream->rmidi->private_data;
clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode);
...@@ -273,9 +273,9 @@ static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream) ...@@ -273,9 +273,9 @@ static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream)
return 0; return 0;
} }
static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream) static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream)
{ {
mpu401_t *mpu; struct snd_mpu401 *mpu;
mpu = substream->rmidi->private_data; mpu = substream->rmidi->private_data;
clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode); clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode);
...@@ -290,10 +290,10 @@ static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream) ...@@ -290,10 +290,10 @@ static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream)
/* /*
* trigger input callback * trigger input callback
*/ */
static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
unsigned long flags; unsigned long flags;
mpu401_t *mpu; struct snd_mpu401 *mpu;
int max = 64; int max = 64;
mpu = substream->rmidi->private_data; mpu = substream->rmidi->private_data;
...@@ -321,7 +321,7 @@ static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, i ...@@ -321,7 +321,7 @@ static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, i
* transfer input pending data * transfer input pending data
* call with input_lock spinlock held * call with input_lock spinlock held
*/ */
static void snd_mpu401_uart_input_read(mpu401_t * mpu) static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu)
{ {
int max = 128; int max = 128;
unsigned char byte; unsigned char byte;
...@@ -349,7 +349,7 @@ static void snd_mpu401_uart_input_read(mpu401_t * mpu) ...@@ -349,7 +349,7 @@ static void snd_mpu401_uart_input_read(mpu401_t * mpu)
* write output pending bytes * write output pending bytes
* call with output_lock spinlock held * call with output_lock spinlock held
*/ */
static void snd_mpu401_uart_output_write(mpu401_t * mpu) static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu)
{ {
unsigned char byte; unsigned char byte;
int max = 256, timeout; int max = 256, timeout;
...@@ -375,10 +375,10 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu) ...@@ -375,10 +375,10 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu)
/* /*
* output trigger callback * output trigger callback
*/ */
static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_mpu401_uart_output_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
unsigned long flags; unsigned long flags;
mpu401_t *mpu; struct snd_mpu401 *mpu;
mpu = substream->rmidi->private_data; mpu = substream->rmidi->private_data;
if (up) { if (up) {
...@@ -404,23 +404,23 @@ static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream, ...@@ -404,23 +404,23 @@ static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream,
*/ */
static snd_rawmidi_ops_t snd_mpu401_uart_output = static struct snd_rawmidi_ops snd_mpu401_uart_output =
{ {
.open = snd_mpu401_uart_output_open, .open = snd_mpu401_uart_output_open,
.close = snd_mpu401_uart_output_close, .close = snd_mpu401_uart_output_close,
.trigger = snd_mpu401_uart_output_trigger, .trigger = snd_mpu401_uart_output_trigger,
}; };
static snd_rawmidi_ops_t snd_mpu401_uart_input = static struct snd_rawmidi_ops snd_mpu401_uart_input =
{ {
.open = snd_mpu401_uart_input_open, .open = snd_mpu401_uart_input_open,
.close = snd_mpu401_uart_input_close, .close = snd_mpu401_uart_input_close,
.trigger = snd_mpu401_uart_input_trigger, .trigger = snd_mpu401_uart_input_trigger,
}; };
static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi) static void snd_mpu401_uart_free(struct snd_rawmidi *rmidi)
{ {
mpu401_t *mpu = rmidi->private_data; struct snd_mpu401 *mpu = rmidi->private_data;
if (mpu->irq_flags && mpu->irq >= 0) if (mpu->irq_flags && mpu->irq >= 0)
free_irq(mpu->irq, (void *) mpu); free_irq(mpu->irq, (void *) mpu);
release_and_free_resource(mpu->res); release_and_free_resource(mpu->res);
...@@ -442,18 +442,18 @@ static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi) ...@@ -442,18 +442,18 @@ static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi)
* *
* Note that the rawmidi instance is returned on the rrawmidi argument, * Note that the rawmidi instance is returned on the rrawmidi argument,
* not the mpu401 instance itself. To access to the mpu401 instance, * not the mpu401 instance itself. To access to the mpu401 instance,
* cast from rawmidi->private_data (with mpu401_t magic-cast). * cast from rawmidi->private_data (with struct snd_mpu401 magic-cast).
* *
* Returns zero if successful, or a negative error code. * Returns zero if successful, or a negative error code.
*/ */
int snd_mpu401_uart_new(snd_card_t * card, int device, int snd_mpu401_uart_new(struct snd_card *card, int device,
unsigned short hardware, unsigned short hardware,
unsigned long port, int integrated, unsigned long port, int integrated,
int irq, int irq_flags, int irq, int irq_flags,
snd_rawmidi_t ** rrawmidi) struct snd_rawmidi ** rrawmidi)
{ {
mpu401_t *mpu; struct snd_mpu401 *mpu;
snd_rawmidi_t *rmidi; struct snd_rawmidi *rmidi;
int err; int err;
if (rrawmidi) if (rrawmidi)
......
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