Lines Matching +full:only +full:- +full:1 +full:- +full:8 +full:v

1 // SPDX-License-Identifier: GPL-2.0-only
11 * - added versioning
12 * - put in and populated the hardware_afmts field.
13 * [0.2] - put in SNDCTL_DSP_GETCAPS value.
14 * 01/02/2001 [0.3] - put in default hard/soft settings.
52 * to convert samples into the right frequency/encoding. They will only work on
61 * parameterized loop would only produce slower code. Feel free to optimize
66 * only in stereo is hardcoded in both of them!
166 count &= ~1; in ata_ct_law()
171 return -EFAULT; in ata_ct_law()
173 count--; in ata_ct_law()
189 count &= ~1; in ata_ct_s8()
192 return -EFAULT; in ata_ct_s8()
211 return -EFAULT; in ata_ct_u8()
213 count--; in ata_ct_u8()
217 count = min_t(unsigned long, userCount, frameLeft)>>1; in ata_ct_u8()
222 return -EFAULT; in ata_ct_u8()
225 count--; in ata_ct_u8()
241 count = min_t(unsigned long, userCount, frameLeft)>>1; in ata_ct_s16be()
246 return -EFAULT; in ata_ct_s16be()
250 count--; in ata_ct_s16be()
258 return -EFAULT; in ata_ct_s16be()
273 count = min_t(unsigned long, userCount, frameLeft)>>1; in ata_ct_u16be()
278 return -EFAULT; in ata_ct_u16be()
283 count--; in ata_ct_u16be()
293 return -EFAULT; in ata_ct_u16be()
296 count--; in ata_ct_u16be()
313 count = min_t(unsigned long, userCount, frameLeft)>>1; in ata_ct_s16le()
318 return -EFAULT; in ata_ct_s16le()
323 count--; in ata_ct_s16le()
333 return -EFAULT; in ata_ct_s16le()
337 count--; in ata_ct_s16le()
354 count = min_t(unsigned long, userCount, frameLeft)>>1; in ata_ct_u16le()
359 return -EFAULT; in ata_ct_u16le()
373 return -EFAULT; in ata_ct_u16le()
377 count--; in ata_ct_u16le()
407 return -EFAULT; in ata_ctx_law()
409 userCount--; in ata_ctx_law()
413 frameLeft--; in ata_ctx_law()
414 bal -= sSpeed; in ata_ctx_law()
426 return -EFAULT; in ata_ctx_law()
427 data = table[c] << 8; in ata_ctx_law()
429 return -EFAULT; in ata_ctx_law()
431 userCount -= 2; in ata_ctx_law()
435 frameLeft -= 2; in ata_ctx_law()
436 bal -= sSpeed; in ata_ctx_law()
441 used -= userCount; in ata_ctx_law()
442 *frameUsed += usedf-frameLeft; in ata_ctx_law()
466 return -EFAULT; in ata_ctx_s8()
467 userCount--; in ata_ctx_s8()
471 frameLeft--; in ata_ctx_s8()
472 bal -= sSpeed; in ata_ctx_s8()
483 return -EFAULT; in ata_ctx_s8()
485 userCount -= 2; in ata_ctx_s8()
489 frameLeft -= 2; in ata_ctx_s8()
490 bal -= sSpeed; in ata_ctx_s8()
495 used -= userCount; in ata_ctx_s8()
496 *frameUsed += usedf-frameLeft; in ata_ctx_s8()
520 return -EFAULT; in ata_ctx_u8()
522 userCount--; in ata_ctx_u8()
526 frameLeft--; in ata_ctx_u8()
527 bal -= sSpeed; in ata_ctx_u8()
538 return -EFAULT; in ata_ctx_u8()
541 userCount -= 2; in ata_ctx_u8()
545 frameLeft -= 2; in ata_ctx_u8()
546 bal -= sSpeed; in ata_ctx_u8()
551 used -= userCount; in ata_ctx_u8()
552 *frameUsed += usedf-frameLeft; in ata_ctx_u8()
576 return -EFAULT; in ata_ctx_s16be()
578 userCount -= 2; in ata_ctx_s16be()
583 frameLeft -= 4; in ata_ctx_s16be()
584 bal -= sSpeed; in ata_ctx_s16be()
595 return -EFAULT; in ata_ctx_s16be()
597 userCount -= 4; in ata_ctx_s16be()
601 frameLeft -= 4; in ata_ctx_s16be()
602 bal -= sSpeed; in ata_ctx_s16be()
607 used -= userCount; in ata_ctx_s16be()
608 *frameUsed += usedf-frameLeft; in ata_ctx_s16be()
632 return -EFAULT; in ata_ctx_u16be()
635 userCount -= 2; in ata_ctx_u16be()
640 frameLeft -= 4; in ata_ctx_u16be()
641 bal -= sSpeed; in ata_ctx_u16be()
652 return -EFAULT; in ata_ctx_u16be()
655 userCount -= 4; in ata_ctx_u16be()
659 frameLeft -= 4; in ata_ctx_u16be()
660 bal -= sSpeed; in ata_ctx_u16be()
665 used -= userCount; in ata_ctx_u16be()
666 *frameUsed += usedf-frameLeft; in ata_ctx_u16be()
690 return -EFAULT; in ata_ctx_s16le()
693 userCount -= 2; in ata_ctx_s16le()
698 frameLeft -= 4; in ata_ctx_s16le()
699 bal -= sSpeed; in ata_ctx_s16le()
710 return -EFAULT; in ata_ctx_s16le()
713 userCount -= 4; in ata_ctx_s16le()
717 frameLeft -= 4; in ata_ctx_s16le()
718 bal -= sSpeed; in ata_ctx_s16le()
723 used -= userCount; in ata_ctx_s16le()
724 *frameUsed += usedf-frameLeft; in ata_ctx_s16le()
748 return -EFAULT; in ata_ctx_u16le()
751 userCount -= 2; in ata_ctx_u16le()
756 frameLeft -= 4; in ata_ctx_u16le()
757 bal -= sSpeed; in ata_ctx_u16le()
768 return -EFAULT; in ata_ctx_u16le()
771 userCount -= 4; in ata_ctx_u16le()
775 frameLeft -= 4; in ata_ctx_u16le()
776 bal -= sSpeed; in ata_ctx_u16le()
781 used -= userCount; in ata_ctx_u16le()
782 *frameUsed += usedf-frameLeft; in ata_ctx_u16le()
852 st_mfp.tim_dt_a = 1; /* Cause interrupt after first event. */ in AtaIrqInit()
853 st_mfp.tim_ct_a = 8; /* Turn on event counting. */ in AtaIrqInit()
860 return 1; in AtaIrqInit()
873 #define TONE_VOXWARE_TO_DB(v) \ argument
874 (((v) < 0) ? -12 : ((v) > 100) ? 12 : ((v) - 50) * 6 / 25)
875 #define TONE_DB_TO_VOXWARE(v) (((v) * 25 + ((v) > 0 ? 5 : -5)) / 6 + 50) argument
903 atari_microwire_cmd(MW_LM1992_PSG_HIGH); /* mix in PSG signal 1:1 */ in TTSilence()
914 idx = -1; in TTInit()
919 if ((100 * abs(dmasound.soft.speed - freq[i]) / freq[i]) < catchRadius) in TTInit()
921 if (idx > -1) { in TTInit()
953 expand_bal = -dmasound.soft.speed; in TTInit()
959 /* TT sound DMA supports only 8bit modes */ in TTSetFormat()
974 dmasound.soft.size = 8; in TTSetFormat()
977 dmasound.dsp.size = 8; in TTSetFormat()
985 #define VOLUME_VOXWARE_TO_DB(v) \ argument
986 (((v) < 0) ? -40 : ((v) > 100) ? 0 : ((v) * 2) / 5 - 40)
987 #define VOLUME_DB_TO_VOXWARE(v) ((((v) + 40) * 5 + 1) / 2) argument
994 dmasound.volume_right = VOLUME_VOXWARE_TO_DB((volume & 0xff00) >> 8); in TTSetVolume()
997 (VOLUME_DB_TO_VOXWARE(dmasound.volume_right) << 8); in TTSetVolume()
1001 #define GAIN_VOXWARE_TO_DB(v) \ argument
1002 (((v) < 0) ? -80 : ((v) > 100) ? 0 : ((v) * 4) / 5 - 80)
1003 #define GAIN_DB_TO_VOXWARE(v) ((((v) + 80) * 5 + 1) / 4) argument
1028 tt_dmasnd.dac_src = 1; /* connect ADC to DAC, disconnect matrix */ in FalconSilence()
1036 const int freq[8] = {49170, 32780, 24585, 19668, 16390, 12292, 9834, 8195}; in FalconInit()
1040 idx = -1; in FalconInit()
1042 /* if we will tolerate 3% error 8000Hz->8195Hz (2.38%) would in FalconInit()
1046 if ((100 * abs(dmasound.soft.speed - freq[i]) / freq[i]) < catchRadius) in FalconInit()
1048 if (idx > -1) { in FalconInit()
1058 /* the Falcon can play 16bit samples only in stereo */ in FalconInit()
1059 dmasound.hard.stereo = 1; in FalconInit()
1065 divider = 1; in FalconInit()
1069 divider = 1; in FalconInit()
1096 tt_dmasnd.track_select = 0x0; /* play 1 track, track 1 */ in FalconInit()
1097 tt_dmasnd.cbar_src = 0x0001; /* DMA(25MHz) --> DAC */ in FalconInit()
1105 ((dmasound.hard.size == 8) ? in FalconInit()
1109 expand_bal = -dmasound.soft.speed; in FalconInit()
1116 /* Falcon sound DMA supports 8bit and 16bit modes */ in FalconSetFormat()
1125 size = 8; in FalconSetFormat()
1133 default: /* :-) */ in FalconSetFormat()
1134 size = 8; in FalconSetFormat()
1152 * i.e. output level from 0 to -22.5dB in -1.5dB steps.
1154 #define VOLUME_VOXWARE_TO_ATT(v) \ argument
1155 ((v) < 0 ? 15 : (v) > 100 ? 0 : 15 - (v) * 3 / 20)
1156 #define VOLUME_ATT_TO_VOXWARE(v) (100 - (v) * 20 / 3) argument
1162 dmasound.volume_right = VOLUME_VOXWARE_TO_ATT((volume & 0xff00) >> 8); in FalconSetVolume()
1163 tt_dmasnd.output_atten = dmasound.volume_left << 8 | dmasound.volume_right << 4; in FalconSetVolume()
1165 VOLUME_ATT_TO_VOXWARE(dmasound.volume_right) << 8; in FalconSetVolume()
1180 DMASNDSetEnd(virt_to_phys(end - 1) + 1); in AtaPlayNextFrame()
1182 /* Since only an even number of samples per frame can in AtaPlayNextFrame()
1184 write_sq.front = (write_sq.front+1) % write_sq.max_count; in AtaPlayNextFrame()
1194 * instead, may be 0, 1 (currently being played) or 2 (pre-programmed). in AtaPlay()
1200 * version of the driver as we benefit from having pre-programmed the in AtaPlay()
1202 * exact time of an interrupt but only at some time while the in AtaPlay()
1203 * pre-programmed frame is playing! in AtaPlay()
1217 if (write_sq.count == 1 && in AtaPlay()
1220 /* hmmm, the only existing frame is not in AtaPlay()
1226 AtaPlayNextFrame(1); in AtaPlay()
1227 if (write_sq.count == 1) { in AtaPlay()
1243 /* there's already a frame being played so we may only stuff in AtaPlay()
1250 /* hmmm, the only existing frame is not in AtaPlay()
1276 /* ++TeSche: Falcon only: ignore first irq because it comes in AtaInterrupt()
1293 * pre-programmed one is also finished because there has been a long in AtaInterrupt()
1299 write_sq.count--; in AtaInterrupt()
1300 write_sq.active--; in AtaInterrupt()
1304 write_sq_ignore_int = 1; in AtaInterrupt()
1312 if ((write_sq.active != 1) || (write_sq.count != 1)) in AtaInterrupt()
1315 * played. If write_sq.count==1 and write_sq.active==1 that in AtaInterrupt()
1316 * means the only remaining frame was already programmed in AtaInterrupt()
1339 #define RECLEVEL_VOXWARE_TO_GAIN(v) \ argument
1340 ((v) < 0 ? 0 : (v) > 100 ? 15 : (v) * 3 / 20)
1341 #define RECLEVEL_GAIN_TO_VOXWARE(v) (((v) * 20 + 2) / 3) argument
1357 dmasound.volume_left = (tt_dmasnd.output_atten & 0xf00) >> 8; in FalconMixerInit()
1392 return -EINVAL; in AtaMixerIoctl()
1411 (VOLUME_DB_TO_VOXWARE(dmasound.volume_right) << 8)); in TTMixerIoctl()
1444 VOLUME_ATT_TO_VOXWARE(dmasound.volume_right) << 8); in FalconMixerIoctl()
1451 RECLEVEL_VOXWARE_TO_GAIN(data >> 8 & 0xff); in FalconMixerIoctl()
1456 RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain & 0xf) << 8); in FalconMixerIoctl()
1469 write_sq_ignore_int = 1; in AtaSqOpen()
1476 len += sprintf(buffer+len, "\tvol left %ddB [-40... 0]\n", in TTStateInfo()
1478 len += sprintf(buffer+len, "\tvol right %ddB [-40... 0]\n", in TTStateInfo()
1480 len += sprintf(buffer+len, "\tbass %ddB [-12...+12]\n", in TTStateInfo()
1482 len += sprintf(buffer+len, "\ttreble %ddB [-12...+12]\n", in TTStateInfo()
1494 len += sprintf(buffer+len, "\tvol left %ddB [-22.5 ... 0]\n", in FalconStateInfo()
1496 len += sprintf(buffer+len, "\tvol right %ddB [-22.5 ... 0]\n", in FalconStateInfo()
1511 .size = 8,
1518 .size = 8,
1525 .size = 8,
1553 .version = ((DMASOUND_ATARI_REVISION<<8) | DMASOUND_ATARI_EDITION),
1554 .hardware_afmts = AFMT_S8, /* h'ware-supported formats *only* here */
1580 .version = ((DMASOUND_ATARI_REVISION<<8) | DMASOUND_ATARI_EDITION),
1581 .hardware_afmts = (AFMT_S8 | AFMT_S16_BE), /* h'ware-supported formats *only* here */
1596 is_falcon = 1; in dmasound_atari_init()
1603 return -ENODEV; in dmasound_atari_init()
1608 return -EBUSY; in dmasound_atari_init()
1611 return -ENODEV; in dmasound_atari_init()