mtpav.c (6bd0dd5f0ec67f654ebf95be8ef414afae1eecb7) | mtpav.c (45203832df2fa9e94ca0a249ddb20d2b077e58cc) |
---|---|
1/* 2 * MOTU Midi Timepiece ALSA Main routines 3 * Copyright by Michael T. Mayers (c) Jan 09, 2000 4 * mail: michael@tweakoz.com 5 * Thanks to John Galbraith 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 289 unchanged lines hidden (view full) --- 298 299 // send port change command if necessary 300 301 if (portp->hwport != mtp_card->outmidihwport) { 302 mtp_card->outmidihwport = portp->hwport; 303 304 snd_mtpav_send_byte(mtp_card, 0xf5); 305 snd_mtpav_send_byte(mtp_card, portp->hwport); | 1/* 2 * MOTU Midi Timepiece ALSA Main routines 3 * Copyright by Michael T. Mayers (c) Jan 09, 2000 4 * mail: michael@tweakoz.com 5 * Thanks to John Galbraith 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 289 unchanged lines hidden (view full) --- 298 299 // send port change command if necessary 300 301 if (portp->hwport != mtp_card->outmidihwport) { 302 mtp_card->outmidihwport = portp->hwport; 303 304 snd_mtpav_send_byte(mtp_card, 0xf5); 305 snd_mtpav_send_byte(mtp_card, portp->hwport); |
306 //snd_printk("new outport: 0x%x\n", (unsigned int) portp->hwport); 307 | 306 /* 307 snd_printk(KERN_DEBUG "new outport: 0x%x\n", 308 (unsigned int) portp->hwport); 309 */ |
308 if (!(outbyte & 0x80) && portp->running_status) 309 snd_mtpav_send_byte(mtp_card, portp->running_status); 310 } 311 312 // send data 313 314 do { 315 if (outbyte & 0x80) --- 219 unchanged lines hidden (view full) --- 535{ 536 u8 clrread, setread; 537 u8 mtp_read_byte; 538 u8 sr, cbyt; 539 int i; 540 541 u8 sbyt = snd_mtpav_getreg(mcrd, SREG); 542 | 310 if (!(outbyte & 0x80) && portp->running_status) 311 snd_mtpav_send_byte(mtp_card, portp->running_status); 312 } 313 314 // send data 315 316 do { 317 if (outbyte & 0x80) --- 219 unchanged lines hidden (view full) --- 537{ 538 u8 clrread, setread; 539 u8 mtp_read_byte; 540 u8 sr, cbyt; 541 int i; 542 543 u8 sbyt = snd_mtpav_getreg(mcrd, SREG); 544 |
543 //printk("snd_mtpav_read_bytes() sbyt: 0x%x\n", sbyt); | 545 /* printk(KERN_DEBUG "snd_mtpav_read_bytes() sbyt: 0x%x\n", sbyt); */ |
544 545 if (!(sbyt & SIGS_BYTE)) 546 return; 547 548 cbyt = snd_mtpav_getreg(mcrd, CREG); 549 clrread = cbyt & (SIGC_READ ^ 0xff); 550 setread = cbyt | SIGC_READ; 551 --- 28 unchanged lines hidden (view full) --- 580} 581 582/* 583 * get ISA resources 584 */ 585static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard) 586{ 587 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { | 546 547 if (!(sbyt & SIGS_BYTE)) 548 return; 549 550 cbyt = snd_mtpav_getreg(mcrd, CREG); 551 clrread = cbyt & (SIGC_READ ^ 0xff); 552 setread = cbyt | SIGC_READ; 553 --- 28 unchanged lines hidden (view full) --- 582} 583 584/* 585 * get ISA resources 586 */ 587static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard) 588{ 589 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { |
588 snd_printk("MTVAP port 0x%lx is busy\n", port); | 590 snd_printk(KERN_ERR "MTVAP port 0x%lx is busy\n", port); |
589 return -EBUSY; 590 } 591 mcard->port = port; 592 if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) { | 591 return -EBUSY; 592 } 593 mcard->port = port; 594 if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) { |
593 snd_printk("MTVAP IRQ %d busy\n", irq); | 595 snd_printk(KERN_ERR "MTVAP IRQ %d busy\n", irq); |
594 return -EBUSY; 595 } 596 mcard->irq = irq; 597 return 0; 598} 599 600 601/* --- 89 unchanged lines hidden (view full) --- 691/* 692 */ 693static int __devinit snd_mtpav_probe(struct platform_device *dev) 694{ 695 struct snd_card *card; 696 int err; 697 struct mtpav *mtp_card; 698 | 596 return -EBUSY; 597 } 598 mcard->irq = irq; 599 return 0; 600} 601 602 603/* --- 89 unchanged lines hidden (view full) --- 693/* 694 */ 695static int __devinit snd_mtpav_probe(struct platform_device *dev) 696{ 697 struct snd_card *card; 698 int err; 699 struct mtpav *mtp_card; 700 |
699 err = snd_card_create(index, id, THIS_MODULE, sizeof(*mtp_card), &card); 700 if (err < 0) 701 return err; | 701 card = snd_card_new(index, id, THIS_MODULE, sizeof(*mtp_card)); 702 if (! card) 703 return -ENOMEM; |
702 703 mtp_card = card->private_data; 704 spin_lock_init(&mtp_card->spinlock); 705 init_timer(&mtp_card->timer); 706 mtp_card->card = card; 707 mtp_card->irq = -1; 708 mtp_card->share_irq = 0; 709 mtp_card->inmidiport = 0xffffffff; --- 81 unchanged lines hidden --- | 704 705 mtp_card = card->private_data; 706 spin_lock_init(&mtp_card->spinlock); 707 init_timer(&mtp_card->timer); 708 mtp_card->card = card; 709 mtp_card->irq = -1; 710 mtp_card->share_irq = 0; 711 mtp_card->inmidiport = 0xffffffff; --- 81 unchanged lines hidden --- |