Commit e1fad17bb4084dc7c435360185417aed55656ec8
Committed by
Jaroslav Kysela
1 parent
87e1f0e2b2
Exists in
master
and in
7 other branches
[ALSA] Remove xxx_t typedefs: MPU401
Modules: MPU401 UART Remove xxx_t typedefs from the MPU401-UART and MPU401 drivers Signed-off-by: Takashi Iwai <tiwai@suse.de>
Showing 3 changed files with 53 additions and 55 deletions Side-by-side Diff
include/sound/mpu401.h
... | ... | @@ -58,11 +58,9 @@ |
58 | 58 | #define MPU401_MODE_INPUT_TIMER (1<<0) |
59 | 59 | #define MPU401_MODE_OUTPUT_TIMER (1<<1) |
60 | 60 | |
61 | -typedef struct _snd_mpu401 mpu401_t; | |
61 | +struct snd_mpu401 { | |
62 | + struct snd_rawmidi *rmidi; | |
62 | 63 | |
63 | -struct _snd_mpu401 { | |
64 | - snd_rawmidi_t *rmidi; | |
65 | - | |
66 | 64 | unsigned short hardware; /* MPU401_HW_XXXX */ |
67 | 65 | unsigned long port; /* base port of MPU-401 chip */ |
68 | 66 | unsigned long cport; /* port + 1 (usually) */ |
69 | 67 | |
... | ... | @@ -73,14 +71,14 @@ |
73 | 71 | unsigned long mode; /* MPU401_MODE_XXXX */ |
74 | 72 | int timer_invoked; |
75 | 73 | |
76 | - int (*open_input) (mpu401_t * mpu); | |
77 | - void (*close_input) (mpu401_t * mpu); | |
78 | - int (*open_output) (mpu401_t * mpu); | |
79 | - void (*close_output) (mpu401_t * mpu); | |
74 | + int (*open_input) (struct snd_mpu401 * mpu); | |
75 | + void (*close_input) (struct snd_mpu401 * mpu); | |
76 | + int (*open_output) (struct snd_mpu401 * mpu); | |
77 | + void (*close_output) (struct snd_mpu401 * mpu); | |
80 | 78 | void *private_data; |
81 | 79 | |
82 | - snd_rawmidi_substream_t *substream_input; | |
83 | - snd_rawmidi_substream_t *substream_output; | |
80 | + struct snd_rawmidi_substream *substream_input; | |
81 | + struct snd_rawmidi_substream *substream_output; | |
84 | 82 | |
85 | 83 | spinlock_t input_lock; |
86 | 84 | spinlock_t output_lock; |
... | ... | @@ -88,8 +86,8 @@ |
88 | 86 | |
89 | 87 | struct timer_list timer; |
90 | 88 | |
91 | - void (*write) (mpu401_t * mpu, unsigned char data, unsigned long addr); | |
92 | - unsigned char (*read) (mpu401_t * mpu, unsigned long addr); | |
89 | + void (*write) (struct snd_mpu401 * mpu, unsigned char data, unsigned long addr); | |
90 | + unsigned char (*read) (struct snd_mpu401 *mpu, unsigned long addr); | |
93 | 91 | }; |
94 | 92 | |
95 | 93 | /* I/O ports */ |
96 | 94 | |
... | ... | @@ -103,14 +101,14 @@ |
103 | 101 | |
104 | 102 | irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); |
105 | 103 | |
106 | -int snd_mpu401_uart_new(snd_card_t * card, | |
104 | +int snd_mpu401_uart_new(struct snd_card *card, | |
107 | 105 | int device, |
108 | 106 | unsigned short hardware, |
109 | 107 | unsigned long port, |
110 | 108 | int integrated, |
111 | 109 | int irq, |
112 | 110 | int irq_flags, |
113 | - snd_rawmidi_t ** rrawmidi); | |
111 | + struct snd_rawmidi ** rrawmidi); | |
114 | 112 | |
115 | 113 | #endif /* __SOUND_MPU401_H */ |
sound/drivers/mpu401/mpu401.c
... | ... | @@ -56,12 +56,12 @@ |
56 | 56 | module_param_array(irq, int, NULL, 0444); |
57 | 57 | MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device."); |
58 | 58 | |
59 | -static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | |
59 | +static struct snd_card *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | |
60 | 60 | static int pnp_registered = 0; |
61 | 61 | |
62 | -static int snd_mpu401_create(int dev, snd_card_t **rcard) | |
62 | +static int snd_mpu401_create(int dev, struct snd_card **rcard) | |
63 | 63 | { |
64 | - snd_card_t *card; | |
64 | + struct snd_card *card; | |
65 | 65 | int err; |
66 | 66 | |
67 | 67 | *rcard = NULL; |
... | ... | @@ -152,7 +152,7 @@ |
152 | 152 | const struct pnp_device_id *id) |
153 | 153 | { |
154 | 154 | static int dev; |
155 | - snd_card_t *card; | |
155 | + struct snd_card *card; | |
156 | 156 | int err; |
157 | 157 | |
158 | 158 | for ( ; dev < SNDRV_CARDS; ++dev) { |
... | ... | @@ -174,7 +174,7 @@ |
174 | 174 | |
175 | 175 | static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev) |
176 | 176 | { |
177 | - snd_card_t *card = (snd_card_t *) pnp_get_drvdata(dev); | |
177 | + struct snd_card *card = (struct snd_card *) pnp_get_drvdata(dev); | |
178 | 178 | |
179 | 179 | snd_card_disconnect(card); |
180 | 180 | snd_card_free_in_thread(card); |
sound/drivers/mpu401/mpu401_uart.c
... | ... | @@ -43,8 +43,8 @@ |
43 | 43 | MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode"); |
44 | 44 | MODULE_LICENSE("GPL"); |
45 | 45 | |
46 | -static void snd_mpu401_uart_input_read(mpu401_t * mpu); | |
47 | -static void snd_mpu401_uart_output_write(mpu401_t * mpu); | |
46 | +static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu); | |
47 | +static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu); | |
48 | 48 | |
49 | 49 | /* |
50 | 50 | |
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | 54 | |
... | ... | @@ -58,28 +58,28 @@ |
58 | 58 | #define MPU401_ACK 0xfe |
59 | 59 | |
60 | 60 | /* Build in lowlevel io */ |
61 | -static void mpu401_write_port(mpu401_t *mpu, unsigned char data, unsigned long addr) | |
61 | +static void mpu401_write_port(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr) | |
62 | 62 | { |
63 | 63 | outb(data, addr); |
64 | 64 | } |
65 | 65 | |
66 | -static unsigned char mpu401_read_port(mpu401_t *mpu, unsigned long addr) | |
66 | +static unsigned char mpu401_read_port(struct snd_mpu401 *mpu, unsigned long addr) | |
67 | 67 | { |
68 | 68 | return inb(addr); |
69 | 69 | } |
70 | 70 | |
71 | -static void mpu401_write_mmio(mpu401_t *mpu, unsigned char data, unsigned long addr) | |
71 | +static void mpu401_write_mmio(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr) | |
72 | 72 | { |
73 | 73 | writeb(data, (void __iomem *)addr); |
74 | 74 | } |
75 | 75 | |
76 | -static unsigned char mpu401_read_mmio(mpu401_t *mpu, unsigned long addr) | |
76 | +static unsigned char mpu401_read_mmio(struct snd_mpu401 *mpu, unsigned long addr) | |
77 | 77 | { |
78 | 78 | return readb((void __iomem *)addr); |
79 | 79 | } |
80 | 80 | /* */ |
81 | 81 | |
82 | -static void snd_mpu401_uart_clear_rx(mpu401_t *mpu) | |
82 | +static void snd_mpu401_uart_clear_rx(struct snd_mpu401 *mpu) | |
83 | 83 | { |
84 | 84 | int timeout = 100000; |
85 | 85 | for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--) |
... | ... | @@ -90,7 +90,7 @@ |
90 | 90 | #endif |
91 | 91 | } |
92 | 92 | |
93 | -static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) | |
93 | +static void _snd_mpu401_uart_interrupt(struct snd_mpu401 *mpu) | |
94 | 94 | { |
95 | 95 | spin_lock(&mpu->input_lock); |
96 | 96 | if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { |
... | ... | @@ -118,7 +118,7 @@ |
118 | 118 | */ |
119 | 119 | irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
120 | 120 | { |
121 | - mpu401_t *mpu = dev_id; | |
121 | + struct snd_mpu401 *mpu = dev_id; | |
122 | 122 | |
123 | 123 | if (mpu == NULL) |
124 | 124 | return IRQ_NONE; |
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | */ |
133 | 133 | static void snd_mpu401_uart_timer(unsigned long data) |
134 | 134 | { |
135 | - mpu401_t *mpu = (mpu401_t *)data; | |
135 | + struct snd_mpu401 *mpu = (struct snd_mpu401 *)data; | |
136 | 136 | |
137 | 137 | spin_lock(&mpu->timer_lock); |
138 | 138 | /*mpu->mode |= MPU401_MODE_TIMER;*/ |
... | ... | @@ -146,7 +146,7 @@ |
146 | 146 | /* |
147 | 147 | * initialize the timer callback if not programmed yet |
148 | 148 | */ |
149 | -static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input) | |
149 | +static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input) | |
150 | 150 | { |
151 | 151 | unsigned long flags; |
152 | 152 | |
... | ... | @@ -165,7 +165,7 @@ |
165 | 165 | /* |
166 | 166 | * remove the timer callback if still active |
167 | 167 | */ |
168 | -static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input) | |
168 | +static void snd_mpu401_uart_remove_timer (struct snd_mpu401 *mpu, int input) | |
169 | 169 | { |
170 | 170 | unsigned long flags; |
171 | 171 | |
... | ... | @@ -182,7 +182,7 @@ |
182 | 182 | |
183 | 183 | */ |
184 | 184 | |
185 | -static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack) | |
185 | +static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack) | |
186 | 186 | { |
187 | 187 | unsigned long flags; |
188 | 188 | int timeout, ok; |
189 | 189 | |
... | ... | @@ -225,9 +225,9 @@ |
225 | 225 | /* |
226 | 226 | * input/output open/close - protected by open_mutex in rawmidi.c |
227 | 227 | */ |
228 | -static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream) | |
228 | +static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream) | |
229 | 229 | { |
230 | - mpu401_t *mpu; | |
230 | + struct snd_mpu401 *mpu; | |
231 | 231 | int err; |
232 | 232 | |
233 | 233 | mpu = substream->rmidi->private_data; |
234 | 234 | |
... | ... | @@ -242,9 +242,9 @@ |
242 | 242 | return 0; |
243 | 243 | } |
244 | 244 | |
245 | -static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream) | |
245 | +static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream) | |
246 | 246 | { |
247 | - mpu401_t *mpu; | |
247 | + struct snd_mpu401 *mpu; | |
248 | 248 | int err; |
249 | 249 | |
250 | 250 | mpu = substream->rmidi->private_data; |
251 | 251 | |
... | ... | @@ -259,9 +259,9 @@ |
259 | 259 | return 0; |
260 | 260 | } |
261 | 261 | |
262 | -static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream) | |
262 | +static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream) | |
263 | 263 | { |
264 | - mpu401_t *mpu; | |
264 | + struct snd_mpu401 *mpu; | |
265 | 265 | |
266 | 266 | mpu = substream->rmidi->private_data; |
267 | 267 | clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); |
268 | 268 | |
... | ... | @@ -273,9 +273,9 @@ |
273 | 273 | return 0; |
274 | 274 | } |
275 | 275 | |
276 | -static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream) | |
276 | +static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream) | |
277 | 277 | { |
278 | - mpu401_t *mpu; | |
278 | + struct snd_mpu401 *mpu; | |
279 | 279 | |
280 | 280 | mpu = substream->rmidi->private_data; |
281 | 281 | clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode); |
282 | 282 | |
... | ... | @@ -290,10 +290,10 @@ |
290 | 290 | /* |
291 | 291 | * trigger input callback |
292 | 292 | */ |
293 | -static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, int up) | |
293 | +static void snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substream, int up) | |
294 | 294 | { |
295 | 295 | unsigned long flags; |
296 | - mpu401_t *mpu; | |
296 | + struct snd_mpu401 *mpu; | |
297 | 297 | int max = 64; |
298 | 298 | |
299 | 299 | mpu = substream->rmidi->private_data; |
... | ... | @@ -321,7 +321,7 @@ |
321 | 321 | * transfer input pending data |
322 | 322 | * call with input_lock spinlock held |
323 | 323 | */ |
324 | -static void snd_mpu401_uart_input_read(mpu401_t * mpu) | |
324 | +static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu) | |
325 | 325 | { |
326 | 326 | int max = 128; |
327 | 327 | unsigned char byte; |
... | ... | @@ -349,7 +349,7 @@ |
349 | 349 | * write output pending bytes |
350 | 350 | * call with output_lock spinlock held |
351 | 351 | */ |
352 | -static void snd_mpu401_uart_output_write(mpu401_t * mpu) | |
352 | +static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu) | |
353 | 353 | { |
354 | 354 | unsigned char byte; |
355 | 355 | int max = 256, timeout; |
356 | 356 | |
... | ... | @@ -375,10 +375,10 @@ |
375 | 375 | /* |
376 | 376 | * output trigger callback |
377 | 377 | */ |
378 | -static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream, int up) | |
378 | +static void snd_mpu401_uart_output_trigger(struct snd_rawmidi_substream *substream, int up) | |
379 | 379 | { |
380 | 380 | unsigned long flags; |
381 | - mpu401_t *mpu; | |
381 | + struct snd_mpu401 *mpu; | |
382 | 382 | |
383 | 383 | mpu = substream->rmidi->private_data; |
384 | 384 | if (up) { |
385 | 385 | |
386 | 386 | |
387 | 387 | |
... | ... | @@ -404,23 +404,23 @@ |
404 | 404 | |
405 | 405 | */ |
406 | 406 | |
407 | -static snd_rawmidi_ops_t snd_mpu401_uart_output = | |
407 | +static struct snd_rawmidi_ops snd_mpu401_uart_output = | |
408 | 408 | { |
409 | 409 | .open = snd_mpu401_uart_output_open, |
410 | 410 | .close = snd_mpu401_uart_output_close, |
411 | 411 | .trigger = snd_mpu401_uart_output_trigger, |
412 | 412 | }; |
413 | 413 | |
414 | -static snd_rawmidi_ops_t snd_mpu401_uart_input = | |
414 | +static struct snd_rawmidi_ops snd_mpu401_uart_input = | |
415 | 415 | { |
416 | 416 | .open = snd_mpu401_uart_input_open, |
417 | 417 | .close = snd_mpu401_uart_input_close, |
418 | 418 | .trigger = snd_mpu401_uart_input_trigger, |
419 | 419 | }; |
420 | 420 | |
421 | -static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi) | |
421 | +static void snd_mpu401_uart_free(struct snd_rawmidi *rmidi) | |
422 | 422 | { |
423 | - mpu401_t *mpu = rmidi->private_data; | |
423 | + struct snd_mpu401 *mpu = rmidi->private_data; | |
424 | 424 | if (mpu->irq_flags && mpu->irq >= 0) |
425 | 425 | free_irq(mpu->irq, (void *) mpu); |
426 | 426 | release_and_free_resource(mpu->res); |
427 | 427 | |
428 | 428 | |
429 | 429 | |
... | ... | @@ -442,18 +442,18 @@ |
442 | 442 | * |
443 | 443 | * Note that the rawmidi instance is returned on the rrawmidi argument, |
444 | 444 | * not the mpu401 instance itself. To access to the mpu401 instance, |
445 | - * cast from rawmidi->private_data (with mpu401_t magic-cast). | |
445 | + * cast from rawmidi->private_data (with struct snd_mpu401 magic-cast). | |
446 | 446 | * |
447 | 447 | * Returns zero if successful, or a negative error code. |
448 | 448 | */ |
449 | -int snd_mpu401_uart_new(snd_card_t * card, int device, | |
449 | +int snd_mpu401_uart_new(struct snd_card *card, int device, | |
450 | 450 | unsigned short hardware, |
451 | 451 | unsigned long port, int integrated, |
452 | 452 | int irq, int irq_flags, |
453 | - snd_rawmidi_t ** rrawmidi) | |
453 | + struct snd_rawmidi ** rrawmidi) | |
454 | 454 | { |
455 | - mpu401_t *mpu; | |
456 | - snd_rawmidi_t *rmidi; | |
455 | + struct snd_mpu401 *mpu; | |
456 | + struct snd_rawmidi *rmidi; | |
457 | 457 | int err; |
458 | 458 | |
459 | 459 | if (rrawmidi) |