aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/mpu401/mpu401_uart.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:12:45 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:18:01 -0500
commite1fad17bb4084dc7c435360185417aed55656ec8 (patch)
treef374fc6324e0af415bac8f8f7e24bc2f2e42e4bc /sound/drivers/mpu401/mpu401_uart.c
parent87e1f0e2b206eaf8265997a8d0cb7126ea11c844 (diff)
[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>
Diffstat (limited to 'sound/drivers/mpu401/mpu401_uart.c')
-rw-r--r--sound/drivers/mpu401/mpu401_uart.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index bdeb2c00dac5..16e87f31788c 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -43,8 +43,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
43MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode"); 43MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode");
44MODULE_LICENSE("GPL"); 44MODULE_LICENSE("GPL");
45 45
46static void snd_mpu401_uart_input_read(mpu401_t * mpu); 46static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu);
47static void snd_mpu401_uart_output_write(mpu401_t * mpu); 47static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu);
48 48
49/* 49/*
50 50
@@ -58,28 +58,28 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu);
58#define MPU401_ACK 0xfe 58#define MPU401_ACK 0xfe
59 59
60/* Build in lowlevel io */ 60/* Build in lowlevel io */
61static void mpu401_write_port(mpu401_t *mpu, unsigned char data, unsigned long addr) 61static void mpu401_write_port(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr)
62{ 62{
63 outb(data, addr); 63 outb(data, addr);
64} 64}
65 65
66static unsigned char mpu401_read_port(mpu401_t *mpu, unsigned long addr) 66static unsigned char mpu401_read_port(struct snd_mpu401 *mpu, unsigned long addr)
67{ 67{
68 return inb(addr); 68 return inb(addr);
69} 69}
70 70
71static void mpu401_write_mmio(mpu401_t *mpu, unsigned char data, unsigned long addr) 71static void mpu401_write_mmio(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr)
72{ 72{
73 writeb(data, (void __iomem *)addr); 73 writeb(data, (void __iomem *)addr);
74} 74}
75 75
76static unsigned char mpu401_read_mmio(mpu401_t *mpu, unsigned long addr) 76static unsigned char mpu401_read_mmio(struct snd_mpu401 *mpu, unsigned long addr)
77{ 77{
78 return readb((void __iomem *)addr); 78 return readb((void __iomem *)addr);
79} 79}
80/* */ 80/* */
81 81
82static void snd_mpu401_uart_clear_rx(mpu401_t *mpu) 82static void snd_mpu401_uart_clear_rx(struct snd_mpu401 *mpu)
83{ 83{
84 int timeout = 100000; 84 int timeout = 100000;
85 for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--) 85 for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--)
@@ -90,7 +90,7 @@ static void snd_mpu401_uart_clear_rx(mpu401_t *mpu)
90#endif 90#endif
91} 91}
92 92
93static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) 93static void _snd_mpu401_uart_interrupt(struct snd_mpu401 *mpu)
94{ 94{
95 spin_lock(&mpu->input_lock); 95 spin_lock(&mpu->input_lock);
96 if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { 96 if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
@@ -118,7 +118,7 @@ static void _snd_mpu401_uart_interrupt(mpu401_t *mpu)
118 */ 118 */
119irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) 119irqreturn_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 if (mpu == NULL) 123 if (mpu == NULL)
124 return IRQ_NONE; 124 return IRQ_NONE;
@@ -132,7 +132,7 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *reg
132 */ 132 */
133static void snd_mpu401_uart_timer(unsigned long data) 133static 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 spin_lock(&mpu->timer_lock); 137 spin_lock(&mpu->timer_lock);
138 /*mpu->mode |= MPU401_MODE_TIMER;*/ 138 /*mpu->mode |= MPU401_MODE_TIMER;*/
@@ -146,7 +146,7 @@ static void snd_mpu401_uart_timer(unsigned long data)
146/* 146/*
147 * initialize the timer callback if not programmed yet 147 * initialize the timer callback if not programmed yet
148 */ 148 */
149static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input) 149static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input)
150{ 150{
151 unsigned long flags; 151 unsigned long flags;
152 152
@@ -165,7 +165,7 @@ static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input)
165/* 165/*
166 * remove the timer callback if still active 166 * remove the timer callback if still active
167 */ 167 */
168static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input) 168static void snd_mpu401_uart_remove_timer (struct snd_mpu401 *mpu, int input)
169{ 169{
170 unsigned long flags; 170 unsigned long flags;
171 171
@@ -182,7 +182,7 @@ static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input)
182 182
183 */ 183 */
184 184
185static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack) 185static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack)
186{ 186{
187 unsigned long flags; 187 unsigned long flags;
188 int timeout, ok; 188 int timeout, ok;
@@ -225,9 +225,9 @@ static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack)
225/* 225/*
226 * input/output open/close - protected by open_mutex in rawmidi.c 226 * input/output open/close - protected by open_mutex in rawmidi.c
227 */ 227 */
228static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream) 228static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream)
229{ 229{
230 mpu401_t *mpu; 230 struct snd_mpu401 *mpu;
231 int err; 231 int err;
232 232
233 mpu = substream->rmidi->private_data; 233 mpu = substream->rmidi->private_data;
@@ -242,9 +242,9 @@ static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream)
242 return 0; 242 return 0;
243} 243}
244 244
245static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream) 245static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
246{ 246{
247 mpu401_t *mpu; 247 struct snd_mpu401 *mpu;
248 int err; 248 int err;
249 249
250 mpu = substream->rmidi->private_data; 250 mpu = substream->rmidi->private_data;
@@ -259,9 +259,9 @@ static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream)
259 return 0; 259 return 0;
260} 260}
261 261
262static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream) 262static 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 mpu = substream->rmidi->private_data; 266 mpu = substream->rmidi->private_data;
267 clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); 267 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 return 0; 273 return 0;
274} 274}
275 275
276static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream) 276static 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 mpu = substream->rmidi->private_data; 280 mpu = substream->rmidi->private_data;
281 clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode); 281 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/* 290/*
291 * trigger input callback 291 * trigger input callback
292 */ 292 */
293static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, int up) 293static void snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substream, int up)
294{ 294{
295 unsigned long flags; 295 unsigned long flags;
296 mpu401_t *mpu; 296 struct snd_mpu401 *mpu;
297 int max = 64; 297 int max = 64;
298 298
299 mpu = substream->rmidi->private_data; 299 mpu = substream->rmidi->private_data;
@@ -321,7 +321,7 @@ static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, i
321 * transfer input pending data 321 * transfer input pending data
322 * call with input_lock spinlock held 322 * call with input_lock spinlock held
323 */ 323 */
324static void snd_mpu401_uart_input_read(mpu401_t * mpu) 324static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu)
325{ 325{
326 int max = 128; 326 int max = 128;
327 unsigned char byte; 327 unsigned char byte;
@@ -349,7 +349,7 @@ static void snd_mpu401_uart_input_read(mpu401_t * mpu)
349 * write output pending bytes 349 * write output pending bytes
350 * call with output_lock spinlock held 350 * call with output_lock spinlock held
351 */ 351 */
352static void snd_mpu401_uart_output_write(mpu401_t * mpu) 352static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu)
353{ 353{
354 unsigned char byte; 354 unsigned char byte;
355 int max = 256, timeout; 355 int max = 256, timeout;
@@ -375,10 +375,10 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu)
375/* 375/*
376 * output trigger callback 376 * output trigger callback
377 */ 377 */
378static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream, int up) 378static void snd_mpu401_uart_output_trigger(struct snd_rawmidi_substream *substream, int up)
379{ 379{
380 unsigned long flags; 380 unsigned long flags;
381 mpu401_t *mpu; 381 struct snd_mpu401 *mpu;
382 382
383 mpu = substream->rmidi->private_data; 383 mpu = substream->rmidi->private_data;
384 if (up) { 384 if (up) {
@@ -404,23 +404,23 @@ static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream,
404 404
405 */ 405 */
406 406
407static snd_rawmidi_ops_t snd_mpu401_uart_output = 407static struct snd_rawmidi_ops snd_mpu401_uart_output =
408{ 408{
409 .open = snd_mpu401_uart_output_open, 409 .open = snd_mpu401_uart_output_open,
410 .close = snd_mpu401_uart_output_close, 410 .close = snd_mpu401_uart_output_close,
411 .trigger = snd_mpu401_uart_output_trigger, 411 .trigger = snd_mpu401_uart_output_trigger,
412}; 412};
413 413
414static snd_rawmidi_ops_t snd_mpu401_uart_input = 414static struct snd_rawmidi_ops snd_mpu401_uart_input =
415{ 415{
416 .open = snd_mpu401_uart_input_open, 416 .open = snd_mpu401_uart_input_open,
417 .close = snd_mpu401_uart_input_close, 417 .close = snd_mpu401_uart_input_close,
418 .trigger = snd_mpu401_uart_input_trigger, 418 .trigger = snd_mpu401_uart_input_trigger,
419}; 419};
420 420
421static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi) 421static 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 if (mpu->irq_flags && mpu->irq >= 0) 424 if (mpu->irq_flags && mpu->irq >= 0)
425 free_irq(mpu->irq, (void *) mpu); 425 free_irq(mpu->irq, (void *) mpu);
426 release_and_free_resource(mpu->res); 426 release_and_free_resource(mpu->res);
@@ -442,18 +442,18 @@ static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi)
442 * 442 *
443 * Note that the rawmidi instance is returned on the rrawmidi argument, 443 * Note that the rawmidi instance is returned on the rrawmidi argument,
444 * not the mpu401 instance itself. To access to the mpu401 instance, 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 * Returns zero if successful, or a negative error code. 447 * Returns zero if successful, or a negative error code.
448 */ 448 */
449int snd_mpu401_uart_new(snd_card_t * card, int device, 449int snd_mpu401_uart_new(struct snd_card *card, int device,
450 unsigned short hardware, 450 unsigned short hardware,
451 unsigned long port, int integrated, 451 unsigned long port, int integrated,
452 int irq, int irq_flags, 452 int irq, int irq_flags,
453 snd_rawmidi_t ** rrawmidi) 453 struct snd_rawmidi ** rrawmidi)
454{ 454{
455 mpu401_t *mpu; 455 struct snd_mpu401 *mpu;
456 snd_rawmidi_t *rmidi; 456 struct snd_rawmidi *rmidi;
457 int err; 457 int err;
458 458
459 if (rrawmidi) 459 if (rrawmidi)