Lines Matching refs:dev
79 dev.play_sample_size / 8 / \
80 dev.play_sample_rate / \
81 dev.play_channels)
84 dev.rec_sample_size / 8 / \
85 dev.rec_sample_rate / \
86 dev.rec_channels)
88 static multisound_dev_t dev; variable
98 static __inline__ int chk_send_dsp_cmd(multisound_dev_t *dev, register BYTE cmd) in chk_send_dsp_cmd() argument
100 if (msnd_send_dsp_cmd(dev, cmd) == 0) in chk_send_dsp_cmd()
103 return msnd_send_dsp_cmd(dev, cmd); in chk_send_dsp_cmd()
111 dev.last_playbank = -1; in reset_play_queue()
112 isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wHead); in reset_play_queue()
113 isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wTail); in reset_play_queue()
115 for (n = 0, lpDAQ = dev.base + DAPQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) { in reset_play_queue()
119 isa_writew(dev.play_sample_size, lpDAQ + DAQDS_wSampleSize); in reset_play_queue()
120 isa_writew(dev.play_channels, lpDAQ + DAQDS_wChannels); in reset_play_queue()
121 isa_writew(dev.play_sample_rate, lpDAQ + DAQDS_wSampleRate); in reset_play_queue()
133 dev.last_recbank = 2; in reset_record_queue()
134 isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DARQ + JQS_wHead); in reset_record_queue()
135 isa_writew(PCTODSP_OFFSET(dev.last_recbank * DAQDS__size), dev.DARQ + JQS_wTail); in reset_record_queue()
138 spin_lock_irqsave(&dev.lock, flags); in reset_record_queue()
139 outb(HPBLKSEL_1, dev.io + HP_BLKS); in reset_record_queue()
140 isa_memset_io(dev.base, 0, DAR_BUFF_SIZE * 3); in reset_record_queue()
141 outb(HPBLKSEL_0, dev.io + HP_BLKS); in reset_record_queue()
142 spin_unlock_irqrestore(&dev.lock, flags); in reset_record_queue()
144 for (n = 0, lpDAQ = dev.base + DARQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) { in reset_record_queue()
148 isa_writew(dev.rec_sample_size, lpDAQ + DAQDS_wSampleSize); in reset_record_queue()
149 isa_writew(dev.rec_channels, lpDAQ + DAQDS_wChannels); in reset_record_queue()
150 isa_writew(dev.rec_sample_rate, lpDAQ + DAQDS_wSampleRate); in reset_record_queue()
158 if (dev.mode & FMODE_WRITE) { in reset_queues()
159 msnd_fifo_make_empty(&dev.DAPF); in reset_queues()
162 if (dev.mode & FMODE_READ) { in reset_queues()
163 msnd_fifo_make_empty(&dev.DARF); in reset_queues()
173 lpDAQ = dev.base + DAPQ_DATA_BUFF; in dsp_set_format()
174 lpDARQ = dev.base + DARQ_DATA_BUFF; in dsp_set_format()
193 dev.play_sample_size = data; in dsp_set_format()
195 dev.rec_sample_size = data; in dsp_set_format()
203 size = dev.fifosize / 4; in dsp_get_frag_size()
216 lpDAQ = dev.base + DAPQ_DATA_BUFF; in dsp_ioctl()
217 lpDARQ = dev.base + DARQ_DATA_BUFF; in dsp_ioctl()
235 spin_lock_irqsave(&dev.lock, flags); in dsp_ioctl()
237 abinfo.bytes = dev.DAPF.n - dev.DAPF.len; in dsp_ioctl()
238 abinfo.fragstotal = dev.DAPF.n / abinfo.fragsize; in dsp_ioctl()
240 spin_unlock_irqrestore(&dev.lock, flags); in dsp_ioctl()
246 spin_lock_irqsave(&dev.lock, flags); in dsp_ioctl()
248 abinfo.bytes = dev.DARF.n - dev.DARF.len; in dsp_ioctl()
249 abinfo.fragstotal = dev.DARF.n / abinfo.fragsize; in dsp_ioctl()
251 spin_unlock_irqrestore(&dev.lock, flags); in dsp_ioctl()
255 dev.nresets = 0; in dsp_ioctl()
281 ? dev.play_sample_size in dsp_ioctl()
285 ? dev.rec_sample_size in dsp_ioctl()
293 if (!test_bit(F_DISABLE_WRITE_NDELAY, &dev.flags) && in dsp_ioctl()
295 dev.play_ndelay = 1; in dsp_ioctl()
297 dev.rec_ndelay = 1; in dsp_ioctl()
325 dev.play_sample_rate = data; in dsp_ioctl()
327 dev.rec_sample_rate = data; in dsp_ioctl()
368 dev.play_channels = data; in dsp_ioctl()
370 dev.rec_channels = data; in dsp_ioctl()
395 return (dev.left_levels[d] >> 8) * 100 / 0xff | in mixer_get()
396 (((dev.right_levels[d] >> 8) * 100 / 0xff) << 8); in mixer_get()
403 isa_writew((dev.left_levels[a] >> 1) * \
404 isa_readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff, \
405 dev.SMA + SMA_##b##Left); \
406 isa_writew((dev.right_levels[a] >> 1) * \
407 isa_readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff, \
408 dev.SMA + SMA_##b##Right);
411 isa_writeb((dev.left_levels[d] >> 8) * \
412 isa_readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff, \
413 dev.SMA + SMA_##s##Left); \
414 isa_writeb((dev.right_levels[d] >> 8) * \
415 isa_readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff, \
416 dev.SMA + SMA_##s##Right); \
417 if (msnd_send_word(&dev, 0, 0, ar) == 0) \
418 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ);
421 isa_writeb(dev.left_levels[d] >> 8, \
422 dev.SMA + SMA_##s##Left); \
423 isa_writeb(dev.right_levels[d] >> 8, \
424 dev.SMA + SMA_##s##Right); \
425 if (msnd_send_word(&dev, 0, 0, ar) == 0) \
426 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ);
445 dev.left_levels[d] = wLeft; in mixer_set()
446 dev.right_levels[d] = wRight; in mixer_set()
452 isa_writeb(bLeft, dev.SMA + SMA_bInPotPosLeft); in mixer_set()
453 isa_writeb(bRight, dev.SMA + SMA_bInPotPosRight); in mixer_set()
454 if (msnd_send_word(&dev, 0, 0, HDEXAR_IN_SET_POTS) == 0) in mixer_set()
455 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); in mixer_set()
460 isa_writeb(bLeft, dev.SMA + SMA_bMicPotPosLeft); in mixer_set()
461 isa_writeb(bRight, dev.SMA + SMA_bMicPotPosRight); in mixer_set()
462 if (msnd_send_word(&dev, 0, 0, HDEXAR_MIC_SET_POTS) == 0) in mixer_set()
463 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); in mixer_set()
467 isa_writew(wLeft, dev.SMA + SMA_wCurrMastVolLeft); in mixer_set()
468 isa_writew(wRight, dev.SMA + SMA_wCurrMastVolRight); in mixer_set()
514 if (dev.recsrc == recsrc) in set_recsrc()
515 return dev.recsrc; in set_recsrc()
518 dev.recsrc = 0; in set_recsrc()
521 dev.recsrc ^= recsrc; in set_recsrc()
524 if (dev.recsrc & SOUND_MASK_IMIX) { in set_recsrc()
525 if (msnd_send_word(&dev, 0, 0, HDEXAR_SET_ANA_IN) == 0) in set_recsrc()
526 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); in set_recsrc()
528 else if (dev.recsrc & SOUND_MASK_SYNTH) { in set_recsrc()
529 if (msnd_send_word(&dev, 0, 0, HDEXAR_SET_SYNTH_IN) == 0) in set_recsrc()
530 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); in set_recsrc()
532 else if ((dev.recsrc & SOUND_MASK_DIGITAL1) && test_bit(F_HAVEDIGITAL, &dev.flags)) { in set_recsrc()
533 if (msnd_send_word(&dev, 0, 0, HDEXAR_SET_DAT_IN) == 0) in set_recsrc()
534 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); in set_recsrc()
539 dev.recsrc = 0; in set_recsrc()
541 dev.recsrc = SOUND_MASK_IMIX; in set_recsrc()
542 if (msnd_send_word(&dev, 0, 0, HDEXAR_SET_ANA_IN) == 0) in set_recsrc()
543 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); in set_recsrc()
548 return dev.recsrc; in set_recsrc()
553 dev.recsrc = 0; in force_recsrc()
566 info.modify_counter = dev.mixer_mod_count; in mixer_ioctl()
573 dev.nresets = 0; in mixer_ioctl()
593 ++dev.mixer_mod_count; in mixer_ioctl()
598 val = dev.recsrc; in mixer_ioctl()
620 if (test_bit(F_HAVEDIGITAL, &dev.flags)) in mixer_ioctl()
651 if (minor == dev.dsp_minor) in dev_ioctl()
653 else if (minor == dev.mixer_minor) in dev_ioctl()
661 if (!(dev.mode & FMODE_WRITE) || !test_bit(F_WRITING, &dev.flags)) in dsp_write_flush()
663 set_bit(F_WRITEFLUSH, &dev.flags); in dsp_write_flush()
665 &dev.writeflush, in dsp_write_flush()
666 get_play_delay_jiffies(dev.DAPF.len)); in dsp_write_flush()
667 clear_bit(F_WRITEFLUSH, &dev.flags); in dsp_write_flush()
672 clear_bit(F_WRITING, &dev.flags); in dsp_write_flush()
677 if ((file ? file->f_mode : dev.mode) & FMODE_READ) { in dsp_halt()
678 clear_bit(F_READING, &dev.flags); in dsp_halt()
679 chk_send_dsp_cmd(&dev, HDEX_RECORD_STOP); in dsp_halt()
680 msnd_disable_irq(&dev); in dsp_halt()
683 dev.mode &= ~FMODE_READ; in dsp_halt()
685 clear_bit(F_AUDIO_READ_INUSE, &dev.flags); in dsp_halt()
687 if ((file ? file->f_mode : dev.mode) & FMODE_WRITE) { in dsp_halt()
688 if (test_bit(F_WRITING, &dev.flags)) { in dsp_halt()
690 chk_send_dsp_cmd(&dev, HDEX_PLAY_STOP); in dsp_halt()
692 msnd_disable_irq(&dev); in dsp_halt()
695 dev.mode &= ~FMODE_WRITE; in dsp_halt()
697 clear_bit(F_AUDIO_WRITE_INUSE, &dev.flags); in dsp_halt()
709 if ((file ? file->f_mode : dev.mode) & FMODE_WRITE) { in dsp_open()
710 set_bit(F_AUDIO_WRITE_INUSE, &dev.flags); in dsp_open()
711 clear_bit(F_WRITING, &dev.flags); in dsp_open()
712 msnd_fifo_make_empty(&dev.DAPF); in dsp_open()
716 dev.mode |= FMODE_WRITE; in dsp_open()
718 msnd_enable_irq(&dev); in dsp_open()
720 if ((file ? file->f_mode : dev.mode) & FMODE_READ) { in dsp_open()
721 set_bit(F_AUDIO_READ_INUSE, &dev.flags); in dsp_open()
722 clear_bit(F_READING, &dev.flags); in dsp_open()
723 msnd_fifo_make_empty(&dev.DARF); in dsp_open()
727 dev.mode |= FMODE_READ; in dsp_open()
729 msnd_enable_irq(&dev); in dsp_open()
736 dev.play_sample_size = DEFSAMPLESIZE; in set_default_play_audio_parameters()
737 dev.play_sample_rate = DEFSAMPLERATE; in set_default_play_audio_parameters()
738 dev.play_channels = DEFCHANNELS; in set_default_play_audio_parameters()
743 dev.rec_sample_size = DEFSAMPLESIZE; in set_default_rec_audio_parameters()
744 dev.rec_sample_rate = DEFSAMPLERATE; in set_default_rec_audio_parameters()
745 dev.rec_channels = DEFCHANNELS; in set_default_rec_audio_parameters()
759 if (minor == dev.dsp_minor) { in dev_open()
761 test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || in dev_open()
763 test_bit(F_AUDIO_READ_INUSE, &dev.flags))) in dev_open()
767 dev.nresets = 0; in dev_open()
770 if (!test_bit(F_DISABLE_WRITE_NDELAY, &dev.flags)) in dev_open()
771 dev.play_ndelay = (file->f_flags & O_NDELAY) ? 1 : 0; in dev_open()
773 dev.play_ndelay = 0; in dev_open()
777 dev.rec_ndelay = (file->f_flags & O_NDELAY) ? 1 : 0; in dev_open()
781 else if (minor == dev.mixer_minor) { in dev_open()
795 if (minor == dev.dsp_minor) in dev_release()
797 else if (minor == dev.mixer_minor) { in dev_release()
812 wTmp = isa_readw(dev.DARQ + JQS_wTail) + PCTODSP_OFFSET(DAQDS__size); in pack_DARQ_to_DARF()
813 if (wTmp > isa_readw(dev.DARQ + JQS_wSize)) in pack_DARQ_to_DARF()
815 while (wTmp == isa_readw(dev.DARQ + JQS_wHead) && timeout--) in pack_DARQ_to_DARF()
817 isa_writew(wTmp, dev.DARQ + JQS_wTail); in pack_DARQ_to_DARF()
820 DAQD = bank * DAQDS__size + dev.base + DARQ_DATA_BUFF; in pack_DARQ_to_DARF()
827 outb(HPBLKSEL_1, dev.io + HP_BLKS); in pack_DARQ_to_DARF()
829 &dev.DARF, in pack_DARQ_to_DARF()
830 (char *)(dev.base + bank * DAR_BUFF_SIZE), in pack_DARQ_to_DARF()
832 outb(HPBLKSEL_0, dev.io + HP_BLKS); in pack_DARQ_to_DARF()
843 DAPQ_tail = isa_readw(dev.DAPQ + JQS_wTail); in pack_DAPF_to_DAPQ()
844 while (DAPQ_tail != isa_readw(dev.DAPQ + JQS_wHead) || start) { in pack_DAPF_to_DAPQ()
852 spin_lock_irqsave(&dev.lock, flags); in pack_DAPF_to_DAPQ()
854 &dev.DAPF, in pack_DAPF_to_DAPQ()
855 (char *)(dev.base + bank_num * DAP_BUFF_SIZE), in pack_DAPF_to_DAPQ()
857 spin_unlock_irqrestore(&dev.lock, flags); in pack_DAPF_to_DAPQ()
860 &dev.DAPF, in pack_DAPF_to_DAPQ()
861 (char *)(dev.base + bank_num * DAP_BUFF_SIZE), in pack_DAPF_to_DAPQ()
871 DAQD = bank_num * DAQDS__size + dev.base + DAPQ_DATA_BUFF; in pack_DAPF_to_DAPQ()
879 isa_writew(DAPQ_tail, dev.DAPQ + JQS_wTail); in pack_DAPF_to_DAPQ()
881 msnd_send_dsp_cmd(&dev, HDEX_PLAY_START); in pack_DAPF_to_DAPQ()
903 spin_lock_irqsave(&dev.lock, flags); in dsp_read()
904 n = msnd_fifo_read(&dev.DARF, page, k); in dsp_read()
905 spin_unlock_irqrestore(&dev.lock, flags); in dsp_read()
916 if (!test_bit(F_READING, &dev.flags) && dev.mode & FMODE_READ) { in dsp_read()
917 dev.last_recbank = -1; in dsp_read()
918 if (chk_send_dsp_cmd(&dev, HDEX_RECORD_START) == 0) in dsp_read()
919 set_bit(F_READING, &dev.flags); in dsp_read()
922 if (dev.rec_ndelay) { in dsp_read()
928 set_bit(F_READBLOCK, &dev.flags); in dsp_read()
930 &dev.readblock, in dsp_read()
932 clear_bit(F_READING, &dev.flags); in dsp_read()
933 clear_bit(F_READBLOCK, &dev.flags); in dsp_read()
966 spin_lock_irqsave(&dev.lock, flags); in dsp_write()
967 n = msnd_fifo_write(&dev.DAPF, page, k); in dsp_write()
968 spin_unlock_irqrestore(&dev.lock, flags); in dsp_write()
975 if (!test_bit(F_WRITING, &dev.flags) && (dev.mode & FMODE_WRITE)) { in dsp_write()
976 dev.last_playbank = -1; in dsp_write()
978 set_bit(F_WRITING, &dev.flags); in dsp_write()
981 if (dev.play_ndelay) { in dsp_write()
987 set_bit(F_WRITEBLOCK, &dev.flags); in dsp_write()
989 &dev.writeblock, in dsp_write()
991 clear_bit(F_WRITEBLOCK, &dev.flags); in dsp_write()
1006 if (minor == dev.dsp_minor) in dev_read()
1015 if (minor == dev.dsp_minor) in dev_write()
1025 if (dev.last_playbank == LOBYTE(wMessage) || !test_bit(F_WRITING, &dev.flags)) in eval_dsp_msg()
1027 dev.last_playbank = LOBYTE(wMessage); in eval_dsp_msg()
1030 if (!test_bit(F_WRITEBLOCK, &dev.flags)) { in eval_dsp_msg()
1031 if (test_and_clear_bit(F_WRITEFLUSH, &dev.flags)) in eval_dsp_msg()
1032 wake_up_interruptible(&dev.writeflush); in eval_dsp_msg()
1034 clear_bit(F_WRITING, &dev.flags); in eval_dsp_msg()
1037 if (test_bit(F_WRITEBLOCK, &dev.flags)) in eval_dsp_msg()
1038 wake_up_interruptible(&dev.writeblock); in eval_dsp_msg()
1042 if (dev.last_recbank == LOBYTE(wMessage)) in eval_dsp_msg()
1044 dev.last_recbank = LOBYTE(wMessage); in eval_dsp_msg()
1046 pack_DARQ_to_DARF(dev.last_recbank); in eval_dsp_msg()
1048 if (test_bit(F_READBLOCK, &dev.flags)) in eval_dsp_msg()
1049 wake_up_interruptible(&dev.readblock); in eval_dsp_msg()
1059 clear_bit(F_WRITING, &dev.flags); in eval_dsp_msg()
1064 clear_bit(F_READING, &dev.flags); in eval_dsp_msg()
1075 if (dev.midi_in_interrupt) in eval_dsp_msg()
1076 (*dev.midi_in_interrupt)(&dev); in eval_dsp_msg()
1088 inb(dev.io + HP_RXL); in intr()
1091 while (isa_readw(dev.DSPQ + JQS_wTail) != isa_readw(dev.DSPQ + JQS_wHead)) { in intr()
1094 eval_dsp_msg(isa_readw(dev.pwDSPQData + 2*isa_readw(dev.DSPQ + JQS_wHead))); in intr()
1096 if ((wTmp = isa_readw(dev.DSPQ + JQS_wHead) + 1) > isa_readw(dev.DSPQ + JQS_wSize)) in intr()
1097 isa_writew(0, dev.DSPQ + JQS_wHead); in intr()
1099 isa_writew(wTmp, dev.DSPQ + JQS_wHead); in intr()
1116 outb(HPDSPRESET_ON, dev.io + HP_DSPR); in reset_dsp()
1119 dev.info = inb(dev.io + HP_INFO); in reset_dsp()
1121 outb(HPDSPRESET_OFF, dev.io + HP_DSPR); in reset_dsp()
1124 if (inb(dev.io + HP_CVR) == HP_CVR_DEF) in reset_dsp()
1141 if (check_region(dev.io, dev.numio)) { in probe_multisound()
1145 request_region(dev.io, dev.numio, "probing"); in probe_multisound()
1148 release_region(dev.io, dev.numio); in probe_multisound()
1153 dev.name = "Classic/Tahiti/Monterey"; in probe_multisound()
1156 switch (dev.info >> 4) { in probe_multisound()
1164 switch (dev.info & 0x7) { in probe_multisound()
1165 case 0x0: rev = "I"; dev.name = pin; break; in probe_multisound()
1166 case 0x1: rev = "F"; dev.name = pin; break; in probe_multisound()
1167 case 0x2: rev = "G"; dev.name = pin; break; in probe_multisound()
1168 case 0x3: rev = "H"; dev.name = pin; break; in probe_multisound()
1169 case 0x4: rev = "E"; dev.name = fiji; break; in probe_multisound()
1170 case 0x5: rev = "C"; dev.name = fiji; break; in probe_multisound()
1171 case 0x6: rev = "D"; dev.name = fiji; break; in probe_multisound()
1174 dev.name = pinfiji; in probe_multisound()
1180 dev.name, in probe_multisound()
1184 dev.io, dev.io + dev.numio - 1, in probe_multisound()
1185 dev.irq, in probe_multisound()
1186 dev.base, dev.base + 0x7fff); in probe_multisound()
1188 release_region(dev.io, dev.numio); in probe_multisound()
1199 outb(dev.memid, dev.io + HP_MEMM); in init_sma()
1201 outb(HPBLKSEL_0, dev.io + HP_BLKS); in init_sma()
1203 mastVolLeft = isa_readw(dev.SMA + SMA_wCurrMastVolLeft); in init_sma()
1204 mastVolRight = isa_readw(dev.SMA + SMA_wCurrMastVolRight); in init_sma()
1207 isa_memset_io(dev.base, 0, 0x8000); in init_sma()
1210 spin_lock_irqsave(&dev.lock, flags); in init_sma()
1211 outb(HPBLKSEL_1, dev.io + HP_BLKS); in init_sma()
1212 isa_memset_io(dev.base, 0, 0x8000); in init_sma()
1213 outb(HPBLKSEL_0, dev.io + HP_BLKS); in init_sma()
1214 spin_unlock_irqrestore(&dev.lock, flags); in init_sma()
1216 dev.pwDSPQData = (dev.base + DSPQ_DATA_BUFF); in init_sma()
1217 dev.pwMODQData = (dev.base + MODQ_DATA_BUFF); in init_sma()
1218 dev.pwMIDQData = (dev.base + MIDQ_DATA_BUFF); in init_sma()
1221 dev.SMA = dev.base + SMA_STRUCT_START; in init_sma()
1224 dev.DAPQ = dev.base + DAPQ_OFFSET; in init_sma()
1225 msnd_init_queue(dev.DAPQ, DAPQ_DATA_BUFF, DAPQ_BUFF_SIZE); in init_sma()
1228 dev.DARQ = dev.base + DARQ_OFFSET; in init_sma()
1229 msnd_init_queue(dev.DARQ, DARQ_DATA_BUFF, DARQ_BUFF_SIZE); in init_sma()
1232 dev.MODQ = dev.base + MODQ_OFFSET; in init_sma()
1233 msnd_init_queue(dev.MODQ, MODQ_DATA_BUFF, MODQ_BUFF_SIZE); in init_sma()
1236 dev.MIDQ = dev.base + MIDQ_OFFSET; in init_sma()
1237 msnd_init_queue(dev.MIDQ, MIDQ_DATA_BUFF, MIDQ_BUFF_SIZE); in init_sma()
1240 dev.DSPQ = dev.base + DSPQ_OFFSET; in init_sma()
1241 msnd_init_queue(dev.DSPQ, DSPQ_DATA_BUFF, DSPQ_BUFF_SIZE); in init_sma()
1245 isa_writew(1, dev.SMA + SMA_wCurrPlayFormat); in init_sma()
1246 isa_writew(dev.play_sample_size, dev.SMA + SMA_wCurrPlaySampleSize); in init_sma()
1247 isa_writew(dev.play_channels, dev.SMA + SMA_wCurrPlayChannels); in init_sma()
1248 isa_writew(dev.play_sample_rate, dev.SMA + SMA_wCurrPlaySampleRate); in init_sma()
1250 isa_writew(dev.play_sample_rate, dev.SMA + SMA_wCalFreqAtoD); in init_sma()
1251 isa_writew(mastVolLeft, dev.SMA + SMA_wCurrMastVolLeft); in init_sma()
1252 isa_writew(mastVolRight, dev.SMA + SMA_wCurrMastVolRight); in init_sma()
1254 isa_writel(0x00010000, dev.SMA + SMA_dwCurrPlayPitch); in init_sma()
1255 isa_writel(0x00000001, dev.SMA + SMA_dwCurrPlayRate); in init_sma()
1257 isa_writew(0x303, dev.SMA + SMA_wCurrInputTagBits); in init_sma()
1266 isa_writew(srate, dev.SMA + SMA_wCalFreqAtoD); in calibrate_adc()
1267 if (dev.calibrate_signal == 0) in calibrate_adc()
1268 isa_writew(isa_readw(dev.SMA + SMA_wCurrHostStatusFlags) in calibrate_adc()
1269 | 0x0001, dev.SMA + SMA_wCurrHostStatusFlags); in calibrate_adc()
1271 isa_writew(isa_readw(dev.SMA + SMA_wCurrHostStatusFlags) in calibrate_adc()
1272 & ~0x0001, dev.SMA + SMA_wCurrHostStatusFlags); in calibrate_adc()
1273 if (msnd_send_word(&dev, 0, 0, HDEXAR_CAL_A_TO_D) == 0 && in calibrate_adc()
1274 chk_send_dsp_cmd(&dev, HDEX_AUX_REQ) == 0) { in calibrate_adc()
1286 outb(HPBLKSEL_0, dev.io + HP_BLKS); in upload_dsp_code()
1301 isa_memcpy_toio(dev.base, PERMCODE, PERMCODESIZE); in upload_dsp_code()
1302 if (msnd_upload_host(&dev, INITCODE, INITCODESIZE) < 0) { in upload_dsp_code()
1323 outb(HPPRORESET_ON, dev.io + HP_PROR); in reset_proteus()
1325 outb(HPPRORESET_OFF, dev.io + HP_PROR); in reset_proteus()
1335 outb(HPWAITSTATE_0, dev.io + HP_WAIT); in initialize()
1336 outb(HPBITMODE_16, dev.io + HP_BITM); in initialize()
1354 while (isa_readw(dev.base)) { in initialize()
1371 if (test_bit(F_RESETTING, &dev.flags) || ++dev.nresets > 10) in dsp_full_reset()
1374 set_bit(F_RESETTING, &dev.flags); in dsp_full_reset()
1379 force_recsrc(dev.recsrc); in dsp_full_reset()
1381 clear_bit(F_RESETTING, &dev.flags); in dsp_full_reset()
1390 if ((err = request_irq(dev.irq, intr, 0, dev.name, &dev)) < 0) { in attach_multisound()
1391 printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", dev.irq); in attach_multisound()
1394 request_region(dev.io, dev.numio, dev.name); in attach_multisound()
1397 release_region(dev.io, dev.numio); in attach_multisound()
1398 free_irq(dev.irq, &dev); in attach_multisound()
1402 if ((err = msnd_register(&dev)) < 0) { in attach_multisound()
1404 release_region(dev.io, dev.numio); in attach_multisound()
1405 free_irq(dev.irq, &dev); in attach_multisound()
1409 if ((dev.dsp_minor = register_sound_dsp(&dev_fileops, -1)) < 0) { in attach_multisound()
1411 msnd_unregister(&dev); in attach_multisound()
1412 release_region(dev.io, dev.numio); in attach_multisound()
1413 free_irq(dev.irq, &dev); in attach_multisound()
1414 return dev.dsp_minor; in attach_multisound()
1417 if ((dev.mixer_minor = register_sound_mixer(&dev_fileops, -1)) < 0) { in attach_multisound()
1419 unregister_sound_mixer(dev.mixer_minor); in attach_multisound()
1420 msnd_unregister(&dev); in attach_multisound()
1421 release_region(dev.io, dev.numio); in attach_multisound()
1422 free_irq(dev.irq, &dev); in attach_multisound()
1423 return dev.mixer_minor; in attach_multisound()
1426 dev.ext_midi_dev = dev.hdr_midi_dev = -1; in attach_multisound()
1428 disable_irq(dev.irq); in attach_multisound()
1429 calibrate_adc(dev.play_sample_rate); in attach_multisound()
1439 release_region(dev.io, dev.numio); in unload_multisound()
1440 free_irq(dev.irq, &dev); in unload_multisound()
1441 unregister_sound_mixer(dev.mixer_minor); in unload_multisound()
1442 unregister_sound_dsp(dev.dsp_minor); in unload_multisound()
1443 msnd_unregister(&dev); in unload_multisound()
1785 case 5: dev.irqid = HPIRQ_5; break; in msnd_init()
1786 case 7: dev.irqid = HPIRQ_7; break; in msnd_init()
1787 case 9: dev.irqid = HPIRQ_9; break; in msnd_init()
1788 case 10: dev.irqid = HPIRQ_10; break; in msnd_init()
1789 case 11: dev.irqid = HPIRQ_11; break; in msnd_init()
1790 case 12: dev.irqid = HPIRQ_12; break; in msnd_init()
1794 case 0xb0000: dev.memid = HPMEM_B000; break; in msnd_init()
1795 case 0xc8000: dev.memid = HPMEM_C800; break; in msnd_init()
1796 case 0xd0000: dev.memid = HPMEM_D000; break; in msnd_init()
1797 case 0xd8000: dev.memid = HPMEM_D800; break; in msnd_init()
1798 case 0xe0000: dev.memid = HPMEM_E000; break; in msnd_init()
1799 case 0xe8000: dev.memid = HPMEM_E800; break; in msnd_init()
1852 dev.type = msndClassic; in msnd_init()
1854 dev.type = msndPinnacle; in msnd_init()
1856 dev.io = io; in msnd_init()
1857 dev.numio = DSP_NUMIO; in msnd_init()
1858 dev.irq = irq; in msnd_init()
1859 dev.base = mem; in msnd_init()
1860 dev.fifosize = fifosize * 1024; in msnd_init()
1861 dev.calibrate_signal = calibrate_signal ? 1 : 0; in msnd_init()
1862 dev.recsrc = 0; in msnd_init()
1863 dev.dspq_data_buff = DSPQ_DATA_BUFF; in msnd_init()
1864 dev.dspq_buff_size = DSPQ_BUFF_SIZE; in msnd_init()
1868 clear_bit(F_DISABLE_WRITE_NDELAY, &dev.flags); in msnd_init()
1870 set_bit(F_DISABLE_WRITE_NDELAY, &dev.flags); in msnd_init()
1873 set_bit(F_HAVEDIGITAL, &dev.flags); in msnd_init()
1875 init_waitqueue_head(&dev.writeblock); in msnd_init()
1876 init_waitqueue_head(&dev.readblock); in msnd_init()
1877 init_waitqueue_head(&dev.writeflush); in msnd_init()
1878 msnd_fifo_init(&dev.DAPF); in msnd_init()
1879 msnd_fifo_init(&dev.DARF); in msnd_init()
1880 spin_lock_init(&dev.lock); in msnd_init()
1881 printk(KERN_INFO LOGNAME ": %u byte audio FIFOs (x2)\n", dev.fifosize); in msnd_init()
1882 if ((err = msnd_fifo_alloc(&dev.DAPF, dev.fifosize)) < 0) { in msnd_init()
1887 if ((err = msnd_fifo_alloc(&dev.DARF, dev.fifosize)) < 0) { in msnd_init()
1889 msnd_fifo_free(&dev.DAPF); in msnd_init()
1895 msnd_fifo_free(&dev.DAPF); in msnd_init()
1896 msnd_fifo_free(&dev.DARF); in msnd_init()
1902 msnd_fifo_free(&dev.DAPF); in msnd_init()
1903 msnd_fifo_free(&dev.DARF); in msnd_init()
1913 msnd_fifo_free(&dev.DAPF); in msdn_cleanup()
1914 msnd_fifo_free(&dev.DARF); in msdn_cleanup()