tag | line | file | source code |
devc | 132 | drivers/block/hd.c | char devc; |
devc | 134 | drivers/block/hd.c | devc = CURRENT ? 'a' + DEVICE_NR(CURRENT->rq_dev) : '?'; |
devc | 137 | drivers/block/hd.c | printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff); |
devc | 151 | drivers/block/hd.c | printk("hd%c: %s: error=0x%02x { ", devc, msg, hd_error & 0xff); |
devc | 134 | drivers/sound/ad1848.c | ad_read (ad1848_info * devc, int reg) |
devc | 140 | drivers/sound/ad1848.c | while (timeout > 0 && inb (devc->base) == 0x80) /*Are we initializing */ |
devc | 145 | drivers/sound/ad1848.c | outb ((unsigned char) (reg & 0xff) | devc->MCE_bit, io_Index_Addr (devc)); |
devc | 146 | drivers/sound/ad1848.c | x = inb (io_Indexed_Data (devc)); |
devc | 154 | drivers/sound/ad1848.c | ad_write (ad1848_info * devc, int reg, int data) |
devc | 160 | drivers/sound/ad1848.c | inb (devc->base) == 0x80) /*Are we initializing */ |
devc | 165 | drivers/sound/ad1848.c | outb ((unsigned char) (reg & 0xff) | devc->MCE_bit, io_Index_Addr (devc)); |
devc | 166 | drivers/sound/ad1848.c | outb ((unsigned char) (data & 0xff), io_Indexed_Data (devc)); |
devc | 172 | drivers/sound/ad1848.c | wait_for_calibration (ad1848_info * devc) |
devc | 184 | drivers/sound/ad1848.c | while (timeout > 0 && inb (devc->base) == 0x80) |
devc | 186 | drivers/sound/ad1848.c | if (inb (devc->base) & 0x80) |
devc | 190 | drivers/sound/ad1848.c | while (timeout > 0 && !(ad_read (devc, 11) & 0x20)) |
devc | 192 | drivers/sound/ad1848.c | if (!(ad_read (devc, 11) & 0x20)) |
devc | 196 | drivers/sound/ad1848.c | while (timeout > 0 && ad_read (devc, 11) & 0x20) |
devc | 198 | drivers/sound/ad1848.c | if (ad_read (devc, 11) & 0x20) |
devc | 203 | drivers/sound/ad1848.c | ad_mute (ad1848_info * devc) |
devc | 208 | drivers/sound/ad1848.c | if (devc->mode != MD_1848) |
devc | 215 | drivers/sound/ad1848.c | prev = devc->saved_regs[i] = ad_read (devc, i); |
devc | 216 | drivers/sound/ad1848.c | ad_write (devc, i, prev | 0x80); |
devc | 221 | drivers/sound/ad1848.c | ad_unmute (ad1848_info * devc) |
devc | 230 | drivers/sound/ad1848.c | ad_write (devc, i, devc->saved_regs[i] & ~0x80); |
devc | 235 | drivers/sound/ad1848.c | ad_enter_MCE (ad1848_info * devc) |
devc | 241 | drivers/sound/ad1848.c | while (timeout > 0 && inb (devc->base) == 0x80) /*Are we initializing */ |
devc | 247 | drivers/sound/ad1848.c | devc->MCE_bit = 0x40; |
devc | 248 | drivers/sound/ad1848.c | prev = inb (io_Index_Addr (devc)); |
devc | 255 | drivers/sound/ad1848.c | outb (devc->MCE_bit, io_Index_Addr (devc)); |
devc | 260 | drivers/sound/ad1848.c | ad_leave_MCE (ad1848_info * devc) |
devc | 266 | drivers/sound/ad1848.c | while (timeout > 0 && inb (devc->base) == 0x80) /*Are we initializing */ |
devc | 272 | drivers/sound/ad1848.c | devc->MCE_bit = 0x00; |
devc | 273 | drivers/sound/ad1848.c | prev = inb (io_Index_Addr (devc)); |
devc | 274 | drivers/sound/ad1848.c | outb (0x00, io_Index_Addr (devc)); /* Clear the MCE bit */ |
devc | 282 | drivers/sound/ad1848.c | outb (0x00, io_Index_Addr (devc)); /* Clear the MCE bit */ |
devc | 283 | drivers/sound/ad1848.c | wait_for_calibration (devc); |
devc | 289 | drivers/sound/ad1848.c | ad1848_set_recmask (ad1848_info * devc, int mask) |
devc | 294 | drivers/sound/ad1848.c | mask &= devc->supported_rec_devices; |
devc | 305 | drivers/sound/ad1848.c | mask &= ~devc->recmask; /* Filter out active settings */ |
devc | 342 | drivers/sound/ad1848.c | ad_write (devc, 0, (ad_read (devc, 0) & 0x3f) | recdev); |
devc | 343 | drivers/sound/ad1848.c | ad_write (devc, 1, (ad_read (devc, 1) & 0x3f) | recdev); |
devc | 345 | drivers/sound/ad1848.c | devc->recmask = mask; |
devc | 367 | drivers/sound/ad1848.c | ad1848_mixer_get (ad1848_info * devc, int dev) |
devc | 369 | drivers/sound/ad1848.c | if (!((1 << dev) & devc->supported_devices)) |
devc | 372 | drivers/sound/ad1848.c | return devc->levels[dev]; |
devc | 376 | drivers/sound/ad1848.c | ad1848_mixer_set (ad1848_info * devc, int dev, int value) |
devc | 406 | drivers/sound/ad1848.c | if (!(devc->supported_devices & (1 << dev))) |
devc | 412 | drivers/sound/ad1848.c | devc->levels[dev] = retvol; |
devc | 419 | drivers/sound/ad1848.c | val = ad_read (devc, regoffs); |
devc | 421 | drivers/sound/ad1848.c | ad_write (devc, regoffs, val); |
devc | 422 | drivers/sound/ad1848.c | devc->saved_regs[regoffs] = val; |
devc | 432 | drivers/sound/ad1848.c | val = ad_read (devc, regoffs); |
devc | 434 | drivers/sound/ad1848.c | ad_write (devc, regoffs, val); |
devc | 435 | drivers/sound/ad1848.c | devc->saved_regs[regoffs] = val; |
devc | 441 | drivers/sound/ad1848.c | ad1848_mixer_reset (ad1848_info * devc) |
devc | 445 | drivers/sound/ad1848.c | switch (devc->mode) |
devc | 450 | drivers/sound/ad1848.c | devc->supported_devices = MODE2_MIXER_DEVICES; |
devc | 454 | drivers/sound/ad1848.c | devc->supported_devices = MODE3_MIXER_DEVICES; |
devc | 458 | drivers/sound/ad1848.c | devc->supported_devices = MODE1_MIXER_DEVICES; |
devc | 461 | drivers/sound/ad1848.c | devc->supported_rec_devices = MODE1_REC_DEVICES; |
devc | 464 | drivers/sound/ad1848.c | if (devc->supported_devices & (1 << i)) |
devc | 465 | drivers/sound/ad1848.c | ad1848_mixer_set (devc, i, default_mixer_levels[i]); |
devc | 466 | drivers/sound/ad1848.c | ad1848_set_recmask (devc, SOUND_MASK_MIC); |
devc | 472 | drivers/sound/ad1848.c | ad1848_info *devc; |
devc | 481 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[codec_dev]->devc; |
devc | 490 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, ad1848_set_recmask (devc, get_fs_long ((long *) arg))); |
devc | 494 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, ad1848_mixer_set (devc, cmd & 0xff, get_fs_long ((long *) arg))); |
devc | 503 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->recmask); |
devc | 507 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->supported_devices); |
devc | 511 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->supported_devices & ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX)); |
devc | 515 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->supported_rec_devices); |
devc | 523 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, ad1848_mixer_get (devc, cmd & 0xff)); |
devc | 562 | drivers/sound/ad1848.c | ad1848_info *devc = NULL; |
devc | 568 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 573 | drivers/sound/ad1848.c | if (devc->opened) |
devc | 581 | drivers/sound/ad1848.c | devc->dual_dma = 0; |
devc | 585 | drivers/sound/ad1848.c | devc->dual_dma = 1; |
devc | 588 | drivers/sound/ad1848.c | devc->intr_active = 0; |
devc | 589 | drivers/sound/ad1848.c | devc->opened = 1; |
devc | 590 | drivers/sound/ad1848.c | devc->irq_mode = 0; |
devc | 596 | drivers/sound/ad1848.c | ad_mute (devc); |
devc | 605 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 612 | drivers/sound/ad1848.c | devc->intr_active = 0; |
devc | 616 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 617 | drivers/sound/ad1848.c | devc->irq_mode = 0; |
devc | 619 | drivers/sound/ad1848.c | ad_unmute (devc); |
devc | 624 | drivers/sound/ad1848.c | set_speed (ad1848_info * devc, int arg) |
devc | 664 | drivers/sound/ad1848.c | if (devc->mode == MD_1845) /* AD1845 has different timer than others */ |
devc | 671 | drivers/sound/ad1848.c | devc->speed = arg; |
devc | 672 | drivers/sound/ad1848.c | devc->speed_bits = speed_table[3].bits; |
devc | 673 | drivers/sound/ad1848.c | return devc->speed; |
devc | 703 | drivers/sound/ad1848.c | devc->speed = speed_table[selected].speed; |
devc | 704 | drivers/sound/ad1848.c | devc->speed_bits = speed_table[selected].bits; |
devc | 705 | drivers/sound/ad1848.c | return devc->speed; |
devc | 709 | drivers/sound/ad1848.c | set_channels (ad1848_info * devc, int arg) |
devc | 712 | drivers/sound/ad1848.c | return devc->channels; |
devc | 714 | drivers/sound/ad1848.c | devc->channels = arg; |
devc | 719 | drivers/sound/ad1848.c | set_format (ad1848_info * devc, int arg) |
devc | 771 | drivers/sound/ad1848.c | if (!(arg & ad_format_mask[devc->mode])) |
devc | 774 | drivers/sound/ad1848.c | devc->audio_format = arg; |
devc | 779 | drivers/sound/ad1848.c | if ((devc->format_bits = format2bits[i].bits) == 0) |
devc | 780 | drivers/sound/ad1848.c | return devc->audio_format = AFMT_U8; /* Was not supported */ |
devc | 786 | drivers/sound/ad1848.c | devc->format_bits = 0; |
devc | 787 | drivers/sound/ad1848.c | return devc->audio_format = AFMT_U8; |
devc | 793 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 799 | drivers/sound/ad1848.c | return set_speed (devc, (int) arg); |
devc | 800 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, set_speed (devc, get_fs_long ((long *) arg))); |
devc | 804 | drivers/sound/ad1848.c | return devc->speed; |
devc | 805 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->speed); |
devc | 809 | drivers/sound/ad1848.c | return set_channels (devc, (int) arg + 1) - 1; |
devc | 810 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, set_channels (devc, get_fs_long ((long *) arg) + 1) - 1); |
devc | 814 | drivers/sound/ad1848.c | return set_channels (devc, (int) arg); |
devc | 815 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, set_channels (devc, get_fs_long ((long *) arg))); |
devc | 819 | drivers/sound/ad1848.c | return devc->channels; |
devc | 820 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->channels); |
devc | 824 | drivers/sound/ad1848.c | return set_format (devc, (int) arg); |
devc | 825 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, set_format (devc, get_fs_long ((long *) arg))); |
devc | 829 | drivers/sound/ad1848.c | return devc->audio_format; |
devc | 830 | drivers/sound/ad1848.c | return snd_ioctl_return ((int *) arg, devc->audio_format); |
devc | 841 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 845 | drivers/sound/ad1848.c | if (devc->audio_format == AFMT_IMA_ADPCM) |
devc | 851 | drivers/sound/ad1848.c | if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ |
devc | 854 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 858 | drivers/sound/ad1848.c | if (devc->irq_mode & PCM_ENABLE_OUTPUT && audio_devs[dev]->flags & DMA_AUTOMODE && |
devc | 860 | drivers/sound/ad1848.c | cnt == devc->xfer_count) |
devc | 862 | drivers/sound/ad1848.c | devc->irq_mode |= PCM_ENABLE_OUTPUT; |
devc | 863 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 873 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x01); /* Playback disable */ |
devc | 878 | drivers/sound/ad1848.c | ad_write (devc, 15, (unsigned char) (cnt & 0xff)); |
devc | 879 | drivers/sound/ad1848.c | ad_write (devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 881 | drivers/sound/ad1848.c | ad_unmute (devc); |
devc | 883 | drivers/sound/ad1848.c | devc->xfer_count = cnt; |
devc | 884 | drivers/sound/ad1848.c | devc->irq_mode |= PCM_ENABLE_OUTPUT; |
devc | 885 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 893 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 896 | drivers/sound/ad1848.c | if (devc->audio_format == AFMT_IMA_ADPCM) |
devc | 902 | drivers/sound/ad1848.c | if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ |
devc | 905 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 909 | drivers/sound/ad1848.c | if (devc->irq_mode & PCM_ENABLE_INPUT && audio_devs[dev]->flags & DMA_AUTOMODE && |
devc | 911 | drivers/sound/ad1848.c | cnt == devc->xfer_count) |
devc | 913 | drivers/sound/ad1848.c | devc->irq_mode |= PCM_ENABLE_INPUT; |
devc | 914 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 925 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x02); /* Capture disable */ |
devc | 929 | drivers/sound/ad1848.c | if (devc->mode == MD_1848 || !devc->dual_dma) /* Single DMA channel mode */ |
devc | 931 | drivers/sound/ad1848.c | ad_write (devc, 15, (unsigned char) (cnt & 0xff)); |
devc | 932 | drivers/sound/ad1848.c | ad_write (devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 937 | drivers/sound/ad1848.c | ad_write (devc, 31, (unsigned char) (cnt & 0xff)); |
devc | 938 | drivers/sound/ad1848.c | ad_write (devc, 30, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 941 | drivers/sound/ad1848.c | ad_unmute (devc); |
devc | 943 | drivers/sound/ad1848.c | devc->xfer_count = cnt; |
devc | 944 | drivers/sound/ad1848.c | devc->irq_mode |= PCM_ENABLE_INPUT; |
devc | 945 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 955 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 957 | drivers/sound/ad1848.c | if (devc->irq_mode) |
devc | 962 | drivers/sound/ad1848.c | fs = devc->speed_bits | (devc->format_bits << 5); |
devc | 964 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 967 | drivers/sound/ad1848.c | if (devc->mode == MD_1845) /* Use alternate speed select registers */ |
devc | 971 | drivers/sound/ad1848.c | ad_write (devc, 22, (devc->speed >> 8) & 0xff); /* Speed MSB */ |
devc | 972 | drivers/sound/ad1848.c | ad_write (devc, 23, devc->speed & 0xff); /* Speed LSB */ |
devc | 975 | drivers/sound/ad1848.c | old_fs = ad_read (devc, 8); |
devc | 977 | drivers/sound/ad1848.c | if (devc->mode != MD_4232) |
devc | 981 | drivers/sound/ad1848.c | devc->xfer_count = 0; |
devc | 985 | drivers/sound/ad1848.c | ad_enter_MCE (devc); /* Enables changes to the format select reg */ |
devc | 987 | drivers/sound/ad1848.c | if (devc->mode == MD_4232) |
devc | 989 | drivers/sound/ad1848.c | tmp = ad_read (devc, 16); |
devc | 990 | drivers/sound/ad1848.c | ad_write (devc, 16, tmp | 0x30); |
devc | 993 | drivers/sound/ad1848.c | ad_write (devc, 8, fs); |
devc | 998 | drivers/sound/ad1848.c | while (timeout > 0 && inb (devc->base) == 0x80) |
devc | 1004 | drivers/sound/ad1848.c | if (devc->mode != MD_1848) |
devc | 1006 | drivers/sound/ad1848.c | ad_write (devc, 28, fs); |
devc | 1012 | drivers/sound/ad1848.c | while (timeout > 0 && inb (devc->base) == 0x80) |
devc | 1017 | drivers/sound/ad1848.c | if (devc->mode == MD_4232) |
devc | 1018 | drivers/sound/ad1848.c | ad_write (devc, 16, tmp & ~0x30); |
devc | 1020 | drivers/sound/ad1848.c | ad_leave_MCE (devc); /* |
devc | 1024 | drivers/sound/ad1848.c | devc->xfer_count = 0; |
devc | 1027 | drivers/sound/ad1848.c | if (dev == timer_installed && devc->timer_running) |
devc | 1045 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1047 | drivers/sound/ad1848.c | unsigned char bits = ad_read (devc, 9); |
devc | 1059 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1065 | drivers/sound/ad1848.c | ad_mute (devc); |
devc | 1067 | drivers/sound/ad1848.c | if (devc->mode == MD_4232) /* Use applied black magic */ |
devc | 1074 | drivers/sound/ad1848.c | if (ad_read (devc, 11) & 0x10) |
devc | 1076 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x01); /* Stop playback */ |
devc | 1082 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x02); /* Stop capture */ |
devc | 1085 | drivers/sound/ad1848.c | outb (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1086 | drivers/sound/ad1848.c | outb (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1088 | drivers/sound/ad1848.c | devc->irq_mode &= ~PCM_ENABLE_INPUT; |
devc | 1096 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1102 | drivers/sound/ad1848.c | ad_mute (devc); |
devc | 1103 | drivers/sound/ad1848.c | if (devc->mode == MD_4232) /* Use applied black magic */ |
devc | 1110 | drivers/sound/ad1848.c | if (ad_read (devc, 11) & 0x10) |
devc | 1112 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x01); /* Stop playback */ |
devc | 1118 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x01); /* Stop playback */ |
devc | 1121 | drivers/sound/ad1848.c | outb (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1122 | drivers/sound/ad1848.c | outb (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1124 | drivers/sound/ad1848.c | devc->irq_mode &= ~PCM_ENABLE_OUTPUT; |
devc | 1132 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1138 | drivers/sound/ad1848.c | state &= devc->irq_mode; |
devc | 1140 | drivers/sound/ad1848.c | tmp = ad_read (devc, 9) & ~0x03; |
devc | 1145 | drivers/sound/ad1848.c | ad_write (devc, 9, tmp); |
devc | 1155 | drivers/sound/ad1848.c | ad1848_info *devc = &dev_info[nr_ad1848_devs]; |
devc | 1175 | drivers/sound/ad1848.c | devc->base = io_base; |
devc | 1176 | drivers/sound/ad1848.c | devc->irq_ok = 0; |
devc | 1177 | drivers/sound/ad1848.c | devc->timer_running = 0; |
devc | 1178 | drivers/sound/ad1848.c | devc->MCE_bit = 0x40; |
devc | 1179 | drivers/sound/ad1848.c | devc->irq = 0; |
devc | 1180 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 1181 | drivers/sound/ad1848.c | devc->chip_name = "AD1848"; |
devc | 1182 | drivers/sound/ad1848.c | devc->mode = MD_1848; /* AD1848 or CS4248 */ |
devc | 1183 | drivers/sound/ad1848.c | devc->osp = osp; |
devc | 1184 | drivers/sound/ad1848.c | devc->debug_flag = 0; |
devc | 1197 | drivers/sound/ad1848.c | if ((inb (devc->base) & 0x80) != 0x00) /* Not a AD1848 */ |
devc | 1200 | drivers/sound/ad1848.c | inb (devc->base))); |
devc | 1206 | drivers/sound/ad1848.c | DDB (printk ("%02x ", ad_read (devc, i))); |
devc | 1216 | drivers/sound/ad1848.c | ad_write (devc, 0, 0xaa); |
devc | 1217 | drivers/sound/ad1848.c | ad_write (devc, 1, 0x45); /* 0x55 with bit 0x10 clear */ |
devc | 1219 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 0)) != 0xaa || (tmp2 = ad_read (devc, 1)) != 0x45) |
devc | 1226 | drivers/sound/ad1848.c | ad_write (devc, 0, 0x45); |
devc | 1227 | drivers/sound/ad1848.c | ad_write (devc, 1, 0xaa); |
devc | 1229 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 0)) != 0x45 || (tmp2 = ad_read (devc, 1)) != 0xaa) |
devc | 1241 | drivers/sound/ad1848.c | tmp = ad_read (devc, 12); |
devc | 1242 | drivers/sound/ad1848.c | ad_write (devc, 12, (~tmp) & 0x0f); |
devc | 1244 | drivers/sound/ad1848.c | if ((tmp & 0x0f) != ((tmp1 = ad_read (devc, 12)) & 0x0f)) |
devc | 1269 | drivers/sound/ad1848.c | ad_write (devc, 12, 0x40); /* Set mode2, clear 0x80 */ |
devc | 1271 | drivers/sound/ad1848.c | tmp1 = ad_read (devc, 12); |
devc | 1277 | drivers/sound/ad1848.c | devc->chip_name = "CS4248"; /* Our best knowledge just now */ |
devc | 1288 | drivers/sound/ad1848.c | ad_write (devc, 16, 0); /* Set I16 to known value */ |
devc | 1290 | drivers/sound/ad1848.c | ad_write (devc, 0, 0x45); |
devc | 1291 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 16)) != 0x45) /* No change -> CS4231? */ |
devc | 1294 | drivers/sound/ad1848.c | ad_write (devc, 0, 0xaa); |
devc | 1295 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 16)) == 0xaa) /* Rotten bits? */ |
devc | 1306 | drivers/sound/ad1848.c | tmp1 = ad_read (devc, 25); /* Original bits */ |
devc | 1307 | drivers/sound/ad1848.c | ad_write (devc, 25, ~tmp1); /* Invert all bits */ |
devc | 1308 | drivers/sound/ad1848.c | if ((ad_read (devc, 25) & 0xe7) == (tmp1 & 0xe7)) |
devc | 1315 | drivers/sound/ad1848.c | devc->chip_name = "CS4231"; |
devc | 1317 | drivers/sound/ad1848.c | devc->mode = MD_4231; |
devc | 1326 | drivers/sound/ad1848.c | id = ad_read (devc, 25) & 0xe7; |
devc | 1332 | drivers/sound/ad1848.c | devc->chip_name = "CS4231A"; |
devc | 1333 | drivers/sound/ad1848.c | devc->mode = MD_4231A; |
devc | 1337 | drivers/sound/ad1848.c | devc->chip_name = "CS4232"; |
devc | 1338 | drivers/sound/ad1848.c | devc->mode = MD_4232; |
devc | 1342 | drivers/sound/ad1848.c | devc->chip_name = "CS4232A"; |
devc | 1343 | drivers/sound/ad1848.c | devc->mode = MD_4232; |
devc | 1355 | drivers/sound/ad1848.c | unsigned char tmp = ad_read (devc, 23); |
devc | 1357 | drivers/sound/ad1848.c | ad_write (devc, 23, ~tmp); |
devc | 1358 | drivers/sound/ad1848.c | if (ad_read (devc, 23) != tmp) /* AD1845 ? */ |
devc | 1360 | drivers/sound/ad1848.c | devc->chip_name = "AD1845"; |
devc | 1361 | drivers/sound/ad1848.c | devc->mode = MD_1845; |
devc | 1364 | drivers/sound/ad1848.c | ad_write (devc, 23, tmp); /* Restore */ |
devc | 1369 | drivers/sound/ad1848.c | devc->mode = MD_4231; |
devc | 1373 | drivers/sound/ad1848.c | ad_write (devc, 25, tmp1); /* Restore bits */ |
devc | 1382 | drivers/sound/ad1848.c | if (devc->mode != MD_1848) |
devc | 1413 | drivers/sound/ad1848.c | ad1848_info *devc = &dev_info[nr_ad1848_devs]; |
devc | 1418 | drivers/sound/ad1848.c | request_region (devc->base, 4, devc->chip_name); |
devc | 1420 | drivers/sound/ad1848.c | devc->irq = (irq > 0) ? irq : 0; |
devc | 1421 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 1422 | drivers/sound/ad1848.c | devc->timer_ticks = 0; |
devc | 1423 | drivers/sound/ad1848.c | devc->osp = osp; |
devc | 1433 | drivers/sound/ad1848.c | ad_write (devc, i, init_values[i]); |
devc | 1435 | drivers/sound/ad1848.c | ad_mute (devc); /* Initialize some variables */ |
devc | 1436 | drivers/sound/ad1848.c | ad_unmute (devc); /* Leave it unmuted now */ |
devc | 1438 | drivers/sound/ad1848.c | if (devc->mode > MD_1848) |
devc | 1442 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) | 0x04); /* Single DMA mode */ |
devc | 1447 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x04); /* Dual DMA mode */ |
devc | 1451 | drivers/sound/ad1848.c | ad_write (devc, 12, ad_read (devc, 12) | 0x40); /* Mode2 = enabled */ |
devc | 1453 | drivers/sound/ad1848.c | ad_write (devc, i, init_values[i]); |
devc | 1456 | drivers/sound/ad1848.c | if (devc->mode == MD_1845) |
devc | 1457 | drivers/sound/ad1848.c | ad_write (devc, 27, ad_read (devc, 27) | 0x08); /* Alternate freq select enabled */ |
devc | 1462 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) | 0x04); /* Single DMA mode */ |
devc | 1465 | drivers/sound/ad1848.c | outb (0, io_Status (devc)); /* Clear pending interrupts */ |
devc | 1469 | drivers/sound/ad1848.c | "%s (%s)", name, devc->chip_name); |
devc | 1472 | drivers/sound/ad1848.c | "Generic audio codec (%s)", devc->chip_name); |
devc | 1475 | drivers/sound/ad1848.c | devc->base, devc->irq, dma_playback, dma_capture); |
devc | 1482 | drivers/sound/ad1848.c | audio_devs[my_dev]->devc = devc; |
devc | 1483 | drivers/sound/ad1848.c | irq2dev[irq] = devc->dev_no = my_dev; |
devc | 1484 | drivers/sound/ad1848.c | if (snd_set_irq_handler (devc->irq, ad1848_interrupt, |
devc | 1486 | drivers/sound/ad1848.c | devc->osp) < 0) |
devc | 1492 | drivers/sound/ad1848.c | if (devc->mode != MD_1848) |
devc | 1495 | drivers/sound/ad1848.c | unsigned char tmp = ad_read (devc, 16); |
devc | 1497 | drivers/sound/ad1848.c | devc->timer_ticks = 0; |
devc | 1499 | drivers/sound/ad1848.c | ad_write (devc, 21, 0x00); /* Timer msb */ |
devc | 1500 | drivers/sound/ad1848.c | ad_write (devc, 20, 0x10); /* Timer lsb */ |
devc | 1502 | drivers/sound/ad1848.c | ad_write (devc, 16, tmp | 0x40); /* Enable timer */ |
devc | 1503 | drivers/sound/ad1848.c | for (x = 0; x < 100000 && devc->timer_ticks == 0; x++); |
devc | 1504 | drivers/sound/ad1848.c | ad_write (devc, 16, tmp & ~0x40); /* Disable timer */ |
devc | 1506 | drivers/sound/ad1848.c | if (devc->timer_ticks == 0) |
devc | 1509 | drivers/sound/ad1848.c | devc->irq_ok = 1; |
devc | 1513 | drivers/sound/ad1848.c | devc->irq_ok = 1; /* Couldn't test. assume it's OK */ |
devc | 1515 | drivers/sound/ad1848.c | devc->irq_ok = 1; |
devc | 1519 | drivers/sound/ad1848.c | irq2dev[-irq] = devc->dev_no = my_dev; |
devc | 1524 | drivers/sound/ad1848.c | audio_devs[my_dev]->devc = devc; |
devc | 1525 | drivers/sound/ad1848.c | audio_devs[my_dev]->format_mask = ad_format_mask[devc->mode]; |
devc | 1529 | drivers/sound/ad1848.c | if (devc->mode != MD_1848 && devc->mode != MD_1845 && devc->irq_ok) |
devc | 1547 | drivers/sound/ad1848.c | ad_enter_MCE (devc); /* In case the bit was off */ |
devc | 1548 | drivers/sound/ad1848.c | ad_leave_MCE (devc); |
devc | 1555 | drivers/sound/ad1848.c | ad1848_mixer_reset (devc); |
devc | 1566 | drivers/sound/ad1848.c | ad1848_info *devc = NULL; |
devc | 1568 | drivers/sound/ad1848.c | for (i = 0; devc == NULL && i < nr_ad1848_devs; i++) |
devc | 1571 | drivers/sound/ad1848.c | devc = &dev_info[i]; |
devc | 1572 | drivers/sound/ad1848.c | dev = devc->dev_no; |
devc | 1575 | drivers/sound/ad1848.c | if (devc != NULL) |
devc | 1577 | drivers/sound/ad1848.c | release_region (devc->base, 4); |
devc | 1582 | drivers/sound/ad1848.c | snd_release_irq (devc->irq); |
devc | 1599 | drivers/sound/ad1848.c | ad1848_info *devc; |
devc | 1623 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1626 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1628 | drivers/sound/ad1848.c | status = inb (io_Status (devc)); |
devc | 1636 | drivers/sound/ad1848.c | if (devc->mode != MD_1848) |
devc | 1637 | drivers/sound/ad1848.c | alt_stat = ad_read (devc, 24); |
devc | 1639 | drivers/sound/ad1848.c | if (devc->opened && devc->irq_mode & PCM_ENABLE_INPUT && alt_stat & 0x20) |
devc | 1644 | drivers/sound/ad1848.c | if (devc->opened && devc->irq_mode & PCM_ENABLE_OUTPUT && |
devc | 1650 | drivers/sound/ad1848.c | if (devc->mode != MD_1848 && alt_stat & 0x40) /* Timer interrupt */ |
devc | 1652 | drivers/sound/ad1848.c | devc->timer_ticks++; |
devc | 1654 | drivers/sound/ad1848.c | if (timer_installed == dev && devc->timer_running) |
devc | 1660 | drivers/sound/ad1848.c | if (devc->mode != MD_1848) |
devc | 1661 | drivers/sound/ad1848.c | ad_write (devc, 24, ad_read (devc, 24) & ~alt_stat); /* Selective ack */ |
devc | 1663 | drivers/sound/ad1848.c | outb (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1873 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1891 | drivers/sound/ad1848.c | if (devc->mode == MD_1845) |
devc | 1893 | drivers/sound/ad1848.c | else if (ad_read (devc, 8) & 0x01) |
devc | 1906 | drivers/sound/ad1848.c | ad_write (devc, 21, (divider >> 8) & 0xff); /* Set upper bits */ |
devc | 1907 | drivers/sound/ad1848.c | ad_write (devc, 20, divider & 0xff); /* Set lower bits */ |
devc | 1908 | drivers/sound/ad1848.c | ad_write (devc, 16, ad_read (devc, 16) | 0x40); /* Start the timer */ |
devc | 1909 | drivers/sound/ad1848.c | devc->timer_running = 1; |
devc | 1931 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1935 | drivers/sound/ad1848.c | ad_write (devc, 16, ad_read (devc, 16) & ~0x40); |
devc | 1936 | drivers/sound/ad1848.c | devc->timer_running = 0; |
devc | 1944 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1951 | drivers/sound/ad1848.c | ad_write (devc, 16, ad_read (devc, 16) | 0x40); |
devc | 1952 | drivers/sound/ad1848.c | devc->timer_running = 1; |
devc | 99 | drivers/sound/audio.c | open (audio_devs[dev]->coproc->devc, COPR_PCM)) < 0) |
devc | 172 | drivers/sound/audio.c | audio_devs[dev]->coproc->close (audio_devs[dev]->coproc->devc, COPR_PCM); |
devc | 365 | drivers/sound/audio.c | return audio_devs[dev]->coproc->ioctl (audio_devs[dev]->coproc->devc, cmd, arg, 0); |
devc | 138 | drivers/sound/dev_table.h | int (*open) (void *devc, int sub_device); |
devc | 139 | drivers/sound/dev_table.h | void (*close) (void *devc, int sub_device); |
devc | 140 | drivers/sound/dev_table.h | int (*ioctl) (void *devc, unsigned int cmd, caddr_t arg, int local); |
devc | 141 | drivers/sound/dev_table.h | void (*reset) (void *devc); |
devc | 143 | drivers/sound/dev_table.h | void *devc; /* Driver specific info */ |
devc | 155 | drivers/sound/dev_table.h | void *devc; /* Driver specific info */ |
devc | 481 | drivers/sound/midibuf.c | return midi_devs[dev]->coproc->ioctl (midi_devs[dev]->coproc->devc, cmd, arg, 0); |
devc | 92 | drivers/sound/mpu401.c | mpu401_status (struct mpu_config *devc) |
devc | 94 | drivers/sound/mpu401.c | return inb (STATPORT (devc->base)); |
devc | 96 | drivers/sound/mpu401.c | #define input_avail(devc) (!(mpu401_status(devc)&INPUT_AVAIL)) |
devc | 97 | drivers/sound/mpu401.c | #define output_ready(devc) (!(mpu401_status(devc)&OUTPUT_READY)) |
devc | 99 | drivers/sound/mpu401.c | write_command (struct mpu_config *devc, unsigned char cmd) |
devc | 101 | drivers/sound/mpu401.c | outb (cmd, COMDPORT (devc->base)); |
devc | 104 | drivers/sound/mpu401.c | read_data (struct mpu_config *devc) |
devc | 106 | drivers/sound/mpu401.c | return inb (DATAPORT (devc->base)); |
devc | 110 | drivers/sound/mpu401.c | write_data (struct mpu_config *devc, unsigned char byte) |
devc | 112 | drivers/sound/mpu401.c | outb (byte, DATAPORT (devc->base)); |
devc | 130 | drivers/sound/mpu401.c | static int reset_mpu401 (struct mpu_config *devc); |
devc | 131 | drivers/sound/mpu401.c | static void set_uart_mode (int dev, struct mpu_config *devc, int arg); |
devc | 135 | drivers/sound/mpu401.c | static void timer_ext_event (struct mpu_config *devc, int event, int parm); |
devc | 186 | drivers/sound/mpu401.c | mpu_input_scanner (struct mpu_config *devc, unsigned char midic) |
devc | 189 | drivers/sound/mpu401.c | switch (devc->m_state) |
devc | 203 | drivers/sound/mpu401.c | if (devc->timer_flag) |
devc | 227 | drivers/sound/mpu401.c | devc->m_state = ST_SYSMSG; |
devc | 234 | drivers/sound/mpu401.c | devc->m_state = ST_TIMED; |
devc | 245 | drivers/sound/mpu401.c | devc->m_state = ST_DATABYTE; |
devc | 250 | drivers/sound/mpu401.c | msg = ((int) (devc->last_status & 0xf0) >> 4); |
devc | 252 | drivers/sound/mpu401.c | devc->m_left = len_tab[msg] - 1; |
devc | 254 | drivers/sound/mpu401.c | devc->m_ptr = 2; |
devc | 255 | drivers/sound/mpu401.c | devc->m_buf[0] = devc->last_status; |
devc | 256 | drivers/sound/mpu401.c | devc->m_buf[1] = midic; |
devc | 258 | drivers/sound/mpu401.c | if (devc->m_left <= 0) |
devc | 260 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 261 | drivers/sound/mpu401.c | do_midi_msg (devc->synthno, devc->m_buf, devc->m_ptr); |
devc | 262 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 267 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 289 | drivers/sound/mpu401.c | devc->last_status = midic; |
devc | 292 | drivers/sound/mpu401.c | devc->m_left = len_tab[msg]; |
devc | 294 | drivers/sound/mpu401.c | devc->m_ptr = 1; |
devc | 295 | drivers/sound/mpu401.c | devc->m_buf[0] = midic; |
devc | 297 | drivers/sound/mpu401.c | if (devc->m_left <= 0) |
devc | 299 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 300 | drivers/sound/mpu401.c | do_midi_msg (devc->synthno, devc->m_buf, devc->m_ptr); |
devc | 301 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 312 | drivers/sound/mpu401.c | devc->m_state = ST_SYSEX; |
devc | 316 | drivers/sound/mpu401.c | devc->m_state = ST_MTC; |
devc | 320 | drivers/sound/mpu401.c | devc->m_state = ST_SONGPOS; |
devc | 321 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 325 | drivers/sound/mpu401.c | devc->m_state = ST_SONGSEL; |
devc | 330 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 337 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 338 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_CLOCK, 0); |
devc | 342 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 343 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_START, 0); |
devc | 347 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 348 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_CONTINUE, 0); |
devc | 352 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 353 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_STOP, 0); |
devc | 358 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 363 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 368 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 373 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 381 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 388 | drivers/sound/mpu401.c | BUFTEST (devc); |
devc | 389 | drivers/sound/mpu401.c | devc->m_buf[devc->m_ptr++] = midic; |
devc | 390 | drivers/sound/mpu401.c | if (devc->m_ptr == 2) |
devc | 392 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 393 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 394 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_SPP, |
devc | 395 | drivers/sound/mpu401.c | ((devc->m_buf[1] & 0x7f) << 7) | |
devc | 396 | drivers/sound/mpu401.c | (devc->m_buf[0] & 0x7f)); |
devc | 401 | drivers/sound/mpu401.c | BUFTEST (devc); |
devc | 402 | drivers/sound/mpu401.c | devc->m_buf[devc->m_ptr++] = midic; |
devc | 403 | drivers/sound/mpu401.c | if ((--devc->m_left) <= 0) |
devc | 405 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 406 | drivers/sound/mpu401.c | do_midi_msg (devc->synthno, devc->m_buf, devc->m_ptr); |
devc | 407 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 412 | drivers/sound/mpu401.c | printk ("Bad state %d ", devc->m_state); |
devc | 413 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 420 | drivers/sound/mpu401.c | mpu401_input_loop (struct mpu_config *devc) |
devc | 428 | drivers/sound/mpu401.c | busy = devc->m_busy; |
devc | 429 | drivers/sound/mpu401.c | devc->m_busy = 1; |
devc | 437 | drivers/sound/mpu401.c | while (input_avail (devc) && n-- > 0) |
devc | 439 | drivers/sound/mpu401.c | unsigned char c = read_data (devc); |
devc | 441 | drivers/sound/mpu401.c | if (devc->mode == MODE_SYNTH) |
devc | 443 | drivers/sound/mpu401.c | mpu_input_scanner (devc, c); |
devc | 445 | drivers/sound/mpu401.c | else if (devc->opened & OPEN_READ && devc->inputintr != NULL) |
devc | 446 | drivers/sound/mpu401.c | devc->inputintr (devc->devno, c); |
devc | 449 | drivers/sound/mpu401.c | devc->m_busy = 0; |
devc | 455 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 485 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 488 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 490 | drivers/sound/mpu401.c | if (input_avail (devc)) |
devc | 491 | drivers/sound/mpu401.c | if (devc->base != 0 && (devc->opened & OPEN_READ || devc->mode == MODE_SYNTH)) |
devc | 492 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 496 | drivers/sound/mpu401.c | read_data (devc); |
devc | 508 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 513 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 515 | drivers/sound/mpu401.c | if (devc->opened) |
devc | 528 | drivers/sound/mpu401.c | if (!devc->initialized) |
devc | 530 | drivers/sound/mpu401.c | if (mpu401_status (devc) == 0xff) /* Bus float */ |
devc | 535 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 538 | drivers/sound/mpu401.c | irq2dev[devc->irq] = dev; |
devc | 542 | drivers/sound/mpu401.c | open (midi_devs[dev]->coproc->devc, COPR_MIDI)) < 0) |
devc | 549 | drivers/sound/mpu401.c | set_uart_mode (dev, devc, 1); |
devc | 550 | drivers/sound/mpu401.c | devc->mode = MODE_MIDI; |
devc | 551 | drivers/sound/mpu401.c | devc->synthno = 0; |
devc | 553 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 555 | drivers/sound/mpu401.c | devc->inputintr = input; |
devc | 556 | drivers/sound/mpu401.c | devc->opened = mode; |
devc | 564 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 566 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 568 | drivers/sound/mpu401.c | if (devc->uart_mode) |
devc | 569 | drivers/sound/mpu401.c | reset_mpu401 (devc); /* |
devc | 572 | drivers/sound/mpu401.c | devc->mode = 0; |
devc | 574 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 577 | drivers/sound/mpu401.c | midi_devs[dev]->coproc->close (midi_devs[dev]->coproc->devc, COPR_MIDI); |
devc | 578 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 587 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 589 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 596 | drivers/sound/mpu401.c | for (timeout = 30000; timeout > 0 && !output_ready (devc); timeout--); |
devc | 600 | drivers/sound/mpu401.c | if (!output_ready (devc)) |
devc | 607 | drivers/sound/mpu401.c | write_data (devc, midi_byte); |
devc | 618 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 620 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 622 | drivers/sound/mpu401.c | if (devc->uart_mode) /* |
devc | 633 | drivers/sound/mpu401.c | if (input_avail (devc)) |
devc | 634 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 652 | drivers/sound/mpu401.c | if (!output_ready (devc)) |
devc | 658 | drivers/sound/mpu401.c | write_command (devc, cmd->cmd); |
devc | 662 | drivers/sound/mpu401.c | if (input_avail (devc)) |
devc | 664 | drivers/sound/mpu401.c | if (devc->opened && devc->mode == MODE_SYNTH) |
devc | 666 | drivers/sound/mpu401.c | if (mpu_input_scanner (devc, read_data (devc)) == MPU_ACK) |
devc | 671 | drivers/sound/mpu401.c | if (read_data (devc) == MPU_ACK) |
devc | 686 | drivers/sound/mpu401.c | for (timeout = 3000; timeout > 0 && !output_ready (devc); timeout--); |
devc | 704 | drivers/sound/mpu401.c | if (input_avail (devc)) |
devc | 706 | drivers/sound/mpu401.c | cmd->data[i] = read_data (devc); |
devc | 745 | drivers/sound/mpu401.c | struct mpu_config *devc = &dev_conf[dev]; |
devc | 747 | drivers/sound/mpu401.c | if (devc->uart_mode) |
devc | 792 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 794 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 804 | drivers/sound/mpu401.c | if (!(devc->capabilities & MPU_CAP_INTLG)) /* No intelligent mode */ |
devc | 809 | drivers/sound/mpu401.c | set_uart_mode (dev, devc, !get_fs_long ((long *) arg)); |
devc | 851 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 858 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 882 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 891 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 900 | drivers/sound/mpu401.c | if (!devc->initialized) |
devc | 902 | drivers/sound/mpu401.c | if (mpu401_status (devc) == 0xff) /* Bus float */ |
devc | 907 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 910 | drivers/sound/mpu401.c | if (devc->opened) |
devc | 916 | drivers/sound/mpu401.c | devc->mode = MODE_SYNTH; |
devc | 917 | drivers/sound/mpu401.c | devc->synthno = dev; |
devc | 919 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 920 | drivers/sound/mpu401.c | irq2dev[devc->irq] = midi_dev; |
devc | 924 | drivers/sound/mpu401.c | open (midi_devs[midi_dev]->coproc->devc, COPR_MIDI)) < 0) |
devc | 931 | drivers/sound/mpu401.c | devc->opened = mode; |
devc | 932 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 948 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 952 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 956 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 959 | drivers/sound/mpu401.c | midi_devs[midi_dev]->coproc->close (midi_devs[midi_dev]->coproc->devc, COPR_MIDI); |
devc | 960 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 961 | drivers/sound/mpu401.c | devc->mode = 0; |
devc | 1016 | drivers/sound/mpu401.c | mpu401_chk_version (struct mpu_config *devc) |
devc | 1021 | drivers/sound/mpu401.c | devc->version = devc->revision = 0; |
devc | 1037 | drivers/sound/mpu401.c | devc->version = tmp; |
devc | 1041 | drivers/sound/mpu401.c | devc->version = 0; |
devc | 1045 | drivers/sound/mpu401.c | devc->revision = tmp; |
devc | 1056 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 1064 | drivers/sound/mpu401.c | devc = &dev_conf[num_midis]; |
devc | 1066 | drivers/sound/mpu401.c | devc->base = hw_config->io_base; |
devc | 1067 | drivers/sound/mpu401.c | devc->osp = hw_config->osp; |
devc | 1068 | drivers/sound/mpu401.c | devc->irq = hw_config->irq; |
devc | 1069 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 1070 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1071 | drivers/sound/mpu401.c | devc->initialized = 0; |
devc | 1072 | drivers/sound/mpu401.c | devc->version = 0; |
devc | 1073 | drivers/sound/mpu401.c | devc->revision = 0; |
devc | 1074 | drivers/sound/mpu401.c | devc->capabilities = 0; |
devc | 1075 | drivers/sound/mpu401.c | devc->timer_flag = 0; |
devc | 1076 | drivers/sound/mpu401.c | devc->m_busy = 0; |
devc | 1077 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 1078 | drivers/sound/mpu401.c | devc->shared_irq = hw_config->always_detect; |
devc | 1079 | drivers/sound/mpu401.c | devc->irq = hw_config->irq; |
devc | 1081 | drivers/sound/mpu401.c | if (devc->irq < 0) |
devc | 1083 | drivers/sound/mpu401.c | devc->irq *= -1; |
devc | 1084 | drivers/sound/mpu401.c | devc->shared_irq = 1; |
devc | 1086 | drivers/sound/mpu401.c | irq2dev[devc->irq] = num_midis; |
devc | 1091 | drivers/sound/mpu401.c | if (!reset_mpu401 (devc)) |
devc | 1097 | drivers/sound/mpu401.c | if (!devc->shared_irq) |
devc | 1098 | drivers/sound/mpu401.c | if (snd_set_irq_handler (devc->irq, mpuintr, "mpu401", devc->osp) < 0) |
devc | 1100 | drivers/sound/mpu401.c | printk ("MPU401: Failed to allocate IRQ%d\n", devc->irq); |
devc | 1106 | drivers/sound/mpu401.c | mpu401_chk_version (devc); |
devc | 1107 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 1108 | drivers/sound/mpu401.c | mpu401_chk_version (devc); |
devc | 1114 | drivers/sound/mpu401.c | if (devc->version != 0) |
devc | 1117 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_INTLG; /* Supports intelligent mode */ |
devc | 1131 | drivers/sound/mpu401.c | if (!(devc->capabilities & MPU_CAP_INTLG)) /* No intelligent mode */ |
devc | 1157 | drivers/sound/mpu401.c | if (devc->version == 0x20 && devc->revision >= 0x07) /* MusicQuest interface */ |
devc | 1159 | drivers/sound/mpu401.c | int ports = (devc->revision & 0x08) ? 32 : 16; |
devc | 1161 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_SMPTE | |
devc | 1164 | drivers/sound/mpu401.c | revision_char = (devc->revision == 0x7f) ? 'M' : ' '; |
devc | 1174 | drivers/sound/mpu401.c | revision_char = devc->revision ? devc->revision + '@' : ' '; |
devc | 1175 | drivers/sound/mpu401.c | if ((int) devc->revision > ('Z' - '@')) |
devc | 1178 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_FSK; |
devc | 1182 | drivers/sound/mpu401.c | (int) (devc->version & 0xf0) >> 4, |
devc | 1183 | drivers/sound/mpu401.c | devc->version & 0x0f, |
devc | 1193 | drivers/sound/mpu401.c | mpu401_synth_operations[num_midis]->midi_dev = devc->devno = num_midis; |
devc | 1194 | drivers/sound/mpu401.c | mpu401_synth_operations[devc->devno]->info = |
devc | 1195 | drivers/sound/mpu401.c | &mpu_synth_info[devc->devno]; |
devc | 1197 | drivers/sound/mpu401.c | if (devc->capabilities & MPU_CAP_INTLG) /* Intelligent mode */ |
devc | 1200 | drivers/sound/mpu401.c | irq2dev[devc->irq] = num_midis; |
devc | 1201 | drivers/sound/mpu401.c | midi_devs[num_midis++] = &mpu401_midi_operations[devc->devno]; |
devc | 1206 | drivers/sound/mpu401.c | reset_mpu401 (struct mpu_config *devc) |
devc | 1219 | drivers/sound/mpu401.c | timeout_limit = devc->initialized ? 30000 : 100000; |
devc | 1220 | drivers/sound/mpu401.c | devc->initialized = 1; |
devc | 1225 | drivers/sound/mpu401.c | ok = output_ready (devc); |
devc | 1227 | drivers/sound/mpu401.c | write_command (devc, MPU_RESET); /* |
devc | 1240 | drivers/sound/mpu401.c | if (input_avail (devc)) |
devc | 1241 | drivers/sound/mpu401.c | if (read_data (devc) == MPU_ACK) |
devc | 1248 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 1249 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 1250 | drivers/sound/mpu401.c | devc->m_left = 0; |
devc | 1251 | drivers/sound/mpu401.c | devc->last_status = 0; |
devc | 1252 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1258 | drivers/sound/mpu401.c | set_uart_mode (int dev, struct mpu_config *devc, int arg) |
devc | 1260 | drivers/sound/mpu401.c | if (!arg && (devc->capabilities & MPU_CAP_INTLG)) |
devc | 1265 | drivers/sound/mpu401.c | if ((devc->uart_mode == 0) == (arg == 0)) |
devc | 1270 | drivers/sound/mpu401.c | reset_mpu401 (devc); /* This exits the uart mode */ |
devc | 1276 | drivers/sound/mpu401.c | printk ("MPU%d: Can't enter UART mode\n", devc->devno); |
devc | 1277 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1281 | drivers/sound/mpu401.c | devc->uart_mode = arg; |
devc | 1744 | drivers/sound/mpu401.c | timer_ext_event (struct mpu_config *devc, int event, int parm) |
devc | 1746 | drivers/sound/mpu401.c | int midi_dev = devc->devno; |
devc | 1748 | drivers/sound/mpu401.c | if (!devc->timer_flag) |
devc | 1802 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 1805 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 1821 | drivers/sound/mpu401.c | if (devc->version < 0x20) /* Original MPU-401 */ |
devc | 1833 | drivers/sound/mpu401.c | if (devc->revision) |
devc | 1836 | drivers/sound/mpu401.c | if (devc->revision & 0x02) |
devc | 1840 | drivers/sound/mpu401.c | if (devc->revision & 0x40) |
devc | 83 | drivers/sound/opl3.c | static struct opl_devinfo *devc = NULL; |
devc | 107 | drivers/sound/opl3.c | devc->cmask = 0x3f; /* Connect all possible 4 OP voice operators */ |
devc | 108 | drivers/sound/opl3.c | opl3_command (devc->right_io, CONNECTION_SELECT_REGISTER, 0x3f); |
devc | 121 | drivers/sound/opl3.c | devc->lv_map[i] = v4op[i]; |
devc | 122 | drivers/sound/opl3.c | devc->v_alloc->max_voice = devc->nr_voice = 12; |
devc | 150 | drivers/sound/opl3.c | devc->fm_info.nr_voices = (devc->nr_voice == 12) ? 6 : devc->nr_voice; |
devc | 152 | drivers/sound/opl3.c | memcpy_tofs ((&((char *) arg)[0]), &devc->fm_info, sizeof (devc->fm_info)); |
devc | 161 | drivers/sound/opl3.c | if (devc->model == 2) |
devc | 189 | drivers/sound/opl3.c | if (devc != NULL) |
devc | 193 | drivers/sound/opl3.c | devc = (struct opl_devinfo *) (sound_mem_blocks[sound_num_blocks] = kmalloc (sizeof (*devc), GFP_KERNEL)); |
devc | 197 | drivers/sound/opl3.c | if (devc == NULL) |
devc | 203 | drivers/sound/opl3.c | devc->osp = osp; |
devc | 232 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 287 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 289 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 296 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 298 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 326 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 329 | drivers/sound/opl3.c | devc->v_alloc->map[voice] = 0; |
devc | 331 | drivers/sound/opl3.c | map = &pv_map[devc->lv_map[voice]]; |
devc | 338 | drivers/sound/opl3.c | opl3_command (map->ioaddr, KEYON_BLOCK + map->voice_num, devc->voc[voice].keyon_byte & ~0x20); |
devc | 340 | drivers/sound/opl3.c | devc->voc[voice].keyon_byte = 0; |
devc | 341 | drivers/sound/opl3.c | devc->voc[voice].bender = 0; |
devc | 342 | drivers/sound/opl3.c | devc->voc[voice].volume = 64; |
devc | 343 | drivers/sound/opl3.c | devc->voc[voice].bender_range = 200; /* |
devc | 346 | drivers/sound/opl3.c | devc->voc[voice].orig_freq = 0; |
devc | 347 | drivers/sound/opl3.c | devc->voc[voice].current_freq = 0; |
devc | 348 | drivers/sound/opl3.c | devc->voc[voice].mode = 0; |
devc | 365 | drivers/sound/opl3.c | if (instr->key != FM_PATCH && (instr->key != OPL3_PATCH || devc->model != 2)) |
devc | 367 | drivers/sound/opl3.c | memcpy ((char *) &(devc->i_map[instr_no]), (char *) instr, sizeof (*instr)); |
devc | 375 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 381 | drivers/sound/opl3.c | devc->act_i[voice] = &devc->i_map[instr_no]; |
devc | 440 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 443 | drivers/sound/opl3.c | map = &pv_map[devc->lv_map[voice]]; |
devc | 445 | drivers/sound/opl3.c | instr = devc->act_i[voice]; |
devc | 448 | drivers/sound/opl3.c | instr = &devc->i_map[0]; |
devc | 453 | drivers/sound/opl3.c | if (devc->voc[voice].mode == 0) |
devc | 456 | drivers/sound/opl3.c | if (devc->voc[voice].mode == 2) |
devc | 533 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 536 | drivers/sound/opl3.c | map = &pv_map[devc->lv_map[voice]]; |
devc | 545 | drivers/sound/opl3.c | set_voice_volume (voice, volume, devc->voc[voice].volume); |
devc | 573 | drivers/sound/opl3.c | instr = devc->act_i[voice]; |
devc | 576 | drivers/sound/opl3.c | instr = &devc->i_map[0]; |
devc | 597 | drivers/sound/opl3.c | voice_shift = (map->ioaddr == devc->left_io) ? 0 : 3; |
devc | 605 | drivers/sound/opl3.c | devc->cmask &= ~(1 << voice_shift); |
devc | 609 | drivers/sound/opl3.c | devc->cmask |= (1 << voice_shift); |
devc | 612 | drivers/sound/opl3.c | opl3_command (devc->right_io, CONNECTION_SELECT_REGISTER, devc->cmask); |
devc | 692 | drivers/sound/opl3.c | devc->voc[voice].mode = voice_mode; |
devc | 694 | drivers/sound/opl3.c | set_voice_volume (voice, volume, devc->voc[voice].volume); |
devc | 696 | drivers/sound/opl3.c | freq = devc->voc[voice].orig_freq = note_to_freq (note) / 1000; |
devc | 703 | drivers/sound/opl3.c | freq = compute_finetune (devc->voc[voice].orig_freq, devc->voc[voice].bender, devc->voc[voice].bender_range); |
devc | 704 | drivers/sound/opl3.c | devc->voc[voice].current_freq = freq; |
devc | 718 | drivers/sound/opl3.c | devc->voc[voice].keyon_byte = data; |
devc | 780 | drivers/sound/opl3.c | if (!devc->model != 2) |
devc | 781 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 788 | drivers/sound/opl3.c | if (devc->model != 2) |
devc | 790 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 791 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 792 | drivers/sound/opl3.c | tenmicrosec (devc->osp); |
devc | 805 | drivers/sound/opl3.c | devc->lv_map[i] = i; |
devc | 807 | drivers/sound/opl3.c | for (i = 0; i < devc->nr_voice; i++) |
devc | 809 | drivers/sound/opl3.c | opl3_command (pv_map[devc->lv_map[i]].ioaddr, |
devc | 810 | drivers/sound/opl3.c | KSL_LEVEL + pv_map[devc->lv_map[i]].op[0], 0xff); |
devc | 812 | drivers/sound/opl3.c | opl3_command (pv_map[devc->lv_map[i]].ioaddr, |
devc | 813 | drivers/sound/opl3.c | KSL_LEVEL + pv_map[devc->lv_map[i]].op[1], 0xff); |
devc | 815 | drivers/sound/opl3.c | if (pv_map[devc->lv_map[i]].voice_mode == 4) |
devc | 817 | drivers/sound/opl3.c | opl3_command (pv_map[devc->lv_map[i]].ioaddr, |
devc | 818 | drivers/sound/opl3.c | KSL_LEVEL + pv_map[devc->lv_map[i]].op[2], 0xff); |
devc | 820 | drivers/sound/opl3.c | opl3_command (pv_map[devc->lv_map[i]].ioaddr, |
devc | 821 | drivers/sound/opl3.c | KSL_LEVEL + pv_map[devc->lv_map[i]].op[3], 0xff); |
devc | 827 | drivers/sound/opl3.c | if (devc->model == 2) |
devc | 829 | drivers/sound/opl3.c | devc->v_alloc->max_voice = devc->nr_voice = 18; |
devc | 843 | drivers/sound/opl3.c | if (devc->busy) |
devc | 845 | drivers/sound/opl3.c | devc->busy = 1; |
devc | 847 | drivers/sound/opl3.c | devc->v_alloc->max_voice = devc->nr_voice = (devc->model == 2) ? 18 : 9; |
devc | 848 | drivers/sound/opl3.c | devc->v_alloc->timestamp = 0; |
devc | 852 | drivers/sound/opl3.c | devc->v_alloc->map[i] = 0; |
devc | 853 | drivers/sound/opl3.c | devc->v_alloc->alloc_times[i] = 0; |
devc | 856 | drivers/sound/opl3.c | devc->cmask = 0x00; /* |
devc | 859 | drivers/sound/opl3.c | if (devc->model == 2) |
devc | 860 | drivers/sound/opl3.c | opl3_command (devc->right_io, CONNECTION_SELECT_REGISTER, devc->cmask); |
devc | 867 | drivers/sound/opl3.c | devc->busy = 0; |
devc | 868 | drivers/sound/opl3.c | devc->v_alloc->max_voice = devc->nr_voice = (devc->model == 2) ? 18 : 9; |
devc | 870 | drivers/sound/opl3.c | devc->fm_info.nr_drums = 0; |
devc | 871 | drivers/sound/opl3.c | devc->fm_info.perc_mode = 0; |
devc | 928 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 931 | drivers/sound/opl3.c | map = &pv_map[devc->lv_map[voice]]; |
devc | 942 | drivers/sound/opl3.c | instr = devc->act_i[voice]; |
devc | 945 | drivers/sound/opl3.c | instr = &devc->i_map[0]; |
devc | 947 | drivers/sound/opl3.c | if (devc->voc[voice].mode == 4) |
devc | 998 | drivers/sound/opl3.c | map = &pv_map[devc->lv_map[voice]]; |
devc | 1003 | drivers/sound/opl3.c | devc->voc[voice].bender = value; |
devc | 1006 | drivers/sound/opl3.c | if (!(devc->voc[voice].keyon_byte & 0x20)) |
devc | 1011 | drivers/sound/opl3.c | freq = compute_finetune (devc->voc[voice].orig_freq, devc->voc[voice].bender, devc->voc[voice].bender_range); |
devc | 1012 | drivers/sound/opl3.c | devc->voc[voice].current_freq = freq; |
devc | 1029 | drivers/sound/opl3.c | devc->voc[voice].keyon_byte = data; |
devc | 1036 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 1046 | drivers/sound/opl3.c | devc->voc[voice].bender_range = value; |
devc | 1050 | drivers/sound/opl3.c | devc->voc[voice].volume = value / 128; |
devc | 1064 | drivers/sound/opl3.c | if (voice < 0 || voice >= devc->nr_voice) |
devc | 1081 | drivers/sound/opl3.c | instr_no = devc->chn_info[chn].pgm_num; |
devc | 1083 | drivers/sound/opl3.c | instr = &devc->i_map[instr_no]; |
devc | 1085 | drivers/sound/opl3.c | devc->nr_voice != 12) /* Not in 4 OP mode */ |
devc | 1087 | drivers/sound/opl3.c | else if (devc->nr_voice == 12) /* 4 OP mode */ |
devc | 1099 | drivers/sound/opl3.c | if (devc->nr_voice == 12) /* 4 OP mode. Use the '2 OP only' operators first */ |
devc | 1103 | drivers/sound/opl3.c | avail = devc->nr_voice; |
devc | 1131 | drivers/sound/opl3.c | if (best > devc->nr_voice) |
devc | 1132 | drivers/sound/opl3.c | best -= devc->nr_voice; |
devc | 1146 | drivers/sound/opl3.c | devc->voc[voice].bender = info->bender_value; |
devc | 1147 | drivers/sound/opl3.c | devc->voc[voice].volume = |
devc | 1187 | drivers/sound/opl3.c | if (devc == NULL) |
devc | 1193 | drivers/sound/opl3.c | memset ((char *) devc, 0x00, sizeof (*devc)); |
devc | 1194 | drivers/sound/opl3.c | devc->osp = osp; |
devc | 1196 | drivers/sound/opl3.c | devc->nr_voice = 9; |
devc | 1197 | drivers/sound/opl3.c | strcpy (devc->fm_info.name, "OPL2"); |
devc | 1199 | drivers/sound/opl3.c | devc->fm_info.device = 0; |
devc | 1200 | drivers/sound/opl3.c | devc->fm_info.synth_type = SYNTH_TYPE_FM; |
devc | 1201 | drivers/sound/opl3.c | devc->fm_info.synth_subtype = FM_TYPE_ADLIB; |
devc | 1202 | drivers/sound/opl3.c | devc->fm_info.perc_mode = 0; |
devc | 1203 | drivers/sound/opl3.c | devc->fm_info.nr_voices = 9; |
devc | 1204 | drivers/sound/opl3.c | devc->fm_info.nr_drums = 0; |
devc | 1205 | drivers/sound/opl3.c | devc->fm_info.instr_bank_size = SBFM_MAXINSTR; |
devc | 1206 | drivers/sound/opl3.c | devc->fm_info.capabilities = 0; |
devc | 1207 | drivers/sound/opl3.c | devc->left_io = ioaddr; |
devc | 1208 | drivers/sound/opl3.c | devc->right_io = ioaddr + 2; |
devc | 1211 | drivers/sound/opl3.c | devc->model = 1; |
devc | 1214 | drivers/sound/opl3.c | devc->model = 2; |
devc | 1216 | drivers/sound/opl3.c | devc->is_opl4 = 1; |
devc | 1219 | drivers/sound/opl3.c | opl3_operations.info = &devc->fm_info; |
devc | 1222 | drivers/sound/opl3.c | devc->v_alloc = &opl3_operations.alloc; |
devc | 1223 | drivers/sound/opl3.c | devc->chn_info = &opl3_operations.chn_info[0]; |
devc | 1225 | drivers/sound/opl3.c | if (devc->model == 2) |
devc | 1227 | drivers/sound/opl3.c | if (devc->is_opl4) |
devc | 1232 | drivers/sound/opl3.c | devc->v_alloc->max_voice = devc->nr_voice = 18; |
devc | 1233 | drivers/sound/opl3.c | devc->fm_info.nr_drums = 0; |
devc | 1234 | drivers/sound/opl3.c | devc->fm_info.synth_subtype = FM_TYPE_OPL3; |
devc | 1235 | drivers/sound/opl3.c | devc->fm_info.capabilities |= SYNTH_CAP_OPL3; |
devc | 1236 | drivers/sound/opl3.c | strcpy (devc->fm_info.name, "Yamaha OPL-3"); |
devc | 1240 | drivers/sound/opl3.c | pv_map[i].ioaddr = devc->left_io; |
devc | 1242 | drivers/sound/opl3.c | pv_map[i].ioaddr = devc->right_io; |
devc | 1244 | drivers/sound/opl3.c | opl3_command (devc->right_io, OPL3_MODE_REGISTER, OPL3_ENABLE); |
devc | 1245 | drivers/sound/opl3.c | opl3_command (devc->right_io, CONNECTION_SELECT_REGISTER, 0x00); |
devc | 1250 | drivers/sound/opl3.c | devc->v_alloc->max_voice = devc->nr_voice = 9; |
devc | 1251 | drivers/sound/opl3.c | devc->fm_info.nr_drums = 0; |
devc | 1254 | drivers/sound/opl3.c | pv_map[i].ioaddr = devc->left_io; |
devc | 1258 | drivers/sound/opl3.c | devc->i_map[i].channel = -1; |
devc | 39 | drivers/sound/pss.c | #define REG(x) (devc->base+x) |
devc | 88 | drivers/sound/pss.c | static pss_config *devc = &pss_data; |
devc | 99 | drivers/sound/pss.c | devc->base = hw_config->io_base; |
devc | 100 | drivers/sound/pss.c | irq = devc->irq = hw_config->irq; |
devc | 101 | drivers/sound/pss.c | dma = devc->dma = hw_config->dma; |
devc | 102 | drivers/sound/pss.c | devc->osp = hw_config->osp; |
devc | 104 | drivers/sound/pss.c | if (devc->base != 0x220 && devc->base != 0x240) |
devc | 105 | drivers/sound/pss.c | if (devc->base != 0x230 && devc->base != 0x250) /* Some cards use these */ |
devc | 108 | drivers/sound/pss.c | if (check_region (devc->base, 16)) |
devc | 125 | drivers/sound/pss.c | set_irq (pss_config * devc, int dev, int irq) |
devc | 153 | drivers/sound/pss.c | set_io_base (pss_config * devc, int dev, int base) |
devc | 164 | drivers/sound/pss.c | set_dma (pss_config * devc, int dev, int dma) |
devc | 190 | drivers/sound/pss.c | pss_reset_dsp (pss_config * devc) |
devc | 205 | drivers/sound/pss.c | pss_put_dspword (pss_config * devc, unsigned short word) |
devc | 222 | drivers/sound/pss.c | pss_get_dspword (pss_config * devc, unsigned short *word) |
devc | 240 | drivers/sound/pss.c | pss_download_boot (pss_config * devc, unsigned char *block, int size, int flags) |
devc | 257 | drivers/sound/pss.c | pss_reset_dsp (devc); |
devc | 329 | drivers/sound/pss.c | devc->base = hw_config->io_base; |
devc | 330 | drivers/sound/pss.c | devc->irq = hw_config->irq; |
devc | 331 | drivers/sound/pss.c | devc->dma = hw_config->dma; |
devc | 332 | drivers/sound/pss.c | devc->osp = hw_config->osp; |
devc | 355 | drivers/sound/pss.c | if (!set_irq (devc, CONF_PSS, devc->irq)) |
devc | 361 | drivers/sound/pss.c | if (!set_dma (devc, CONF_PSS, devc->dma)) |
devc | 389 | drivers/sound/pss.c | if (!set_io_base (devc, CONF_MIDI, hw_config->io_base)) |
devc | 395 | drivers/sound/pss.c | if (!set_irq (devc, CONF_MIDI, hw_config->irq)) |
devc | 407 | drivers/sound/pss.c | if (!pss_download_boot (devc, pss_synth, pss_synthLen, CPF_FIRST | CPF_LAST)) |
devc | 447 | drivers/sound/pss.c | if (!pss_download_boot (devc, pss_synth, pss_synthLen, CPF_FIRST | CPF_LAST)) |
devc | 470 | drivers/sound/pss.c | if (!pss_download_boot (devc, pss_synth, pss_synthLen, CPF_FIRST | CPF_LAST)) |
devc | 483 | drivers/sound/pss.c | if (!pss_download_boot (devc, buf->data, buf->len, buf->flags)) |
devc | 545 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 584 | drivers/sound/pss.c | if (!pss_get_dspword (devc, data++)) |
devc | 612 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d0)) |
devc | 618 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 624 | drivers/sound/pss.c | if (!pss_get_dspword (devc, &tmp)) |
devc | 648 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d1)) |
devc | 654 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 661 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 682 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d3)) |
devc | 688 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 695 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 702 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 723 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d2)) |
devc | 729 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 735 | drivers/sound/pss.c | if (!pss_get_dspword (devc, &tmp)) /* Read msb */ |
devc | 743 | drivers/sound/pss.c | if (!pss_get_dspword (devc, &tmp)) /* Read lsb */ |
devc | 807 | drivers/sound/pss.c | if (!set_io_base (devc, CONF_WSS, hw_config->io_base)) |
devc | 813 | drivers/sound/pss.c | if (!set_irq (devc, CONF_WSS, hw_config->irq)) |
devc | 819 | drivers/sound/pss.c | if (!set_dma (devc, CONF_WSS, hw_config->dma)) |
devc | 70 | drivers/sound/sscape.c | #define PORT(name) (devc->base+name) |
devc | 105 | drivers/sound/sscape.c | static struct sscape_info *devc = &dev_info; |
devc | 129 | drivers/sound/sscape.c | sscape_read (struct sscape_info *devc, int reg) |
devc | 143 | drivers/sound/sscape.c | sscape_write (struct sscape_info *devc, int reg, int data) |
devc | 155 | drivers/sound/sscape.c | host_open (struct sscape_info *devc) |
devc | 161 | drivers/sound/sscape.c | host_close (struct sscape_info *devc) |
devc | 167 | drivers/sound/sscape.c | host_write (struct sscape_info *devc, unsigned char *data, int count) |
devc | 201 | drivers/sound/sscape.c | host_read (struct sscape_info *devc) |
devc | 232 | drivers/sound/sscape.c | host_command1 (struct sscape_info *devc, int cmd) |
devc | 238 | drivers/sound/sscape.c | return host_write (devc, buf, 1); |
devc | 242 | drivers/sound/sscape.c | host_command2 (struct sscape_info *devc, int cmd, int parm1) |
devc | 249 | drivers/sound/sscape.c | return host_write (devc, buf, 2); |
devc | 253 | drivers/sound/sscape.c | host_command3 (struct sscape_info *devc, int cmd, int parm1, int parm2) |
devc | 261 | drivers/sound/sscape.c | return host_write (devc, buf, 3); |
devc | 265 | drivers/sound/sscape.c | set_mt32 (struct sscape_info *devc, int value) |
devc | 267 | drivers/sound/sscape.c | host_open (devc); |
devc | 268 | drivers/sound/sscape.c | host_command2 (devc, CMD_SET_MT32, |
devc | 270 | drivers/sound/sscape.c | if (host_read (devc) != CMD_ACK) |
devc | 274 | drivers/sound/sscape.c | host_close (devc); |
devc | 278 | drivers/sound/sscape.c | set_control (struct sscape_info *devc, int ctrl, int value) |
devc | 280 | drivers/sound/sscape.c | host_open (devc); |
devc | 281 | drivers/sound/sscape.c | host_command3 (devc, CMD_SET_CONTROL, ctrl, value); |
devc | 282 | drivers/sound/sscape.c | if (host_read (devc) != CMD_ACK) |
devc | 286 | drivers/sound/sscape.c | host_close (devc); |
devc | 290 | drivers/sound/sscape.c | get_board_type (struct sscape_info *devc) |
devc | 294 | drivers/sound/sscape.c | host_open (devc); |
devc | 295 | drivers/sound/sscape.c | if (!host_command1 (devc, CMD_GET_BOARD_TYPE)) |
devc | 298 | drivers/sound/sscape.c | tmp = host_read (devc); |
devc | 299 | drivers/sound/sscape.c | host_close (devc); |
devc | 309 | drivers/sound/sscape.c | bits = sscape_read (devc, GA_INTSTAT_REG); |
devc | 320 | drivers/sound/sscape.c | printk ("SSCAPE: Host interrupt, data=%02x\n", host_read (devc)); |
devc | 329 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, 0x00); /* Disable all interrupts */ |
devc | 338 | drivers/sound/sscape.c | tmp = sscape_read (devc, GA_INTENA_REG); |
devc | 339 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, (~bits & 0x0e) | (tmp & 0xf1)); |
devc | 345 | drivers/sound/sscape.c | do_dma (struct sscape_info *devc, int dma_chan, unsigned long buf, int blk_size, int mode) |
devc | 355 | drivers/sound/sscape.c | DMAbuf_start_dma (devc->my_audiodev, |
devc | 359 | drivers/sound/sscape.c | temp = devc->dma << 4; /* Setup DMA channel select bits */ |
devc | 360 | drivers/sound/sscape.c | if (devc->dma <= 3) |
devc | 364 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAA_REG, temp); |
devc | 366 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAA_REG, temp); |
devc | 370 | drivers/sound/sscape.c | verify_mpu (struct sscape_info *devc) |
devc | 386 | drivers/sound/sscape.c | if (inb (devc->base + HOST_CTRL) & 0x80) |
devc | 389 | drivers/sound/sscape.c | if (inb (devc->base) != 0x00) |
devc | 402 | drivers/sound/sscape.c | set_mt32 (devc, 0); |
devc | 403 | drivers/sound/sscape.c | if (!verify_mpu (devc)) |
devc | 414 | drivers/sound/sscape.c | struct sscape_info *devc = dev_info; |
devc | 419 | drivers/sound/sscape.c | if (devc->dma_allocated) |
devc | 421 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAA_REG, 0x20); /* DMA channel disabled */ |
devc | 424 | drivers/sound/sscape.c | devc->dma_allocated = 0; |
devc | 438 | drivers/sound/sscape.c | sscape_download_boot (struct sscape_info *devc, unsigned char *block, int size, int flag) |
devc | 461 | drivers/sound/sscape.c | if (devc->dma_allocated == 0) |
devc | 466 | drivers/sound/sscape.c | devc->dma_allocated = 1; |
devc | 470 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, |
devc | 471 | drivers/sound/sscape.c | (temp = sscape_read (devc, GA_HMCTL_REG)) & 0x3f); /*Reset */ |
devc | 474 | drivers/sound/sscape.c | sscape_read (devc, GA_HMCTL_REG); /* Delay */ |
devc | 477 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, |
devc | 478 | drivers/sound/sscape.c | (temp = sscape_read (devc, GA_HMCTL_REG)) | 0x80); |
devc | 484 | drivers/sound/sscape.c | memcpy (audio_devs[devc->my_audiodev]->dmap_out->raw_buf, block, size); |
devc | 489 | drivers/sound/sscape.c | do_dma (devc, SSCAPE_DMA_A, |
devc | 490 | drivers/sound/sscape.c | audio_devs[devc->my_audiodev]->dmap_out->raw_buf_phys, |
devc | 520 | drivers/sound/sscape.c | clear_dma_ff (devc->dma); |
devc | 521 | drivers/sound/sscape.c | if ((resid = get_dma_residue (devc->dma)) == 0) |
devc | 537 | drivers/sound/sscape.c | temp = sscape_read (devc, GA_HMCTL_REG); |
devc | 539 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, temp); /* Kickstart the board */ |
devc | 612 | drivers/sound/sscape.c | get_board_type (devc)); |
devc | 614 | drivers/sound/sscape.c | set_control (devc, CTL_MASTER_VOL, 100); |
devc | 615 | drivers/sound/sscape.c | set_control (devc, CTL_SYNTH_VOL, 100); |
devc | 626 | drivers/sound/sscape.c | printk ("I%d = %02x (new value)\n", i, sscape_read (devc, i)); |
devc | 641 | drivers/sound/sscape.c | if (!sscape_download_boot (devc, buf->data, buf->len, buf->flags)) |
devc | 696 | drivers/sound/sscape.c | sscape_info *devc = (sscape_info *) audio_devs[dev]->devc; |
devc | 700 | drivers/sound/sscape.c | if (devc->opened) |
devc | 705 | drivers/sound/sscape.c | devc->opened = 1; |
devc | 716 | drivers/sound/sscape.c | printk ("I%d = %02x\n", i, sscape_read (devc, i)); |
devc | 727 | drivers/sound/sscape.c | sscape_info *devc = (sscape_info *) audio_devs[dev]->devc; |
devc | 734 | drivers/sound/sscape.c | devc->opened = 0; |
devc | 740 | drivers/sound/sscape.c | set_speed (sscape_info * devc, int arg) |
devc | 746 | drivers/sound/sscape.c | set_channels (sscape_info * devc, int arg) |
devc | 752 | drivers/sound/sscape.c | set_format (sscape_info * devc, int arg) |
devc | 760 | drivers/sound/sscape.c | sscape_info *devc = (sscape_info *) audio_devs[dev]->devc; |
devc | 766 | drivers/sound/sscape.c | return set_speed (devc, (int) arg); |
devc | 767 | drivers/sound/sscape.c | return snd_ioctl_return ((int *) arg, set_speed (devc, get_fs_long ((long *) arg))); |
devc | 776 | drivers/sound/sscape.c | return set_channels (devc, (int) arg + 1) - 1; |
devc | 777 | drivers/sound/sscape.c | return snd_ioctl_return ((int *) arg, set_channels (devc, get_fs_long ((long *) arg) + 1) - 1); |
devc | 781 | drivers/sound/sscape.c | return set_channels (devc, (int) arg); |
devc | 782 | drivers/sound/sscape.c | return snd_ioctl_return ((int *) arg, set_channels (devc, get_fs_long ((long *) arg))); |
devc | 791 | drivers/sound/sscape.c | return set_format (devc, (int) arg); |
devc | 792 | drivers/sound/sscape.c | return snd_ioctl_return ((int *) arg, set_format (devc, get_fs_long ((long *) arg))); |
devc | 927 | drivers/sound/sscape.c | sscape_write (devc, i, 0xf0); /* All interrupts enabled */ |
devc | 932 | drivers/sound/sscape.c | sscape_write (devc, i, 0x20); /* DMA channel disabled */ |
devc | 936 | drivers/sound/sscape.c | sscape_write (devc, i, 0xf0 | (irq_bits << 2) | irq_bits); |
devc | 940 | drivers/sound/sscape.c | sscape_write (devc, i, (regs[i] & 0x3f) | |
devc | 941 | drivers/sound/sscape.c | (sscape_read (devc, i) & 0xc0)); |
devc | 948 | drivers/sound/sscape.c | sscape_write (devc, i, |
devc | 949 | drivers/sound/sscape.c | (sscape_read (devc, i) & 0xf0) | 0x08); |
devc | 953 | drivers/sound/sscape.c | sscape_write (devc, i, regs[i]); |
devc | 967 | drivers/sound/sscape.c | printk ("I%d = %02x (new value)\n", i, sscape_read (devc, i)); |
devc | 994 | drivers/sound/sscape.c | audio_devs[my_dev]->devc = devc; |
devc | 995 | drivers/sound/sscape.c | devc->my_audiodev = my_dev; |
devc | 996 | drivers/sound/sscape.c | devc->opened = 0; |
devc | 998 | drivers/sound/sscape.c | if (snd_set_irq_handler (hw_config->irq, sscapeintr, "SoundScape", devc->osp) < 0) |
devc | 1001 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, 0x80); /* Master IRQ enable */ |
devc | 1007 | drivers/sound/sscape.c | devc->ok = 1; |
devc | 1008 | drivers/sound/sscape.c | devc->failed = 0; |
devc | 1017 | drivers/sound/sscape.c | devc->failed = 1; |
devc | 1018 | drivers/sound/sscape.c | devc->base = hw_config->io_base; |
devc | 1019 | drivers/sound/sscape.c | devc->irq = hw_config->irq; |
devc | 1020 | drivers/sound/sscape.c | devc->dma = hw_config->dma; |
devc | 1021 | drivers/sound/sscape.c | devc->osp = hw_config->osp; |
devc | 1049 | drivers/sound/sscape.c | if (sscape_read (devc, 0) & 0x0c) |
devc | 1052 | drivers/sound/sscape.c | if (sscape_read (devc, 1) & 0x0f) |
devc | 1055 | drivers/sound/sscape.c | if (sscape_read (devc, 5) & 0x0f) |
devc | 1067 | drivers/sound/sscape.c | printk ("I%d = %02x (old value)\n", i, sscape_read (devc, i)); |
devc | 1076 | drivers/sound/sscape.c | if (!((tmp = sscape_read (devc, GA_HMCTL_REG)) & 0xc0)) |
devc | 1078 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, tmp | 0x80); |
devc | 1080 | drivers/sound/sscape.c | inb (devc->base + ODIE_ADDR); |
devc | 1102 | drivers/sound/sscape.c | if (devc->failed) |
devc | 1105 | drivers/sound/sscape.c | if (devc->ok == 0) |
devc | 1145 | drivers/sound/sscape.c | sscape_write (devc, GA_DMACFG_REG, 0x50); |
devc | 1150 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAB_REG, 0x20); |
devc | 1163 | drivers/sound/sscape.c | sscape_write (devc, GA_CDCFG_REG, 0x89 | (hw_config->dma << 4) | |
devc | 1166 | drivers/sound/sscape.c | if (hw_config->irq == devc->irq) |
devc | 1174 | drivers/sound/sscape.c | devc->osp); |
devc | 1189 | drivers/sound/sscape.c | printk ("I%d = %02x\n", i, sscape_read (devc, i)); |