tag | line | file | source code |
devc | 134 | drivers/block/hd.c | char devc; |
devc | 136 | drivers/block/hd.c | devc = CURRENT ? 'a' + DEVICE_NR(CURRENT->dev) : '?'; |
devc | 139 | drivers/block/hd.c | printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff); |
devc | 153 | drivers/block/hd.c | printk("hd%c: %s: error=0x%02x { ", devc, msg, hd_error & 0xff); |
devc | 98 | drivers/sound/ad1848.c | ad_read (ad1848_info * devc, int reg) |
devc | 104 | drivers/sound/ad1848.c | OUTB ((unsigned char) (reg & 0xff) | devc->MCE_bit, io_Index_Addr (devc)); |
devc | 105 | drivers/sound/ad1848.c | x = INB (io_Indexed_Data (devc)); |
devc | 113 | drivers/sound/ad1848.c | ad_write (ad1848_info * devc, int reg, int data) |
devc | 118 | drivers/sound/ad1848.c | OUTB ((unsigned char) (reg & 0xff) | devc->MCE_bit, io_Index_Addr (devc)); |
devc | 119 | drivers/sound/ad1848.c | OUTB ((unsigned char) (data & 0xff), io_Indexed_Data (devc)); |
devc | 125 | drivers/sound/ad1848.c | ad_set_MCE (ad1848_info * devc, int state) |
devc | 131 | drivers/sound/ad1848.c | devc->MCE_bit = 0x40; |
devc | 133 | drivers/sound/ad1848.c | devc->MCE_bit = 0x00; |
devc | 134 | drivers/sound/ad1848.c | OUTB (devc->MCE_bit, io_Index_Addr (devc)); |
devc | 139 | drivers/sound/ad1848.c | wait_for_calibration (ad1848_info * devc) |
devc | 151 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) |
devc | 153 | drivers/sound/ad1848.c | if (INB (devc->base) == 0x80) |
devc | 157 | drivers/sound/ad1848.c | while (timeout > 0 && !(ad_read (devc, 11) & 0x20)) |
devc | 159 | drivers/sound/ad1848.c | if (!(ad_read (devc, 11) & 0x20)) |
devc | 163 | drivers/sound/ad1848.c | while (timeout > 0 && ad_read (devc, 11) & 0x20) |
devc | 165 | drivers/sound/ad1848.c | if (ad_read (devc, 11) & 0x20) |
devc | 193 | drivers/sound/ad1848.c | ad1848_info *devc = NULL; |
devc | 201 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 204 | drivers/sound/ad1848.c | if (devc->opened) |
devc | 211 | drivers/sound/ad1848.c | if (devc->irq) /* Not managed by another driver */ |
devc | 212 | drivers/sound/ad1848.c | if ((err = snd_set_irq_handler (devc->irq, ad1848_interrupt)) < 0) |
devc | 226 | drivers/sound/ad1848.c | devc->intr_active = 0; |
devc | 227 | drivers/sound/ad1848.c | devc->opened = 1; |
devc | 237 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 243 | drivers/sound/ad1848.c | devc->intr_active = 0; |
devc | 244 | drivers/sound/ad1848.c | if (devc->irq) /* Not managed by another driver */ |
devc | 245 | drivers/sound/ad1848.c | snd_release_irq (devc->irq); |
devc | 248 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 254 | drivers/sound/ad1848.c | set_speed (ad1848_info * devc, int arg) |
devc | 321 | drivers/sound/ad1848.c | devc->speed = speed_table[selected].speed; |
devc | 322 | drivers/sound/ad1848.c | devc->speed_bits = speed_table[selected].bits; |
devc | 323 | drivers/sound/ad1848.c | return devc->speed; |
devc | 327 | drivers/sound/ad1848.c | set_channels (ad1848_info * devc, int arg) |
devc | 330 | drivers/sound/ad1848.c | return devc->channels; |
devc | 332 | drivers/sound/ad1848.c | devc->channels = arg; |
devc | 337 | drivers/sound/ad1848.c | set_format (ad1848_info * devc, int arg) |
devc | 389 | drivers/sound/ad1848.c | if (!(arg & ad_format_mask[devc->mode])) |
devc | 392 | drivers/sound/ad1848.c | devc->audio_format = arg; |
devc | 397 | drivers/sound/ad1848.c | if ((devc->format_bits = format2bits[i].bits) == 0) |
devc | 398 | drivers/sound/ad1848.c | return devc->audio_format = AFMT_U8; /* Was not supported */ |
devc | 404 | drivers/sound/ad1848.c | devc->format_bits = 0; |
devc | 405 | drivers/sound/ad1848.c | return devc->audio_format = AFMT_U8; |
devc | 411 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 417 | drivers/sound/ad1848.c | return set_speed (devc, arg); |
devc | 418 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_speed (devc, IOCTL_IN (arg))); |
devc | 422 | drivers/sound/ad1848.c | return devc->speed; |
devc | 423 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->speed); |
devc | 427 | drivers/sound/ad1848.c | return set_channels (devc, arg + 1) - 1; |
devc | 428 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_channels (devc, IOCTL_IN (arg) + 1) - 1); |
devc | 432 | drivers/sound/ad1848.c | return set_channels (devc, arg); |
devc | 433 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_channels (devc, IOCTL_IN (arg))); |
devc | 437 | drivers/sound/ad1848.c | return devc->channels; |
devc | 438 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->channels); |
devc | 442 | drivers/sound/ad1848.c | return set_format (devc, arg); |
devc | 443 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_format (devc, IOCTL_IN (arg))); |
devc | 447 | drivers/sound/ad1848.c | return devc->audio_format; |
devc | 448 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->audio_format); |
devc | 459 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 463 | drivers/sound/ad1848.c | if (devc->audio_format == AFMT_IMA_ADPCM) |
devc | 469 | drivers/sound/ad1848.c | if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ |
devc | 472 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 478 | drivers/sound/ad1848.c | cnt == devc->xfer_count) |
devc | 480 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_OUTPUT; |
devc | 481 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 494 | drivers/sound/ad1848.c | ad_set_MCE (devc, 1); |
devc | 496 | drivers/sound/ad1848.c | ad_write (devc, 15, (unsigned char) (cnt & 0xff)); |
devc | 497 | drivers/sound/ad1848.c | ad_write (devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 500 | drivers/sound/ad1848.c | ad_write (devc, 9, 0x0d); /* |
devc | 505 | drivers/sound/ad1848.c | ad_set_MCE (devc, 0); /* |
devc | 509 | drivers/sound/ad1848.c | wait_for_calibration (devc); |
devc | 511 | drivers/sound/ad1848.c | devc->xfer_count = cnt; |
devc | 512 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_OUTPUT; |
devc | 513 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 521 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 526 | drivers/sound/ad1848.c | if (devc->audio_format == AFMT_IMA_ADPCM) |
devc | 532 | drivers/sound/ad1848.c | if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ |
devc | 535 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 541 | drivers/sound/ad1848.c | cnt == devc->xfer_count) |
devc | 543 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_INPUT; |
devc | 544 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 557 | drivers/sound/ad1848.c | ad_set_MCE (devc, 1); |
devc | 559 | drivers/sound/ad1848.c | ad_write (devc, count_reg + 1, (unsigned char) (cnt & 0xff)); |
devc | 560 | drivers/sound/ad1848.c | ad_write (devc, count_reg, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 562 | drivers/sound/ad1848.c | ad_write (devc, 15, (unsigned char) (cnt & 0xff)); |
devc | 563 | drivers/sound/ad1848.c | ad_write (devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 564 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 566 | drivers/sound/ad1848.c | ad_write (devc, 31, (unsigned char) (cnt & 0xff)); |
devc | 567 | drivers/sound/ad1848.c | ad_write (devc, 32, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 571 | drivers/sound/ad1848.c | ad_write (devc, 9, 0x0e); /* |
devc | 576 | drivers/sound/ad1848.c | ad_set_MCE (devc, 0); /* |
devc | 580 | drivers/sound/ad1848.c | wait_for_calibration (devc); |
devc | 582 | drivers/sound/ad1848.c | devc->xfer_count = cnt; |
devc | 583 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_INPUT; |
devc | 584 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 594 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 597 | drivers/sound/ad1848.c | ad_set_MCE (devc, 1); /* Enables changes to the format select reg */ |
devc | 598 | drivers/sound/ad1848.c | fs = devc->speed_bits | (devc->format_bits << 5); |
devc | 600 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 603 | drivers/sound/ad1848.c | ad_write (devc, 8, fs); |
devc | 608 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) |
devc | 611 | drivers/sound/ad1848.c | ad_set_MCE (devc, 0); /* |
devc | 615 | drivers/sound/ad1848.c | wait_for_calibration (devc); |
devc | 621 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 623 | drivers/sound/ad1848.c | ad_set_MCE (devc, 1); |
devc | 624 | drivers/sound/ad1848.c | ad_write (devc, 28, fs); |
devc | 630 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) |
devc | 633 | drivers/sound/ad1848.c | ad_set_MCE (devc, 0); /* |
devc | 637 | drivers/sound/ad1848.c | wait_for_calibration (devc); |
devc | 640 | drivers/sound/ad1848.c | devc->xfer_count = 0; |
devc | 653 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 655 | drivers/sound/ad1848.c | ad_write (devc, 9, 0); /* Clear the PEN and CEN bits (among others) */ |
devc | 656 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 667 | drivers/sound/ad1848.c | ad1848_info *devc = &dev_info[nr_ad1848_devs]; |
devc | 673 | drivers/sound/ad1848.c | devc->base = io_base; |
devc | 674 | drivers/sound/ad1848.c | devc->MCE_bit = 0x40; |
devc | 675 | drivers/sound/ad1848.c | devc->irq = 0; |
devc | 676 | drivers/sound/ad1848.c | devc->dma_capture = 0; |
devc | 677 | drivers/sound/ad1848.c | devc->dma_playback = 0; |
devc | 678 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 679 | drivers/sound/ad1848.c | devc->chip_name = "AD1848"; |
devc | 680 | drivers/sound/ad1848.c | devc->mode = 1; /* MODE1 = original AD1848 */ |
devc | 692 | drivers/sound/ad1848.c | if ((INB (devc->base) & 0x80) != 0x00) /* Not a AD1884 */ |
devc | 704 | drivers/sound/ad1848.c | ad_write (devc, 0, 0xaa); |
devc | 705 | drivers/sound/ad1848.c | ad_write (devc, 1, 0x45); /* 0x55 with bit 0x10 clear */ |
devc | 707 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 0)) != 0xaa || (tmp2 = ad_read (devc, 1)) != 0x45) |
devc | 713 | drivers/sound/ad1848.c | ad_write (devc, 0, 0x45); |
devc | 714 | drivers/sound/ad1848.c | ad_write (devc, 1, 0xaa); |
devc | 716 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 0)) != 0x45 || (tmp2 = ad_read (devc, 1)) != 0xaa) |
devc | 727 | drivers/sound/ad1848.c | tmp = ad_read (devc, 12); |
devc | 728 | drivers/sound/ad1848.c | ad_write (devc, 12, (~tmp) & 0x0f); |
devc | 730 | drivers/sound/ad1848.c | if ((tmp & 0x0f) != ((tmp1 = ad_read (devc, 12)) & 0x0f)) |
devc | 748 | drivers/sound/ad1848.c | ad_write (devc, 12, 0); /* Mode2=disabled */ |
devc | 751 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, i)) != (tmp2 = ad_read (devc, i + 16))) |
devc | 762 | drivers/sound/ad1848.c | ad_write (devc, 12, 0x40); /* Set mode2, clear 0x80 */ |
devc | 764 | drivers/sound/ad1848.c | tmp1 = ad_read (devc, 12); |
devc | 766 | drivers/sound/ad1848.c | devc->chip_name = "CS4248"; |
devc | 775 | drivers/sound/ad1848.c | ad_write (devc, 16, 0); /* Set I16 to known value */ |
devc | 777 | drivers/sound/ad1848.c | ad_write (devc, 0, 0x45); |
devc | 778 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 16)) != 0x45) /* No change -> CS4231? */ |
devc | 781 | drivers/sound/ad1848.c | ad_write (devc, 0, 0xaa); |
devc | 782 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 16)) == 0xaa) /* Rotten bits? */ |
devc | 792 | drivers/sound/ad1848.c | devc->chip_name = "CS4231"; |
devc | 793 | drivers/sound/ad1848.c | devc->mode = 2; |
devc | 818 | drivers/sound/ad1848.c | ad1848_info *devc = &dev_info[nr_ad1848_devs]; |
devc | 823 | drivers/sound/ad1848.c | devc->irq = (irq > 0) ? irq : 0; |
devc | 824 | drivers/sound/ad1848.c | devc->dma_capture = dma_playback; |
devc | 825 | drivers/sound/ad1848.c | devc->dma_playback = dma_capture; |
devc | 826 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 836 | drivers/sound/ad1848.c | ad_write (devc, i, init_values[i]); |
devc | 838 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear pending interrupts */ |
devc | 842 | drivers/sound/ad1848.c | "%s (%s)", name, devc->chip_name); |
devc | 859 | drivers/sound/ad1848.c | audio_devs[my_dev]->devc = devc; |
devc | 860 | drivers/sound/ad1848.c | audio_devs[my_dev]->format_mask = ad_format_mask[devc->mode]; |
devc | 871 | drivers/sound/ad1848.c | ad1848_info *devc; |
devc | 880 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 881 | drivers/sound/ad1848.c | status = INB (io_Status (devc)); |
devc | 885 | drivers/sound/ad1848.c | if (devc->opened && devc->irq_mode == IMODE_OUTPUT) |
devc | 890 | drivers/sound/ad1848.c | if (devc->opened && devc->irq_mode == IMODE_INPUT) |
devc | 894 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 117 | drivers/sound/dev_table.h | void *devc; /* Driver specific info */ |
devc | 106 | drivers/sound/mpu401.c | static int reset_mpu401 (struct mpu_config *devc); |
devc | 107 | drivers/sound/mpu401.c | static void set_uart_mode (int dev, struct mpu_config *devc, int arg); |
devc | 110 | drivers/sound/mpu401.c | static void timer_ext_event (struct mpu_config *devc, int event, int parm); |
devc | 145 | drivers/sound/mpu401.c | if (devc->opened & OPEN_READ) \ |
devc | 157 | drivers/sound/mpu401.c | do_midi_msg (struct mpu_config *devc, unsigned char *msg, int mlen) |
devc | 164 | drivers/sound/mpu401.c | STORE (SEQ_START_NOTE (devc->synthno, msg[0] & 0x0f, msg[1], msg[2])); |
devc | 170 | drivers/sound/mpu401.c | STORE (SEQ_STOP_NOTE (devc->synthno, msg[0] & 0x0f, msg[1], msg[2])); |
devc | 174 | drivers/sound/mpu401.c | STORE (SEQ_KEY_PRESSURE (devc->synthno, msg[0] & 0x0f, msg[1], msg[2])); |
devc | 187 | drivers/sound/mpu401.c | devc->controls[ctrl] = (msg[2] & 0x7f) << 7; |
devc | 192 | drivers/sound/mpu401.c | devc->controls[ctrl] = |
devc | 193 | drivers/sound/mpu401.c | (devc->controls[ctrl] & ~0x7f) | (msg[2] & 0x7f); |
devc | 195 | drivers/sound/mpu401.c | STORE (SEQ_CONTROL (devc->synthno, msg[0] & 0x0f, |
devc | 196 | drivers/sound/mpu401.c | msg[1], devc->controls[ctrl])); |
devc | 199 | drivers/sound/mpu401.c | STORE (SEQ_CONTROL (devc->synthno, msg[0] & 0x0f, msg[1], msg[2])); |
devc | 203 | drivers/sound/mpu401.c | STORE (SEQ_SET_PATCH (devc->synthno, msg[0] & 0x0f, msg[1])); |
devc | 207 | drivers/sound/mpu401.c | STORE (SEQ_CHN_PRESSURE (devc->synthno, msg[0] & 0x0f, msg[1])); |
devc | 211 | drivers/sound/mpu401.c | STORE (SEQ_BENDER (devc->synthno, msg[0] & 0x0f, |
devc | 221 | drivers/sound/mpu401.c | mpu_input_scanner (struct mpu_config *devc, unsigned char midic) |
devc | 223 | drivers/sound/mpu401.c | switch (devc->m_state) |
devc | 237 | drivers/sound/mpu401.c | if (devc->timer_flag) |
devc | 261 | drivers/sound/mpu401.c | devc->m_state = ST_SYSMSG; |
devc | 268 | drivers/sound/mpu401.c | devc->m_state = ST_TIMED; |
devc | 279 | drivers/sound/mpu401.c | devc->m_state = ST_DATABYTE; |
devc | 283 | drivers/sound/mpu401.c | msg = (devc->last_status & 0xf0) >> 4; |
devc | 285 | drivers/sound/mpu401.c | devc->m_left = len_tab[msg] - 1; |
devc | 287 | drivers/sound/mpu401.c | devc->m_ptr = 2; |
devc | 288 | drivers/sound/mpu401.c | devc->m_buf[0] = devc->last_status; |
devc | 289 | drivers/sound/mpu401.c | devc->m_buf[1] = midic; |
devc | 291 | drivers/sound/mpu401.c | if (devc->m_left <= 0) |
devc | 293 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 294 | drivers/sound/mpu401.c | do_midi_msg (devc, devc->m_buf, devc->m_ptr); |
devc | 295 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 300 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 322 | drivers/sound/mpu401.c | devc->last_status = midic; |
devc | 325 | drivers/sound/mpu401.c | devc->m_left = len_tab[msg]; |
devc | 327 | drivers/sound/mpu401.c | devc->m_ptr = 1; |
devc | 328 | drivers/sound/mpu401.c | devc->m_buf[0] = midic; |
devc | 330 | drivers/sound/mpu401.c | if (devc->m_left <= 0) |
devc | 332 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 333 | drivers/sound/mpu401.c | do_midi_msg (devc, devc->m_buf, devc->m_ptr); |
devc | 334 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 345 | drivers/sound/mpu401.c | devc->m_state = ST_SYSEX; |
devc | 349 | drivers/sound/mpu401.c | devc->m_state = ST_MTC; |
devc | 353 | drivers/sound/mpu401.c | devc->m_state = ST_SONGPOS; |
devc | 354 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 358 | drivers/sound/mpu401.c | devc->m_state = ST_SONGSEL; |
devc | 363 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 370 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 371 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_CLOCK, 0); |
devc | 375 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 376 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_START, 0); |
devc | 380 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 381 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_CONTINUE, 0); |
devc | 385 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 386 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_STOP, 0); |
devc | 391 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 396 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 401 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 406 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 414 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 421 | drivers/sound/mpu401.c | BUFTEST (devc); |
devc | 422 | drivers/sound/mpu401.c | devc->m_buf[devc->m_ptr++] = midic; |
devc | 423 | drivers/sound/mpu401.c | if (devc->m_ptr == 2) |
devc | 425 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 426 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 427 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_SPP, |
devc | 428 | drivers/sound/mpu401.c | ((devc->m_buf[1] & 0x7f) << 7) | |
devc | 429 | drivers/sound/mpu401.c | (devc->m_buf[0] & 0x7f)); |
devc | 434 | drivers/sound/mpu401.c | BUFTEST (devc); |
devc | 435 | drivers/sound/mpu401.c | devc->m_buf[devc->m_ptr++] = midic; |
devc | 436 | drivers/sound/mpu401.c | if ((--devc->m_left) <= 0) |
devc | 438 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 439 | drivers/sound/mpu401.c | do_midi_msg (devc, devc->m_buf, devc->m_ptr); |
devc | 440 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 445 | drivers/sound/mpu401.c | printk ("Bad state %d ", devc->m_state); |
devc | 446 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 453 | drivers/sound/mpu401.c | mpu401_input_loop (struct mpu_config *devc) |
devc | 459 | drivers/sound/mpu401.c | busy = devc->m_busy; |
devc | 460 | drivers/sound/mpu401.c | devc->m_busy = 1; |
devc | 466 | drivers/sound/mpu401.c | while (input_avail (devc->base)) |
devc | 468 | drivers/sound/mpu401.c | unsigned char c = read_data (devc->base); |
devc | 470 | drivers/sound/mpu401.c | if (devc->mode == MODE_SYNTH) |
devc | 472 | drivers/sound/mpu401.c | mpu_input_scanner (devc, c); |
devc | 474 | drivers/sound/mpu401.c | else if (devc->opened & OPEN_READ && devc->inputintr != NULL) |
devc | 475 | drivers/sound/mpu401.c | devc->inputintr (devc->devno, c); |
devc | 478 | drivers/sound/mpu401.c | devc->m_busy = 0; |
devc | 484 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 504 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 506 | drivers/sound/mpu401.c | if (devc->base != 0 && (devc->opened & OPEN_READ || devc->mode == MODE_SYNTH)) |
devc | 507 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 508 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 519 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 524 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 526 | drivers/sound/mpu401.c | if (devc->opened) |
devc | 532 | drivers/sound/mpu401.c | irq2dev[devc->irq] = dev; |
devc | 533 | drivers/sound/mpu401.c | if ((err = snd_set_irq_handler (devc->irq, mpuintr) < 0)) |
devc | 536 | drivers/sound/mpu401.c | set_uart_mode (dev, devc, 1); |
devc | 537 | drivers/sound/mpu401.c | devc->mode = MODE_MIDI; |
devc | 538 | drivers/sound/mpu401.c | devc->synthno = 0; |
devc | 540 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 542 | drivers/sound/mpu401.c | devc->inputintr = input; |
devc | 543 | drivers/sound/mpu401.c | devc->opened = mode; |
devc | 551 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 553 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 555 | drivers/sound/mpu401.c | if (devc->uart_mode) |
devc | 556 | drivers/sound/mpu401.c | reset_mpu401 (devc); /* |
devc | 559 | drivers/sound/mpu401.c | devc->mode = 0; |
devc | 561 | drivers/sound/mpu401.c | snd_release_irq (devc->irq); |
devc | 562 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 563 | drivers/sound/mpu401.c | irq2dev[devc->irq] = -1; |
devc | 564 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 573 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 575 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 582 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 583 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 590 | drivers/sound/mpu401.c | for (timeout = 30000; timeout > 0 && !output_ready (devc->base); timeout--); /* |
devc | 595 | drivers/sound/mpu401.c | if (!output_ready (devc->base)) |
devc | 602 | drivers/sound/mpu401.c | write_data (devc->base, midi_byte); |
devc | 613 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 615 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 617 | drivers/sound/mpu401.c | if (devc->uart_mode) /* |
devc | 628 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 629 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 636 | drivers/sound/mpu401.c | for (timeout = 500000; timeout > 0 && !output_ready (devc->base); timeout--); |
devc | 639 | drivers/sound/mpu401.c | if (!output_ready (devc->base)) |
devc | 646 | drivers/sound/mpu401.c | write_command (devc->base, cmd->cmd); |
devc | 649 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 650 | drivers/sound/mpu401.c | if (mpu_input_scanner (devc, read_data (devc->base)) == MPU_ACK) |
devc | 663 | drivers/sound/mpu401.c | for (timeout = 30000; timeout > 0 && !output_ready (devc->base); timeout--); |
devc | 681 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 683 | drivers/sound/mpu401.c | cmd->data[i] = read_data (devc->base); |
devc | 720 | drivers/sound/mpu401.c | struct mpu_config *devc = &dev_conf[dev]; |
devc | 722 | drivers/sound/mpu401.c | if (devc->uart_mode) |
devc | 764 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 766 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 776 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 781 | drivers/sound/mpu401.c | set_uart_mode (dev, devc, !IOCTL_IN (arg)); |
devc | 823 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 830 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 855 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 862 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 864 | drivers/sound/mpu401.c | if (devc->opened) |
devc | 870 | drivers/sound/mpu401.c | devc->opened = mode; |
devc | 871 | drivers/sound/mpu401.c | devc->mode = MODE_SYNTH; |
devc | 872 | drivers/sound/mpu401.c | devc->synthno = dev; |
devc | 874 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 875 | drivers/sound/mpu401.c | irq2dev[devc->irq] = midi_dev; |
devc | 876 | drivers/sound/mpu401.c | if ((err = snd_set_irq_handler (devc->irq, mpuintr) < 0)) |
devc | 879 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 894 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 898 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 902 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 903 | drivers/sound/mpu401.c | devc->mode = 0; |
devc | 904 | drivers/sound/mpu401.c | snd_release_irq (devc->irq); |
devc | 905 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 906 | drivers/sound/mpu401.c | irq2dev[devc->irq] = -1; |
devc | 957 | drivers/sound/mpu401.c | mpu401_chk_version (struct mpu_config *devc) |
devc | 961 | drivers/sound/mpu401.c | devc->version = devc->revision = 0; |
devc | 965 | drivers/sound/mpu401.c | devc->version = tmp; |
devc | 969 | drivers/sound/mpu401.c | devc->revision = tmp; |
devc | 979 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 990 | drivers/sound/mpu401.c | devc = &dev_conf[num_midis]; |
devc | 992 | drivers/sound/mpu401.c | devc->base = hw_config->io_base; |
devc | 993 | drivers/sound/mpu401.c | devc->irq = hw_config->irq; |
devc | 994 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 995 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 996 | drivers/sound/mpu401.c | devc->initialized = 0; |
devc | 997 | drivers/sound/mpu401.c | devc->version = 0; |
devc | 998 | drivers/sound/mpu401.c | devc->revision = 0; |
devc | 999 | drivers/sound/mpu401.c | devc->capabilities = 0; |
devc | 1000 | drivers/sound/mpu401.c | devc->timer_flag = 0; |
devc | 1001 | drivers/sound/mpu401.c | devc->m_busy = 0; |
devc | 1002 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 1005 | drivers/sound/mpu401.c | devc->controls[i] = 0x2000; |
devc | 1007 | drivers/sound/mpu401.c | if (!reset_mpu401 (devc)) |
devc | 1011 | drivers/sound/mpu401.c | mpu401_chk_version (devc); |
devc | 1012 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 1013 | drivers/sound/mpu401.c | mpu401_chk_version (devc); |
devc | 1016 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 1024 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_INTLG; /* Supports intelligent mode */ |
devc | 1043 | drivers/sound/mpu401.c | if (devc->version == 0x20 && devc->revision >= 0x07) /* MusicQuest interface */ |
devc | 1045 | drivers/sound/mpu401.c | int ports = (devc->revision & 0x08) ? 32 : 16; |
devc | 1047 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_SMPTE | |
devc | 1050 | drivers/sound/mpu401.c | revision_char = (devc->revision == 0x7f) ? 'M' : ' '; |
devc | 1065 | drivers/sound/mpu401.c | revision_char = devc->revision ? devc->revision + '@' : ' '; |
devc | 1066 | drivers/sound/mpu401.c | if (devc->revision > ('Z' - '@')) |
devc | 1069 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_FSK; |
devc | 1072 | drivers/sound/mpu401.c | (devc->version & 0xf0) >> 4, |
devc | 1073 | drivers/sound/mpu401.c | devc->version & 0x0f, |
devc | 1078 | drivers/sound/mpu401.c | (devc->version & 0xf0) >> 4, |
devc | 1079 | drivers/sound/mpu401.c | devc->version & 0x0f, |
devc | 1090 | drivers/sound/mpu401.c | mpu401_synth_operations[num_midis].midi_dev = devc->devno = num_midis; |
devc | 1091 | drivers/sound/mpu401.c | mpu401_synth_operations[devc->devno].info = |
devc | 1092 | drivers/sound/mpu401.c | &mpu_synth_info[devc->devno]; |
devc | 1094 | drivers/sound/mpu401.c | if (devc->capabilities & MPU_CAP_INTLG) /* Has timer */ |
devc | 1097 | drivers/sound/mpu401.c | midi_devs[num_midis++] = &mpu401_midi_operations[devc->devno]; |
devc | 1102 | drivers/sound/mpu401.c | reset_mpu401 (struct mpu_config *devc) |
devc | 1115 | drivers/sound/mpu401.c | timeout_limit = devc->initialized ? 30000 : 100000; |
devc | 1116 | drivers/sound/mpu401.c | devc->initialized = 1; |
devc | 1121 | drivers/sound/mpu401.c | ok = output_ready (devc->base); |
devc | 1123 | drivers/sound/mpu401.c | write_command (devc->base, MPU_RESET); /* |
devc | 1135 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 1136 | drivers/sound/mpu401.c | if (read_data (devc->base) == MPU_ACK) |
devc | 1143 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 1144 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 1145 | drivers/sound/mpu401.c | devc->m_left = 0; |
devc | 1146 | drivers/sound/mpu401.c | devc->last_status = 0; |
devc | 1147 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1153 | drivers/sound/mpu401.c | set_uart_mode (int dev, struct mpu_config *devc, int arg) |
devc | 1156 | drivers/sound/mpu401.c | if (!arg && devc->version == 0) |
devc | 1159 | drivers/sound/mpu401.c | if ((devc->uart_mode == 0) == (arg == 0)) |
devc | 1162 | drivers/sound/mpu401.c | reset_mpu401 (devc); /* This exits the uart mode */ |
devc | 1168 | drivers/sound/mpu401.c | printk ("MPU%d: Can't enter UART mode\n", devc->devno); |
devc | 1169 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1173 | drivers/sound/mpu401.c | devc->uart_mode = arg; |
devc | 1606 | drivers/sound/mpu401.c | timer_ext_event (struct mpu_config *devc, int event, int parm) |
devc | 1608 | drivers/sound/mpu401.c | int midi_dev = devc->devno; |
devc | 1610 | drivers/sound/mpu401.c | if (!devc->timer_flag) |
devc | 1664 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 1667 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 1687 | drivers/sound/mpu401.c | if (devc->version < 0x20) /* Original MPU-401 */ |
devc | 1699 | drivers/sound/mpu401.c | if (devc->revision) |
devc | 1702 | drivers/sound/mpu401.c | if (devc->revision & 0x02) |
devc | 1706 | drivers/sound/mpu401.c | if (devc->revision & 0x04) |
devc | 1710 | drivers/sound/mpu401.c | if (devc->revision & 0x40) |