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 | 115 | drivers/sound/ad1848.c | ad_read (ad1848_info * devc, int reg) |
devc | 121 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) /*Are we initializing */ |
devc | 125 | drivers/sound/ad1848.c | OUTB ((unsigned char) (reg & 0xff) | devc->MCE_bit, io_Index_Addr (devc)); |
devc | 126 | drivers/sound/ad1848.c | x = INB (io_Indexed_Data (devc)); |
devc | 134 | drivers/sound/ad1848.c | ad_write (ad1848_info * devc, int reg, int data) |
devc | 139 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) /*Are we initializing */ |
devc | 143 | drivers/sound/ad1848.c | OUTB ((unsigned char) (reg & 0xff) | devc->MCE_bit, io_Index_Addr (devc)); |
devc | 144 | drivers/sound/ad1848.c | OUTB ((unsigned char) (data & 0xff), io_Indexed_Data (devc)); |
devc | 150 | drivers/sound/ad1848.c | wait_for_calibration (ad1848_info * devc) |
devc | 162 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) & 0x80) |
devc | 164 | drivers/sound/ad1848.c | if (INB (devc->base) & 0x80) |
devc | 168 | drivers/sound/ad1848.c | while (timeout > 0 && !(ad_read (devc, 11) & 0x20)) |
devc | 170 | drivers/sound/ad1848.c | if (!(ad_read (devc, 11) & 0x20)) |
devc | 174 | drivers/sound/ad1848.c | while (timeout > 0 && ad_read (devc, 11) & 0x20) |
devc | 176 | drivers/sound/ad1848.c | if (ad_read (devc, 11) & 0x20) |
devc | 181 | drivers/sound/ad1848.c | ad_mute (ad1848_info * devc) |
devc | 191 | drivers/sound/ad1848.c | prev = devc->saved_regs[i] = ad_read (devc, i); |
devc | 192 | drivers/sound/ad1848.c | ad_write (devc, i, prev | 0x80); |
devc | 197 | drivers/sound/ad1848.c | ad_unmute (ad1848_info * devc) |
devc | 206 | drivers/sound/ad1848.c | ad_write (devc, i, devc->saved_regs[i] & ~0x80); |
devc | 211 | drivers/sound/ad1848.c | ad_enter_MCE (ad1848_info * devc) |
devc | 217 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) /*Are we initializing */ |
devc | 222 | drivers/sound/ad1848.c | devc->MCE_bit = 0x40; |
devc | 223 | drivers/sound/ad1848.c | prev = INB (io_Index_Addr (devc)); |
devc | 230 | drivers/sound/ad1848.c | OUTB (devc->MCE_bit, io_Index_Addr (devc)); |
devc | 235 | drivers/sound/ad1848.c | ad_leave_MCE (ad1848_info * devc) |
devc | 241 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) /*Are we initializing */ |
devc | 246 | drivers/sound/ad1848.c | devc->MCE_bit = 0x00; |
devc | 247 | drivers/sound/ad1848.c | prev = INB (io_Index_Addr (devc)); |
devc | 248 | drivers/sound/ad1848.c | OUTB (0x00, io_Index_Addr (devc)); /* Clear the MCE bit */ |
devc | 256 | drivers/sound/ad1848.c | OUTB (0x00, io_Index_Addr (devc)); /* Clear the MCE bit */ |
devc | 257 | drivers/sound/ad1848.c | wait_for_calibration (devc); |
devc | 263 | drivers/sound/ad1848.c | ad1848_set_recmask (ad1848_info * devc, int mask) |
devc | 268 | drivers/sound/ad1848.c | mask &= devc->supported_rec_devices; |
devc | 279 | drivers/sound/ad1848.c | mask &= ~devc->recmask; /* Filter out active settings */ |
devc | 312 | drivers/sound/ad1848.c | ad_write (devc, 0, (ad_read (devc, 0) & 0x3f) | recdev); |
devc | 313 | drivers/sound/ad1848.c | ad_write (devc, 1, (ad_read (devc, 1) & 0x3f) | recdev); |
devc | 315 | drivers/sound/ad1848.c | devc->recmask = mask; |
devc | 337 | drivers/sound/ad1848.c | ad1848_mixer_get (ad1848_info * devc, int dev) |
devc | 339 | drivers/sound/ad1848.c | if (!((1 << dev) & devc->supported_devices)) |
devc | 342 | drivers/sound/ad1848.c | return devc->levels[dev]; |
devc | 346 | drivers/sound/ad1848.c | ad1848_mixer_set (ad1848_info * devc, int dev, int value) |
devc | 362 | drivers/sound/ad1848.c | if (!(devc->supported_devices & (1 << dev))) |
devc | 373 | drivers/sound/ad1848.c | val = ad_read (devc, regoffs); |
devc | 375 | drivers/sound/ad1848.c | devc->levels[dev] = left | (left << 8); |
devc | 376 | drivers/sound/ad1848.c | ad_write (devc, regoffs, val); |
devc | 377 | drivers/sound/ad1848.c | devc->saved_regs[regoffs] = val; |
devc | 387 | drivers/sound/ad1848.c | val = ad_read (devc, regoffs); |
devc | 389 | drivers/sound/ad1848.c | ad_write (devc, regoffs, val); |
devc | 390 | drivers/sound/ad1848.c | devc->saved_regs[regoffs] = val; |
devc | 392 | drivers/sound/ad1848.c | devc->levels[dev] = left | (right << 8); |
devc | 397 | drivers/sound/ad1848.c | ad1848_mixer_reset (ad1848_info * devc) |
devc | 401 | drivers/sound/ad1848.c | devc->recmask = 0; |
devc | 402 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 403 | drivers/sound/ad1848.c | devc->supported_devices = MODE2_MIXER_DEVICES; |
devc | 405 | drivers/sound/ad1848.c | devc->supported_devices = MODE1_MIXER_DEVICES; |
devc | 407 | drivers/sound/ad1848.c | devc->supported_rec_devices = MODE1_REC_DEVICES; |
devc | 410 | drivers/sound/ad1848.c | ad1848_mixer_set (devc, i, devc->levels[i] = default_mixer_levels[i]); |
devc | 411 | drivers/sound/ad1848.c | ad1848_set_recmask (devc, SOUND_MASK_MIC); |
devc | 417 | drivers/sound/ad1848.c | ad1848_info *devc; |
devc | 426 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[codec_dev]->devc; |
devc | 434 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, ad1848_set_recmask (devc, IOCTL_IN (arg))); |
devc | 438 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, ad1848_mixer_set (devc, cmd & 0xff, IOCTL_IN (arg))); |
devc | 447 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->recmask); |
devc | 451 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->supported_devices); |
devc | 455 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->supported_devices & |
devc | 460 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->supported_rec_devices); |
devc | 468 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, ad1848_mixer_get (devc, cmd & 0xff)); |
devc | 505 | drivers/sound/ad1848.c | ad1848_info *devc = NULL; |
devc | 513 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 516 | drivers/sound/ad1848.c | if (devc->opened) |
devc | 523 | drivers/sound/ad1848.c | if (devc->irq) /* Not managed by another driver */ |
devc | 524 | drivers/sound/ad1848.c | if ((err = snd_set_irq_handler (devc->irq, ad1848_interrupt, |
devc | 537 | drivers/sound/ad1848.c | audio_devs[dev]->dmachan = devc->dma_playback; |
devc | 539 | drivers/sound/ad1848.c | audio_devs[dev]->dmachan = devc->dma_capture; |
devc | 544 | drivers/sound/ad1848.c | if (devc->irq) /* Don't leave IRQ reserved */ |
devc | 545 | drivers/sound/ad1848.c | snd_release_irq (devc->irq); |
devc | 551 | drivers/sound/ad1848.c | devc->dual_dma = 0; |
devc | 553 | drivers/sound/ad1848.c | if (devc->dma_capture != devc->dma_playback && mode == OPEN_READWRITE) |
devc | 555 | drivers/sound/ad1848.c | devc->dual_dma = 1; |
devc | 557 | drivers/sound/ad1848.c | if (ALLOC_DMA_CHN (devc->dma_capture, "Sound System (capture)")) |
devc | 559 | drivers/sound/ad1848.c | if (devc->irq) /* Don't leave IRQ reserved */ |
devc | 560 | drivers/sound/ad1848.c | snd_release_irq (devc->irq); |
devc | 566 | drivers/sound/ad1848.c | devc->intr_active = 0; |
devc | 567 | drivers/sound/ad1848.c | devc->opened = 1; |
devc | 572 | drivers/sound/ad1848.c | ad_mute (devc); |
devc | 581 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 587 | drivers/sound/ad1848.c | devc->intr_active = 0; |
devc | 588 | drivers/sound/ad1848.c | if (devc->irq) /* Not managed by another driver */ |
devc | 589 | drivers/sound/ad1848.c | snd_release_irq (devc->irq); |
devc | 593 | drivers/sound/ad1848.c | if (devc->dual_dma) /* Release the second DMA channel */ |
devc | 595 | drivers/sound/ad1848.c | if (audio_devs[dev]->dmachan == devc->dma_playback) |
devc | 596 | drivers/sound/ad1848.c | RELEASE_DMA_CHN (devc->dma_capture); |
devc | 598 | drivers/sound/ad1848.c | RELEASE_DMA_CHN (devc->dma_playback); |
devc | 601 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 603 | drivers/sound/ad1848.c | ad_unmute (devc); |
devc | 608 | drivers/sound/ad1848.c | set_speed (ad1848_info * devc, int arg) |
devc | 675 | drivers/sound/ad1848.c | devc->speed = speed_table[selected].speed; |
devc | 676 | drivers/sound/ad1848.c | devc->speed_bits = speed_table[selected].bits; |
devc | 677 | drivers/sound/ad1848.c | return devc->speed; |
devc | 681 | drivers/sound/ad1848.c | set_channels (ad1848_info * devc, int arg) |
devc | 684 | drivers/sound/ad1848.c | return devc->channels; |
devc | 686 | drivers/sound/ad1848.c | devc->channels = arg; |
devc | 691 | drivers/sound/ad1848.c | set_format (ad1848_info * devc, int arg) |
devc | 743 | drivers/sound/ad1848.c | if (!(arg & ad_format_mask[devc->mode])) |
devc | 746 | drivers/sound/ad1848.c | devc->audio_format = arg; |
devc | 751 | drivers/sound/ad1848.c | if ((devc->format_bits = format2bits[i].bits) == 0) |
devc | 752 | drivers/sound/ad1848.c | return devc->audio_format = AFMT_U8; /* Was not supported */ |
devc | 758 | drivers/sound/ad1848.c | devc->format_bits = 0; |
devc | 759 | drivers/sound/ad1848.c | return devc->audio_format = AFMT_U8; |
devc | 765 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 771 | drivers/sound/ad1848.c | return set_speed (devc, arg); |
devc | 772 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_speed (devc, IOCTL_IN (arg))); |
devc | 776 | drivers/sound/ad1848.c | return devc->speed; |
devc | 777 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->speed); |
devc | 781 | drivers/sound/ad1848.c | return set_channels (devc, arg + 1) - 1; |
devc | 782 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_channels (devc, IOCTL_IN (arg) + 1) - 1); |
devc | 786 | drivers/sound/ad1848.c | return set_channels (devc, arg); |
devc | 787 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_channels (devc, IOCTL_IN (arg))); |
devc | 791 | drivers/sound/ad1848.c | return devc->channels; |
devc | 792 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->channels); |
devc | 796 | drivers/sound/ad1848.c | return set_format (devc, arg); |
devc | 797 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, set_format (devc, IOCTL_IN (arg))); |
devc | 801 | drivers/sound/ad1848.c | return devc->audio_format; |
devc | 802 | drivers/sound/ad1848.c | return IOCTL_OUT (arg, devc->audio_format); |
devc | 813 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 817 | drivers/sound/ad1848.c | audio_devs[dev]->dmachan = devc->dma_playback; |
devc | 819 | drivers/sound/ad1848.c | if (devc->audio_format == AFMT_IMA_ADPCM) |
devc | 825 | drivers/sound/ad1848.c | if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ |
devc | 828 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 834 | drivers/sound/ad1848.c | cnt == devc->xfer_count) |
devc | 836 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_OUTPUT; |
devc | 837 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 850 | drivers/sound/ad1848.c | ad_enter_MCE (devc); |
devc | 852 | drivers/sound/ad1848.c | ad_write (devc, 15, (unsigned char) (cnt & 0xff)); |
devc | 853 | drivers/sound/ad1848.c | ad_write (devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 855 | drivers/sound/ad1848.c | if (devc->dma_playback == devc->dma_capture) |
devc | 857 | drivers/sound/ad1848.c | ad_write (devc, 9, 0x0d); /* |
devc | 864 | drivers/sound/ad1848.c | ad_write (devc, 9, 0x09); /* |
devc | 870 | drivers/sound/ad1848.c | ad_leave_MCE (devc); /* |
devc | 874 | drivers/sound/ad1848.c | ad_unmute (devc); |
devc | 876 | drivers/sound/ad1848.c | devc->xfer_count = cnt; |
devc | 877 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_OUTPUT; |
devc | 878 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 879 | drivers/sound/ad1848.c | INB (io_Status (devc)); |
devc | 880 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear pending interrupts */ |
devc | 889 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 891 | drivers/sound/ad1848.c | audio_devs[dev]->dmachan = devc->dma_capture; |
devc | 894 | drivers/sound/ad1848.c | if (devc->audio_format == AFMT_IMA_ADPCM) |
devc | 900 | drivers/sound/ad1848.c | if (devc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ |
devc | 903 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 909 | drivers/sound/ad1848.c | cnt == devc->xfer_count) |
devc | 911 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_INPUT; |
devc | 912 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 925 | drivers/sound/ad1848.c | ad_enter_MCE (devc); |
devc | 927 | drivers/sound/ad1848.c | if (devc->dma_playback == devc->dma_capture) /* Single DMA channel mode */ |
devc | 929 | drivers/sound/ad1848.c | ad_write (devc, 15, (unsigned char) (cnt & 0xff)); |
devc | 930 | drivers/sound/ad1848.c | ad_write (devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 932 | drivers/sound/ad1848.c | ad_write (devc, 9, 0x0e); /* |
devc | 940 | drivers/sound/ad1848.c | ad_write (devc, 31, (unsigned char) (cnt & 0xff)); |
devc | 941 | drivers/sound/ad1848.c | ad_write (devc, 30, (unsigned char) ((cnt >> 8) & 0xff)); |
devc | 943 | drivers/sound/ad1848.c | ad_write (devc, 9, 0x0a); /* |
devc | 949 | drivers/sound/ad1848.c | ad_leave_MCE (devc); /* |
devc | 953 | drivers/sound/ad1848.c | ad_unmute (devc); |
devc | 955 | drivers/sound/ad1848.c | devc->xfer_count = cnt; |
devc | 956 | drivers/sound/ad1848.c | devc->irq_mode = IMODE_INPUT; |
devc | 957 | drivers/sound/ad1848.c | devc->intr_active = 1; |
devc | 958 | drivers/sound/ad1848.c | INB (io_Status (devc)); |
devc | 959 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 969 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 972 | drivers/sound/ad1848.c | ad_enter_MCE (devc); /* Enables changes to the format select reg */ |
devc | 973 | drivers/sound/ad1848.c | fs = devc->speed_bits | (devc->format_bits << 5); |
devc | 975 | drivers/sound/ad1848.c | if (devc->channels > 1) |
devc | 978 | drivers/sound/ad1848.c | ad_write (devc, 8, fs); |
devc | 983 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) |
devc | 989 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 991 | drivers/sound/ad1848.c | ad_write (devc, 28, fs); |
devc | 997 | drivers/sound/ad1848.c | while (timeout > 0 && INB (devc->base) == 0x80) |
devc | 1002 | drivers/sound/ad1848.c | ad_leave_MCE (devc); /* |
devc | 1006 | drivers/sound/ad1848.c | devc->xfer_count = 0; |
devc | 1019 | drivers/sound/ad1848.c | ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1021 | drivers/sound/ad1848.c | ad_mute (devc); |
devc | 1022 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x03); /* Stop DMA */ |
devc | 1023 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1025 | drivers/sound/ad1848.c | ad_enter_MCE (devc); |
devc | 1026 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1027 | drivers/sound/ad1848.c | ad_write (devc, 15, 0); /* Clear DMA counter */ |
devc | 1028 | drivers/sound/ad1848.c | ad_write (devc, 14, 0); /* Clear DMA counter */ |
devc | 1030 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 1032 | drivers/sound/ad1848.c | ad_write (devc, 30, 0); /* Clear DMA counter */ |
devc | 1033 | drivers/sound/ad1848.c | ad_write (devc, 31, 0); /* Clear DMA counter */ |
devc | 1036 | drivers/sound/ad1848.c | ad_write (devc, 9, ad_read (devc, 9) & ~0x03); /* Stop DMA */ |
devc | 1038 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1039 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1040 | drivers/sound/ad1848.c | ad_leave_MCE (devc); |
devc | 1051 | drivers/sound/ad1848.c | ad1848_info *devc = &dev_info[nr_ad1848_devs]; |
devc | 1060 | drivers/sound/ad1848.c | devc->base = io_base; |
devc | 1061 | drivers/sound/ad1848.c | devc->MCE_bit = 0x40; |
devc | 1062 | drivers/sound/ad1848.c | devc->irq = 0; |
devc | 1063 | drivers/sound/ad1848.c | devc->dma_capture = 0; |
devc | 1064 | drivers/sound/ad1848.c | devc->dma_playback = 0; |
devc | 1065 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 1066 | drivers/sound/ad1848.c | devc->chip_name = "AD1848"; |
devc | 1067 | drivers/sound/ad1848.c | devc->mode = 1; /* MODE1 = original AD1848 */ |
devc | 1079 | drivers/sound/ad1848.c | if ((INB (devc->base) & 0x80) != 0x00) /* Not a AD1884 */ |
devc | 1091 | drivers/sound/ad1848.c | ad_write (devc, 0, 0xaa); |
devc | 1092 | drivers/sound/ad1848.c | ad_write (devc, 1, 0x45); /* 0x55 with bit 0x10 clear */ |
devc | 1094 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 0)) != 0xaa || (tmp2 = ad_read (devc, 1)) != 0x45) |
devc | 1100 | drivers/sound/ad1848.c | ad_write (devc, 0, 0x45); |
devc | 1101 | drivers/sound/ad1848.c | ad_write (devc, 1, 0xaa); |
devc | 1103 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 0)) != 0x45 || (tmp2 = ad_read (devc, 1)) != 0xaa) |
devc | 1114 | drivers/sound/ad1848.c | tmp = ad_read (devc, 12); |
devc | 1115 | drivers/sound/ad1848.c | ad_write (devc, 12, (~tmp) & 0x0f); |
devc | 1117 | drivers/sound/ad1848.c | if ((tmp & 0x0f) != ((tmp1 = ad_read (devc, 12)) & 0x0f)) |
devc | 1135 | drivers/sound/ad1848.c | ad_write (devc, 12, 0); /* Mode2=disabled */ |
devc | 1138 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, i)) != (tmp2 = ad_read (devc, i + 16))) |
devc | 1149 | drivers/sound/ad1848.c | ad_write (devc, 12, 0x40); /* Set mode2, clear 0x80 */ |
devc | 1151 | drivers/sound/ad1848.c | tmp1 = ad_read (devc, 12); |
devc | 1153 | drivers/sound/ad1848.c | devc->chip_name = "CS4248"; /* Our best knowledge just now */ |
devc | 1162 | drivers/sound/ad1848.c | ad_write (devc, 16, 0); /* Set I16 to known value */ |
devc | 1164 | drivers/sound/ad1848.c | ad_write (devc, 0, 0x45); |
devc | 1165 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 16)) != 0x45) /* No change -> CS4231? */ |
devc | 1168 | drivers/sound/ad1848.c | ad_write (devc, 0, 0xaa); |
devc | 1169 | drivers/sound/ad1848.c | if ((tmp1 = ad_read (devc, 16)) == 0xaa) /* Rotten bits? */ |
devc | 1179 | drivers/sound/ad1848.c | tmp1 = ad_read (devc, 25); /* Original bits */ |
devc | 1180 | drivers/sound/ad1848.c | ad_write (devc, 25, ~tmp1); /* Invert all bits */ |
devc | 1181 | drivers/sound/ad1848.c | if ((ad_read (devc, 25) & 0xe7) == (tmp1 & 0xe7)) |
devc | 1186 | drivers/sound/ad1848.c | devc->chip_name = "CS4231"; |
devc | 1190 | drivers/sound/ad1848.c | if (devc->base != MOZART_PORT + 4) |
devc | 1192 | drivers/sound/ad1848.c | devc->mode = 2; |
devc | 1196 | drivers/sound/ad1848.c | ad_write (devc, 25, tmp1); /* Restore bits */ |
devc | 1225 | drivers/sound/ad1848.c | ad1848_info *devc = &dev_info[nr_ad1848_devs]; |
devc | 1230 | drivers/sound/ad1848.c | devc->irq = (irq > 0) ? irq : 0; |
devc | 1231 | drivers/sound/ad1848.c | devc->dma_playback = dma_playback; |
devc | 1233 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 1234 | drivers/sound/ad1848.c | devc->dma_capture = dma_capture; |
devc | 1236 | drivers/sound/ad1848.c | devc->dma_capture = dma_playback; /* Use just single DMA */ |
devc | 1238 | drivers/sound/ad1848.c | devc->opened = 0; |
devc | 1248 | drivers/sound/ad1848.c | ad_write (devc, i, init_values[i]); |
devc | 1250 | drivers/sound/ad1848.c | ad_mute (devc); /* Initialize some variables */ |
devc | 1251 | drivers/sound/ad1848.c | ad_unmute (devc); /* Leave it unmuted now */ |
devc | 1253 | drivers/sound/ad1848.c | if (devc->mode == 2) |
devc | 1255 | drivers/sound/ad1848.c | ad_write (devc, 12, ad_read (devc, 12) | 0x40); /* Mode2 = enabled */ |
devc | 1257 | drivers/sound/ad1848.c | ad_write (devc, i, init_values[i]); |
devc | 1260 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear pending interrupts */ |
devc | 1264 | drivers/sound/ad1848.c | "%s (%s)", name, devc->chip_name); |
devc | 1267 | drivers/sound/ad1848.c | "Generic audio codec (%s)", devc->chip_name); |
devc | 1282 | drivers/sound/ad1848.c | audio_devs[my_dev]->devc = devc; |
devc | 1283 | drivers/sound/ad1848.c | audio_devs[my_dev]->format_mask = ad_format_mask[devc->mode]; |
devc | 1290 | drivers/sound/ad1848.c | ad_enter_MCE (devc); /* In case the bit was off */ |
devc | 1291 | drivers/sound/ad1848.c | ad_leave_MCE (devc); |
devc | 1298 | drivers/sound/ad1848.c | ad1848_mixer_reset (devc); |
devc | 1309 | drivers/sound/ad1848.c | ad1848_info *devc; |
devc | 1318 | drivers/sound/ad1848.c | devc = (ad1848_info *) audio_devs[dev]->devc; |
devc | 1319 | drivers/sound/ad1848.c | status = INB (io_Status (devc)); |
devc | 1326 | drivers/sound/ad1848.c | if (devc->opened && devc->irq_mode == IMODE_OUTPUT) |
devc | 1331 | drivers/sound/ad1848.c | if (devc->opened && devc->irq_mode == IMODE_INPUT) |
devc | 1335 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Clear interrupt status */ |
devc | 1337 | drivers/sound/ad1848.c | status = INB (io_Status (devc)); |
devc | 1341 | drivers/sound/ad1848.c | OUTB (0, io_Status (devc)); /* Try again */ |
devc | 106 | drivers/sound/audio.c | open (audio_devs[dev]->coproc->devc, COPR_PCM)) < 0) |
devc | 153 | drivers/sound/audio.c | audio_devs[dev]->coproc->close (audio_devs[dev]->coproc->devc, COPR_PCM); |
devc | 360 | drivers/sound/audio.c | return audio_devs[dev]->coproc->ioctl (audio_devs[dev]->coproc->devc, cmd, arg, 0); |
devc | 116 | drivers/sound/dev_table.h | int (*open) (void *devc, int sub_device); |
devc | 117 | drivers/sound/dev_table.h | void (*close) (void *devc, int sub_device); |
devc | 118 | drivers/sound/dev_table.h | int (*ioctl) (void *devc, unsigned int cmd, unsigned int arg, int local); |
devc | 119 | drivers/sound/dev_table.h | void (*reset) (void *devc); |
devc | 121 | drivers/sound/dev_table.h | void *devc; /* Driver specific info */ |
devc | 131 | drivers/sound/dev_table.h | void *devc; /* Driver specific info */ |
devc | 385 | drivers/sound/midibuf.c | return midi_devs[dev]->coproc->ioctl (midi_devs[dev]->coproc->devc, cmd, arg, 0); |
devc | 112 | drivers/sound/mpu401.c | static int reset_mpu401 (struct mpu_config *devc); |
devc | 113 | drivers/sound/mpu401.c | static void set_uart_mode (int dev, struct mpu_config *devc, int arg); |
devc | 116 | drivers/sound/mpu401.c | static void timer_ext_event (struct mpu_config *devc, int event, int parm); |
devc | 162 | drivers/sound/mpu401.c | mpu_input_scanner (struct mpu_config *devc, unsigned char midic) |
devc | 165 | drivers/sound/mpu401.c | switch (devc->m_state) |
devc | 179 | drivers/sound/mpu401.c | if (devc->timer_flag) |
devc | 203 | drivers/sound/mpu401.c | devc->m_state = ST_SYSMSG; |
devc | 210 | drivers/sound/mpu401.c | devc->m_state = ST_TIMED; |
devc | 221 | drivers/sound/mpu401.c | devc->m_state = ST_DATABYTE; |
devc | 226 | drivers/sound/mpu401.c | msg = (devc->last_status & 0xf0) >> 4; |
devc | 228 | drivers/sound/mpu401.c | devc->m_left = len_tab[msg] - 1; |
devc | 230 | drivers/sound/mpu401.c | devc->m_ptr = 2; |
devc | 231 | drivers/sound/mpu401.c | devc->m_buf[0] = devc->last_status; |
devc | 232 | drivers/sound/mpu401.c | devc->m_buf[1] = midic; |
devc | 234 | drivers/sound/mpu401.c | if (devc->m_left <= 0) |
devc | 236 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 237 | drivers/sound/mpu401.c | do_midi_msg (devc->synthno, devc->m_buf, devc->m_ptr); |
devc | 238 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 243 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 265 | drivers/sound/mpu401.c | devc->last_status = midic; |
devc | 268 | drivers/sound/mpu401.c | devc->m_left = len_tab[msg]; |
devc | 270 | drivers/sound/mpu401.c | devc->m_ptr = 1; |
devc | 271 | drivers/sound/mpu401.c | devc->m_buf[0] = midic; |
devc | 273 | drivers/sound/mpu401.c | if (devc->m_left <= 0) |
devc | 275 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 276 | drivers/sound/mpu401.c | do_midi_msg (devc->synthno, devc->m_buf, devc->m_ptr); |
devc | 277 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 288 | drivers/sound/mpu401.c | devc->m_state = ST_SYSEX; |
devc | 292 | drivers/sound/mpu401.c | devc->m_state = ST_MTC; |
devc | 296 | drivers/sound/mpu401.c | devc->m_state = ST_SONGPOS; |
devc | 297 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 301 | drivers/sound/mpu401.c | devc->m_state = ST_SONGSEL; |
devc | 306 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 313 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 314 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_CLOCK, 0); |
devc | 318 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 319 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_START, 0); |
devc | 323 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 324 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_CONTINUE, 0); |
devc | 328 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 329 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_STOP, 0); |
devc | 334 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 339 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 344 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 349 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 357 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 364 | drivers/sound/mpu401.c | BUFTEST (devc); |
devc | 365 | drivers/sound/mpu401.c | devc->m_buf[devc->m_ptr++] = midic; |
devc | 366 | drivers/sound/mpu401.c | if (devc->m_ptr == 2) |
devc | 368 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 369 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 370 | drivers/sound/mpu401.c | timer_ext_event (devc, TMR_SPP, |
devc | 371 | drivers/sound/mpu401.c | ((devc->m_buf[1] & 0x7f) << 7) | |
devc | 372 | drivers/sound/mpu401.c | (devc->m_buf[0] & 0x7f)); |
devc | 377 | drivers/sound/mpu401.c | BUFTEST (devc); |
devc | 378 | drivers/sound/mpu401.c | devc->m_buf[devc->m_ptr++] = midic; |
devc | 379 | drivers/sound/mpu401.c | if ((--devc->m_left) <= 0) |
devc | 381 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 382 | drivers/sound/mpu401.c | do_midi_msg (devc->synthno, devc->m_buf, devc->m_ptr); |
devc | 383 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 388 | drivers/sound/mpu401.c | printk ("Bad state %d ", devc->m_state); |
devc | 389 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 396 | drivers/sound/mpu401.c | mpu401_input_loop (struct mpu_config *devc) |
devc | 403 | drivers/sound/mpu401.c | busy = devc->m_busy; |
devc | 404 | drivers/sound/mpu401.c | devc->m_busy = 1; |
devc | 412 | drivers/sound/mpu401.c | while (input_avail (devc->base) && n-- > 0) |
devc | 414 | drivers/sound/mpu401.c | unsigned char c = read_data (devc->base); |
devc | 416 | drivers/sound/mpu401.c | if (devc->mode == MODE_SYNTH) |
devc | 418 | drivers/sound/mpu401.c | mpu_input_scanner (devc, c); |
devc | 420 | drivers/sound/mpu401.c | else if (devc->opened & OPEN_READ && devc->inputintr != NULL) |
devc | 421 | drivers/sound/mpu401.c | devc->inputintr (devc->devno, c); |
devc | 424 | drivers/sound/mpu401.c | devc->m_busy = 0; |
devc | 430 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 450 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 452 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 453 | drivers/sound/mpu401.c | if (devc->base != 0 && (devc->opened & OPEN_READ || devc->mode == MODE_SYNTH)) |
devc | 454 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 458 | drivers/sound/mpu401.c | read_data (devc->base); |
devc | 470 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 475 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 477 | drivers/sound/mpu401.c | if (devc->opened) |
devc | 490 | drivers/sound/mpu401.c | if (!devc->initialized) |
devc | 492 | drivers/sound/mpu401.c | if (mpu401_status (devc->base) == 0xff) /* Bus float */ |
devc | 497 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 500 | drivers/sound/mpu401.c | irq2dev[devc->irq] = dev; |
devc | 501 | drivers/sound/mpu401.c | if (devc->shared_irq == 0) |
devc | 502 | drivers/sound/mpu401.c | if ((err = snd_set_irq_handler (devc->irq, mpuintr, midi_devs[dev]->info.name) < 0)) |
devc | 509 | drivers/sound/mpu401.c | open (midi_devs[dev]->coproc->devc, COPR_MIDI)) < 0) |
devc | 511 | drivers/sound/mpu401.c | if (devc->shared_irq == 0) |
devc | 512 | drivers/sound/mpu401.c | snd_release_irq (devc->irq); |
devc | 518 | drivers/sound/mpu401.c | set_uart_mode (dev, devc, 1); |
devc | 519 | drivers/sound/mpu401.c | devc->mode = MODE_MIDI; |
devc | 520 | drivers/sound/mpu401.c | devc->synthno = 0; |
devc | 522 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 524 | drivers/sound/mpu401.c | devc->inputintr = input; |
devc | 525 | drivers/sound/mpu401.c | devc->opened = mode; |
devc | 533 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 535 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 537 | drivers/sound/mpu401.c | if (devc->uart_mode) |
devc | 538 | drivers/sound/mpu401.c | reset_mpu401 (devc); /* |
devc | 541 | drivers/sound/mpu401.c | devc->mode = 0; |
devc | 543 | drivers/sound/mpu401.c | if (devc->shared_irq == 0) |
devc | 544 | drivers/sound/mpu401.c | snd_release_irq (devc->irq); |
devc | 545 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 548 | drivers/sound/mpu401.c | midi_devs[dev]->coproc->close (midi_devs[dev]->coproc->devc, COPR_MIDI); |
devc | 549 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 558 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 560 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 567 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 569 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 577 | drivers/sound/mpu401.c | for (timeout = 3000; timeout > 0 && !output_ready (devc->base); timeout--); |
devc | 580 | drivers/sound/mpu401.c | if (!output_ready (devc->base)) |
devc | 587 | drivers/sound/mpu401.c | write_data (devc->base, midi_byte); |
devc | 598 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 600 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 602 | drivers/sound/mpu401.c | if (devc->uart_mode) /* |
devc | 613 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 614 | drivers/sound/mpu401.c | mpu401_input_loop (devc); |
devc | 631 | drivers/sound/mpu401.c | if (!output_ready (devc->base)) |
devc | 637 | drivers/sound/mpu401.c | write_command (devc->base, cmd->cmd); |
devc | 640 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 642 | drivers/sound/mpu401.c | if (mpu_input_scanner (devc, read_data (devc->base)) == MPU_ACK) |
devc | 656 | drivers/sound/mpu401.c | for (timeout = 3000; timeout > 0 && !output_ready (devc->base); timeout--); |
devc | 674 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 676 | drivers/sound/mpu401.c | cmd->data[i] = read_data (devc->base); |
devc | 713 | drivers/sound/mpu401.c | struct mpu_config *devc = &dev_conf[dev]; |
devc | 715 | drivers/sound/mpu401.c | if (devc->uart_mode) |
devc | 757 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 759 | drivers/sound/mpu401.c | devc = &dev_conf[dev]; |
devc | 769 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 774 | drivers/sound/mpu401.c | set_uart_mode (dev, devc, !IOCTL_IN (arg)); |
devc | 816 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 823 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 848 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 857 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 866 | drivers/sound/mpu401.c | if (!devc->initialized) |
devc | 868 | drivers/sound/mpu401.c | if (mpu401_status (devc->base) == 0xff) /* Bus float */ |
devc | 873 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 876 | drivers/sound/mpu401.c | if (devc->opened) |
devc | 882 | drivers/sound/mpu401.c | devc->mode = MODE_SYNTH; |
devc | 883 | drivers/sound/mpu401.c | devc->synthno = dev; |
devc | 885 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 886 | drivers/sound/mpu401.c | irq2dev[devc->irq] = midi_dev; |
devc | 887 | drivers/sound/mpu401.c | if (devc->shared_irq == 0) |
devc | 888 | drivers/sound/mpu401.c | if ((err = snd_set_irq_handler (devc->irq, mpuintr, midi_devs[midi_dev]->info.name) < 0)) |
devc | 895 | drivers/sound/mpu401.c | open (midi_devs[midi_dev]->coproc->devc, COPR_MIDI)) < 0) |
devc | 897 | drivers/sound/mpu401.c | if (devc->shared_irq == 0) |
devc | 898 | drivers/sound/mpu401.c | snd_release_irq (devc->irq); |
devc | 904 | drivers/sound/mpu401.c | devc->opened = mode; |
devc | 905 | drivers/sound/mpu401.c | reset_mpu401 (devc); |
devc | 920 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 924 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 928 | drivers/sound/mpu401.c | if (devc->shared_irq == 0) |
devc | 929 | drivers/sound/mpu401.c | snd_release_irq (devc->irq); |
devc | 930 | drivers/sound/mpu401.c | devc->inputintr = NULL; |
devc | 933 | drivers/sound/mpu401.c | midi_devs[midi_dev]->coproc->close (midi_devs[midi_dev]->coproc->devc, COPR_MIDI); |
devc | 934 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 935 | drivers/sound/mpu401.c | devc->mode = 0; |
devc | 989 | drivers/sound/mpu401.c | mpu401_chk_version (struct mpu_config *devc) |
devc | 993 | drivers/sound/mpu401.c | devc->version = devc->revision = 0; |
devc | 1001 | drivers/sound/mpu401.c | devc->version = tmp; |
devc | 1005 | drivers/sound/mpu401.c | devc->version = 0; |
devc | 1008 | drivers/sound/mpu401.c | devc->revision = tmp; |
devc | 1017 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 1025 | drivers/sound/mpu401.c | devc = &dev_conf[num_midis]; |
devc | 1027 | drivers/sound/mpu401.c | devc->base = hw_config->io_base; |
devc | 1028 | drivers/sound/mpu401.c | devc->irq = hw_config->irq; |
devc | 1029 | drivers/sound/mpu401.c | devc->opened = 0; |
devc | 1030 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1031 | drivers/sound/mpu401.c | devc->initialized = 0; |
devc | 1032 | drivers/sound/mpu401.c | devc->version = 0; |
devc | 1033 | drivers/sound/mpu401.c | devc->revision = 0; |
devc | 1034 | drivers/sound/mpu401.c | devc->capabilities = 0; |
devc | 1035 | drivers/sound/mpu401.c | devc->timer_flag = 0; |
devc | 1036 | drivers/sound/mpu401.c | devc->m_busy = 0; |
devc | 1037 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 1038 | drivers/sound/mpu401.c | devc->shared_irq = hw_config->always_detect; |
devc | 1043 | drivers/sound/mpu401.c | if (!reset_mpu401 (devc)) |
devc | 1047 | drivers/sound/mpu401.c | mpu401_chk_version (devc); |
devc | 1048 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 1049 | drivers/sound/mpu401.c | mpu401_chk_version (devc); |
devc | 1053 | drivers/sound/mpu401.c | if (devc->version == 0) |
devc | 1061 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_INTLG; /* Supports intelligent mode */ |
devc | 1080 | drivers/sound/mpu401.c | if (devc->version == 0x20 && devc->revision >= 0x07) /* MusicQuest interface */ |
devc | 1082 | drivers/sound/mpu401.c | int ports = (devc->revision & 0x08) ? 32 : 16; |
devc | 1084 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_SMPTE | |
devc | 1087 | drivers/sound/mpu401.c | revision_char = (devc->revision == 0x7f) ? 'M' : ' '; |
devc | 1100 | drivers/sound/mpu401.c | revision_char = devc->revision ? devc->revision + '@' : ' '; |
devc | 1101 | drivers/sound/mpu401.c | if (devc->revision > ('Z' - '@')) |
devc | 1104 | drivers/sound/mpu401.c | devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_FSK; |
devc | 1107 | drivers/sound/mpu401.c | (devc->version & 0xf0) >> 4, |
devc | 1108 | drivers/sound/mpu401.c | devc->version & 0x0f, |
devc | 1112 | drivers/sound/mpu401.c | (devc->version & 0xf0) >> 4, |
devc | 1113 | drivers/sound/mpu401.c | devc->version & 0x0f, |
devc | 1121 | drivers/sound/mpu401.c | mpu401_synth_operations[num_midis].midi_dev = devc->devno = num_midis; |
devc | 1122 | drivers/sound/mpu401.c | mpu401_synth_operations[devc->devno].info = |
devc | 1123 | drivers/sound/mpu401.c | &mpu_synth_info[devc->devno]; |
devc | 1125 | drivers/sound/mpu401.c | if (devc->capabilities & MPU_CAP_INTLG) /* Has timer */ |
devc | 1128 | drivers/sound/mpu401.c | irq2dev[devc->irq] = num_midis; |
devc | 1129 | drivers/sound/mpu401.c | midi_devs[num_midis++] = &mpu401_midi_operations[devc->devno]; |
devc | 1134 | drivers/sound/mpu401.c | reset_mpu401 (struct mpu_config *devc) |
devc | 1147 | drivers/sound/mpu401.c | timeout_limit = devc->initialized ? 30000 : 100000; |
devc | 1148 | drivers/sound/mpu401.c | devc->initialized = 1; |
devc | 1153 | drivers/sound/mpu401.c | ok = output_ready (devc->base); |
devc | 1155 | drivers/sound/mpu401.c | write_command (devc->base, MPU_RESET); /* |
devc | 1167 | drivers/sound/mpu401.c | if (input_avail (devc->base)) |
devc | 1168 | drivers/sound/mpu401.c | if (read_data (devc->base) == MPU_ACK) |
devc | 1175 | drivers/sound/mpu401.c | devc->m_state = ST_INIT; |
devc | 1176 | drivers/sound/mpu401.c | devc->m_ptr = 0; |
devc | 1177 | drivers/sound/mpu401.c | devc->m_left = 0; |
devc | 1178 | drivers/sound/mpu401.c | devc->last_status = 0; |
devc | 1179 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1185 | drivers/sound/mpu401.c | set_uart_mode (int dev, struct mpu_config *devc, int arg) |
devc | 1188 | drivers/sound/mpu401.c | if (!arg && devc->version == 0) |
devc | 1193 | drivers/sound/mpu401.c | if ((devc->uart_mode == 0) == (arg == 0)) |
devc | 1198 | drivers/sound/mpu401.c | reset_mpu401 (devc); /* This exits the uart mode */ |
devc | 1204 | drivers/sound/mpu401.c | printk ("MPU%d: Can't enter UART mode\n", devc->devno); |
devc | 1205 | drivers/sound/mpu401.c | devc->uart_mode = 0; |
devc | 1209 | drivers/sound/mpu401.c | devc->uart_mode = arg; |
devc | 1653 | drivers/sound/mpu401.c | timer_ext_event (struct mpu_config *devc, int event, int parm) |
devc | 1655 | drivers/sound/mpu401.c | int midi_dev = devc->devno; |
devc | 1657 | drivers/sound/mpu401.c | if (!devc->timer_flag) |
devc | 1711 | drivers/sound/mpu401.c | struct mpu_config *devc; |
devc | 1714 | drivers/sound/mpu401.c | devc = &dev_conf[midi_dev]; |
devc | 1734 | drivers/sound/mpu401.c | if (devc->version < 0x20) /* Original MPU-401 */ |
devc | 1746 | drivers/sound/mpu401.c | if (devc->revision) |
devc | 1749 | drivers/sound/mpu401.c | if (devc->revision & 0x02) |
devc | 1753 | drivers/sound/mpu401.c | if (devc->revision & 0x04) |
devc | 1757 | drivers/sound/mpu401.c | if (devc->revision & 0x40) |
devc | 37 | drivers/sound/pss.c | #define REG(x) (devc->base+x) |
devc | 77 | drivers/sound/pss.c | static pss_config *devc = &pss_data; |
devc | 88 | drivers/sound/pss.c | devc->base = hw_config->io_base; |
devc | 89 | drivers/sound/pss.c | irq = devc->irq = hw_config->irq; |
devc | 90 | drivers/sound/pss.c | dma = devc->dma = hw_config->dma; |
devc | 92 | drivers/sound/pss.c | if (devc->base != 0x220 && devc->base != 0x240) |
devc | 93 | drivers/sound/pss.c | if (devc->base != 0x230 && devc->base != 0x250) /* Some cards use these */ |
devc | 106 | drivers/sound/pss.c | printk ("No PSS signature detected at 0x%x (0x%x)\n", devc->base, id); |
devc | 114 | drivers/sound/pss.c | set_irq (pss_config * devc, int dev, int irq) |
devc | 142 | drivers/sound/pss.c | set_io_base (pss_config * devc, int dev, int base) |
devc | 153 | drivers/sound/pss.c | set_dma (pss_config * devc, int dev, int dma) |
devc | 179 | drivers/sound/pss.c | pss_reset_dsp (pss_config * devc) |
devc | 194 | drivers/sound/pss.c | pss_put_dspword (pss_config * devc, unsigned short word) |
devc | 211 | drivers/sound/pss.c | pss_get_dspword (pss_config * devc, unsigned short *word) |
devc | 229 | drivers/sound/pss.c | pss_download_boot (pss_config * devc, unsigned char *block, int size, int flags) |
devc | 246 | drivers/sound/pss.c | pss_reset_dsp (devc); |
devc | 317 | drivers/sound/pss.c | devc->base = hw_config->io_base; |
devc | 318 | drivers/sound/pss.c | devc->irq = hw_config->irq; |
devc | 319 | drivers/sound/pss.c | devc->dma = hw_config->dma; |
devc | 335 | drivers/sound/pss.c | if (!set_irq (devc, CONF_PSS, devc->irq)) |
devc | 341 | drivers/sound/pss.c | if (!set_dma (devc, CONF_PSS, devc->dma)) |
devc | 361 | drivers/sound/pss.c | if (!set_io_base (devc, CONF_MIDI, hw_config->io_base)) |
devc | 367 | drivers/sound/pss.c | if (!set_irq (devc, CONF_MIDI, hw_config->irq)) |
devc | 379 | drivers/sound/pss.c | if (!pss_download_boot (devc, pss_synth, pss_synthLen, CPF_FIRST | CPF_LAST)) |
devc | 419 | drivers/sound/pss.c | if (!pss_download_boot (devc, pss_synth, pss_synthLen, CPF_FIRST | CPF_LAST)) |
devc | 442 | drivers/sound/pss.c | if (!pss_download_boot (devc, pss_synth, pss_synthLen, CPF_FIRST | CPF_LAST)) |
devc | 455 | drivers/sound/pss.c | if (!pss_download_boot (devc, buf->data, buf->len, buf->flags)) |
devc | 499 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d0)) |
devc | 505 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 511 | drivers/sound/pss.c | if (!pss_get_dspword (devc, &tmp)) |
devc | 534 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d1)) |
devc | 540 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 547 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 567 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d3)) |
devc | 573 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 580 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 587 | drivers/sound/pss.c | if (!pss_put_dspword (devc, tmp)) |
devc | 607 | drivers/sound/pss.c | if (!pss_put_dspword (devc, 0x00d2)) |
devc | 613 | drivers/sound/pss.c | if (!pss_put_dspword (devc, (unsigned short) (buf.parm1 & 0xffff))) |
devc | 619 | drivers/sound/pss.c | if (!pss_get_dspword (devc, &tmp)) /* Read msb */ |
devc | 627 | drivers/sound/pss.c | if (!pss_get_dspword (devc, &tmp)) /* Read lsb */ |
devc | 683 | drivers/sound/pss.c | if (!set_io_base (devc, CONF_WSS, hw_config->io_base)) |
devc | 689 | drivers/sound/pss.c | if (!set_irq (devc, CONF_WSS, hw_config->irq)) |
devc | 695 | drivers/sound/pss.c | if (!set_dma (devc, CONF_WSS, hw_config->dma)) |
devc | 68 | drivers/sound/sscape.c | #define PORT(name) (devc->base+name) |
devc | 97 | drivers/sound/sscape.c | static struct sscape_info *devc = &dev_info; |
devc | 119 | drivers/sound/sscape.c | sscape_read (struct sscape_info *devc, int reg) |
devc | 132 | drivers/sound/sscape.c | sscape_write (struct sscape_info *devc, int reg, int data) |
devc | 143 | drivers/sound/sscape.c | host_open (struct sscape_info *devc) |
devc | 149 | drivers/sound/sscape.c | host_close (struct sscape_info *devc) |
devc | 155 | drivers/sound/sscape.c | host_write (struct sscape_info *devc, unsigned char *data, int count) |
devc | 188 | drivers/sound/sscape.c | host_read (struct sscape_info *devc) |
devc | 218 | drivers/sound/sscape.c | host_command1 (struct sscape_info *devc, int cmd) |
devc | 224 | drivers/sound/sscape.c | return host_write (devc, buf, 1); |
devc | 228 | drivers/sound/sscape.c | host_command2 (struct sscape_info *devc, int cmd, int parm1) |
devc | 235 | drivers/sound/sscape.c | return host_write (devc, buf, 2); |
devc | 239 | drivers/sound/sscape.c | host_command3 (struct sscape_info *devc, int cmd, int parm1, int parm2) |
devc | 247 | drivers/sound/sscape.c | return host_write (devc, buf, 3); |
devc | 251 | drivers/sound/sscape.c | set_mt32 (struct sscape_info *devc, int value) |
devc | 253 | drivers/sound/sscape.c | host_open (devc); |
devc | 254 | drivers/sound/sscape.c | host_command2 (devc, CMD_SET_MT32, |
devc | 256 | drivers/sound/sscape.c | if (host_read (devc) != CMD_ACK) |
devc | 260 | drivers/sound/sscape.c | host_close (devc); |
devc | 264 | drivers/sound/sscape.c | get_board_type (struct sscape_info *devc) |
devc | 268 | drivers/sound/sscape.c | host_open (devc); |
devc | 269 | drivers/sound/sscape.c | if (!host_command1 (devc, CMD_GET_BOARD_TYPE)) |
devc | 272 | drivers/sound/sscape.c | tmp = host_read (devc); |
devc | 273 | drivers/sound/sscape.c | host_close (devc); |
devc | 283 | drivers/sound/sscape.c | printk ("sscapeintr(0x%02x)\n", (bits = sscape_read (devc, GA_INTSTAT_REG))); |
devc | 291 | drivers/sound/sscape.c | printk ("SSCAPE: Host interrupt, data=%02x\n", host_read (devc)); |
devc | 300 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, 0x00); /* Disable all interrupts */ |
devc | 309 | drivers/sound/sscape.c | tmp = sscape_read (devc, GA_INTENA_REG); |
devc | 310 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, (~bits & 0x0e) | (tmp & 0xf1)); |
devc | 315 | drivers/sound/sscape.c | sscape_enable_intr (struct sscape_info *devc, unsigned intr_bits) |
devc | 319 | drivers/sound/sscape.c | temp = orig = sscape_read (devc, GA_INTENA_REG); |
devc | 326 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, temp); |
devc | 330 | drivers/sound/sscape.c | sscape_disable_intr (struct sscape_info *devc, unsigned intr_bits) |
devc | 334 | drivers/sound/sscape.c | temp = orig = sscape_read (devc, GA_INTENA_REG); |
devc | 341 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, temp); |
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 | 413 | drivers/sound/sscape.c | struct sscape_info *devc = dev_info; |
devc | 417 | drivers/sound/sscape.c | if (devc->dma_allocated) |
devc | 419 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAA_REG, 0x20); /* DMA channel disabled */ |
devc | 421 | drivers/sound/sscape.c | DMAbuf_close_dma (devc->my_audiodev); |
devc | 423 | drivers/sound/sscape.c | devc->dma_allocated = 0; |
devc | 437 | drivers/sound/sscape.c | sscape_download_boot (struct sscape_info *devc, unsigned char *block, int size, int flag) |
devc | 451 | drivers/sound/sscape.c | if (devc->dma_allocated == 0) |
devc | 454 | drivers/sound/sscape.c | if (DMAbuf_open_dma (devc->my_audiodev) < 0) |
devc | 461 | drivers/sound/sscape.c | devc->dma_allocated = 1; |
devc | 465 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, |
devc | 466 | drivers/sound/sscape.c | (temp = sscape_read (devc, GA_HMCTL_REG)) & 0x3f); /*Reset */ |
devc | 469 | drivers/sound/sscape.c | sscape_read (devc, GA_HMCTL_REG); /* Delay */ |
devc | 472 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, |
devc | 473 | drivers/sound/sscape.c | (temp = sscape_read (devc, GA_HMCTL_REG)) | 0x80); |
devc | 479 | drivers/sound/sscape.c | memcpy (audio_devs[devc->my_audiodev]->dmap->raw_buf[0], block, size); |
devc | 483 | drivers/sound/sscape.c | do_dma (devc, SSCAPE_DMA_A, |
devc | 484 | drivers/sound/sscape.c | audio_devs[devc->my_audiodev]->dmap->raw_buf_phys[0], |
devc | 498 | drivers/sound/sscape.c | clear_dma_ff (devc->dma); |
devc | 499 | drivers/sound/sscape.c | if ((resid = get_dma_residue (devc->dma)) == 0) |
devc | 515 | drivers/sound/sscape.c | temp = sscape_read (devc, GA_HMCTL_REG); |
devc | 517 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, temp); /* Kickstart the board */ |
devc | 556 | drivers/sound/sscape.c | get_board_type (devc)); |
devc | 567 | drivers/sound/sscape.c | printk ("I%d = %02x (new value)\n", i, sscape_read (devc, i)); |
devc | 582 | drivers/sound/sscape.c | if (!sscape_download_boot (devc, buf->data, buf->len, buf->flags)) |
devc | 636 | drivers/sound/sscape.c | sscape_info *devc = (sscape_info *) audio_devs[dev]->devc; |
devc | 639 | drivers/sound/sscape.c | if (devc->opened) |
devc | 645 | drivers/sound/sscape.c | if (devc->dma_allocated == 0) |
devc | 649 | drivers/sound/sscape.c | if ((err = DMAbuf_open_dma (devc->my_audiodev)) < 0) |
devc | 655 | drivers/sound/sscape.c | devc->dma_allocated = 1; |
devc | 658 | drivers/sound/sscape.c | devc->opened = 1; |
devc | 669 | drivers/sound/sscape.c | printk ("I%d = %02x\n", i, sscape_read (devc, i)); |
devc | 680 | drivers/sound/sscape.c | sscape_info *devc = (sscape_info *) audio_devs[dev]->devc; |
devc | 686 | drivers/sound/sscape.c | if (devc->dma_allocated) |
devc | 688 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAA_REG, 0x20); /* DMA channel disabled */ |
devc | 690 | drivers/sound/sscape.c | devc->dma_allocated = 0; |
devc | 692 | drivers/sound/sscape.c | devc->opened = 0; |
devc | 698 | drivers/sound/sscape.c | set_speed (sscape_info * devc, int arg) |
devc | 704 | drivers/sound/sscape.c | set_channels (sscape_info * devc, int arg) |
devc | 710 | drivers/sound/sscape.c | set_format (sscape_info * devc, int arg) |
devc | 718 | drivers/sound/sscape.c | sscape_info *devc = (sscape_info *) audio_devs[dev]->devc; |
devc | 724 | drivers/sound/sscape.c | return set_speed (devc, arg); |
devc | 725 | drivers/sound/sscape.c | return IOCTL_OUT (arg, set_speed (devc, IOCTL_IN (arg))); |
devc | 734 | drivers/sound/sscape.c | return set_channels (devc, arg + 1) - 1; |
devc | 735 | drivers/sound/sscape.c | return IOCTL_OUT (arg, set_channels (devc, IOCTL_IN (arg) + 1) - 1); |
devc | 739 | drivers/sound/sscape.c | return set_channels (devc, arg); |
devc | 740 | drivers/sound/sscape.c | return IOCTL_OUT (arg, set_channels (devc, IOCTL_IN (arg))); |
devc | 749 | drivers/sound/sscape.c | return set_format (devc, arg); |
devc | 750 | drivers/sound/sscape.c | return IOCTL_OUT (arg, set_format (devc, IOCTL_IN (arg))); |
devc | 882 | drivers/sound/sscape.c | sscape_write (devc, i, 0xf0); /* All interrupts enabled */ |
devc | 887 | drivers/sound/sscape.c | sscape_write (devc, i, 0x20); /* DMA channel disabled */ |
devc | 891 | drivers/sound/sscape.c | sscape_write (devc, i, 0xf0 | (irq_bits << 2) | irq_bits); |
devc | 895 | drivers/sound/sscape.c | sscape_write (devc, i, (regs[i] & 0x3f) | |
devc | 896 | drivers/sound/sscape.c | (sscape_read (devc, i) & 0xc0)); |
devc | 903 | drivers/sound/sscape.c | sscape_write (devc, i, |
devc | 904 | drivers/sound/sscape.c | (sscape_read (devc, i) & 0xf0) | 0x00); |
devc | 908 | drivers/sound/sscape.c | sscape_write (devc, i, regs[i]); |
devc | 922 | drivers/sound/sscape.c | printk ("I%d = %02x (new value)\n", i, sscape_read (devc, i)); |
devc | 950 | drivers/sound/sscape.c | audio_devs[my_dev]->devc = devc; |
devc | 951 | drivers/sound/sscape.c | devc->my_audiodev = my_dev; |
devc | 952 | drivers/sound/sscape.c | devc->opened = 0; |
devc | 957 | drivers/sound/sscape.c | sscape_write (devc, GA_INTENA_REG, 0x80); /* Master IRQ enable */ |
devc | 963 | drivers/sound/sscape.c | devc->ok = 1; |
devc | 972 | drivers/sound/sscape.c | devc->base = hw_config->io_base; |
devc | 973 | drivers/sound/sscape.c | devc->irq = hw_config->irq; |
devc | 974 | drivers/sound/sscape.c | devc->dma = hw_config->dma; |
devc | 999 | drivers/sound/sscape.c | if (sscape_read (devc, 0) & 0x0c) |
devc | 1002 | drivers/sound/sscape.c | if (sscape_read (devc, 1) & 0x0f) |
devc | 1005 | drivers/sound/sscape.c | if (sscape_read (devc, 5) & 0x0f) |
devc | 1017 | drivers/sound/sscape.c | printk ("I%d = %02x (old value)\n", i, sscape_read (devc, i)); |
devc | 1026 | drivers/sound/sscape.c | if (!((tmp = sscape_read (devc, GA_HMCTL_REG)) & 0xc0)) |
devc | 1028 | drivers/sound/sscape.c | sscape_write (devc, GA_HMCTL_REG, tmp | 0x80); |
devc | 1030 | drivers/sound/sscape.c | INB (devc->base + ODIE_ADDR); |
devc | 1045 | drivers/sound/sscape.c | if (devc->ok == 0) |
devc | 1085 | drivers/sound/sscape.c | sscape_write (devc, GA_DMACFG_REG, 0x50); |
devc | 1090 | drivers/sound/sscape.c | sscape_write (devc, GA_DMAB_REG, 0x20); |
devc | 1103 | drivers/sound/sscape.c | sscape_write (devc, GA_CDCFG_REG, 0x89 | (hw_config->dma << 4) | |
devc | 1106 | drivers/sound/sscape.c | if (hw_config->irq == devc->irq) |
devc | 1127 | drivers/sound/sscape.c | printk ("I%d = %02x\n", i, sscape_read (devc, i)); |