Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /*****************************************************************************/ |
2 | ||
3 | /* | |
4 | * es1371.c -- Creative Ensoniq ES1371. | |
5 | * | |
6 | * Copyright (C) 1998-2001, 2003 Thomas Sailer (t.sailer@alumni.ethz.ch) | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
21 | * | |
22 | * Special thanks to Ensoniq | |
23 | * | |
24 | * Supported devices: | |
25 | * /dev/dsp standard /dev/dsp device, (mostly) OSS compatible | |
26 | * /dev/mixer standard /dev/mixer device, (mostly) OSS compatible | |
27 | * /dev/dsp1 additional DAC, like /dev/dsp, but outputs to mixer "SYNTH" setting | |
28 | * /dev/midi simple MIDI UART interface, no ioctl | |
29 | * | |
30 | * NOTE: the card does not have any FM/Wavetable synthesizer, it is supposed | |
31 | * to be done in software. That is what /dev/dac is for. By now (Q2 1998) | |
32 | * there are several MIDI to PCM (WAV) packages, one of them is timidity. | |
33 | * | |
34 | * Revision history | |
35 | * 04.06.1998 0.1 Initial release | |
36 | * Mixer stuff should be overhauled; especially optional AC97 mixer bits | |
37 | * should be detected. This results in strange behaviour of some mixer | |
38 | * settings, like master volume and mic. | |
39 | * 08.06.1998 0.2 First release using Alan Cox' soundcore instead of miscdevice | |
40 | * 03.08.1998 0.3 Do not include modversions.h | |
41 | * Now mixer behaviour can basically be selected between | |
42 | * "OSS documented" and "OSS actual" behaviour | |
43 | * 31.08.1998 0.4 Fix realplayer problems - dac.count issues | |
44 | * 27.10.1998 0.5 Fix joystick support | |
45 | * -- Oliver Neukum (c188@org.chemie.uni-muenchen.de) | |
46 | * 10.12.1998 0.6 Fix drain_dac trying to wait on not yet initialized DMA | |
47 | * 23.12.1998 0.7 Fix a few f_file & FMODE_ bugs | |
48 | * Don't wake up app until there are fragsize bytes to read/write | |
49 | * 06.01.1999 0.8 remove the silly SA_INTERRUPT flag. | |
50 | * hopefully killed the egcs section type conflict | |
51 | * 12.03.1999 0.9 cinfo.blocks should be reset after GETxPTR ioctl. | |
52 | * reported by Johan Maes <joma@telindus.be> | |
53 | * 22.03.1999 0.10 return EAGAIN instead of EBUSY when O_NONBLOCK | |
54 | * read/write cannot be executed | |
55 | * 07.04.1999 0.11 implemented the following ioctl's: SOUND_PCM_READ_RATE, | |
56 | * SOUND_PCM_READ_CHANNELS, SOUND_PCM_READ_BITS; | |
57 | * Alpha fixes reported by Peter Jones <pjones@redhat.com> | |
58 | * Another Alpha fix (wait_src_ready in init routine) | |
59 | * reported by "Ivan N. Kokshaysky" <ink@jurassic.park.msu.ru> | |
60 | * Note: joystick address handling might still be wrong on archs | |
61 | * other than i386 | |
62 | * 15.06.1999 0.12 Fix bad allocation bug. | |
63 | * Thanks to Deti Fliegl <fliegl@in.tum.de> | |
64 | * 28.06.1999 0.13 Add pci_set_master | |
65 | * 03.08.1999 0.14 adapt to Linus' new __setup/__initcall | |
66 | * added kernel command line option "es1371=joystickaddr" | |
67 | * removed CONFIG_SOUND_ES1371_JOYPORT_BOOT kludge | |
68 | * 10.08.1999 0.15 (Re)added S/PDIF module option for cards revision >= 4. | |
69 | * Initial version by Dave Platt <dplatt@snulbug.mtview.ca.us>. | |
70 | * module_init/__setup fixes | |
71 | * 08.16.1999 0.16 Joe Cotellese <joec@ensoniq.com> | |
72 | * Added detection for ES1371 revision ID so that we can | |
73 | * detect the ES1373 and later parts. | |
74 | * added AC97 #defines for readability | |
75 | * added a /proc file system for dumping hardware state | |
76 | * updated SRC and CODEC w/r functions to accommodate bugs | |
77 | * in some versions of the ES137x chips. | |
78 | * 31.08.1999 0.17 add spin_lock_init | |
79 | * replaced current->state = x with set_current_state(x) | |
80 | * 03.09.1999 0.18 change read semantics for MIDI to match | |
81 | * OSS more closely; remove possible wakeup race | |
82 | * 21.10.1999 0.19 Round sampling rates, requested by | |
83 | * Kasamatsu Kenichi <t29w0267@ip.media.kyoto-u.ac.jp> | |
84 | * 27.10.1999 0.20 Added SigmaTel 3D enhancement string | |
85 | * Codec ID printing changes | |
86 | * 28.10.1999 0.21 More waitqueue races fixed | |
87 | * Joe Cotellese <joec@ensoniq.com> | |
88 | * Changed PCI detection routine so we can more easily | |
89 | * detect ES137x chip and derivatives. | |
90 | * 05.01.2000 0.22 Should now work with rev7 boards; patch by | |
91 | * Eric Lemar, elemar@cs.washington.edu | |
92 | * 08.01.2000 0.23 Prevent some ioctl's from returning bad count values on underrun/overrun; | |
93 | * Tim Janik's BSE (Bedevilled Sound Engine) found this | |
94 | * 07.02.2000 0.24 Use pci_alloc_consistent and pci_register_driver | |
95 | * 07.02.2000 0.25 Use ac97_codec | |
96 | * 01.03.2000 0.26 SPDIF patch by Mikael Bouillot <mikael.bouillot@bigfoot.com> | |
97 | * Use pci_module_init | |
98 | * 21.11.2000 0.27 Initialize dma buffers in poll, otherwise poll may return a bogus mask | |
99 | * 12.12.2000 0.28 More dma buffer initializations, patch from | |
100 | * Tjeerd Mulder <tjeerd.mulder@fujitsu-siemens.com> | |
101 | * 05.01.2001 0.29 Hopefully updates will not be required anymore when Creative bumps | |
102 | * the CT5880 revision. |