This source file includes following definitions.
- attach_gus_card
- probe_gus
- gusintr
- probe_gus_db16
- attach_gus_db16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #include "sound_config.h"
31
32 #if defined(CONFIGURE_SOUNDCARD) && !defined(EXCLUDE_GUS)
33
34 #include "gus_hw.h"
35
36 void gusintr (INT_HANDLER_PARMS (irq, dummy));
37
38 int gus_base, gus_irq, gus_dma;
39 extern int gus_wave_volume;
40 extern int gus_pcm_volume;
41 extern int have_gus_max;
42
43 long
44 attach_gus_card (long mem_start, struct address_info *hw_config)
45 {
46 int io_addr;
47
48 snd_set_irq_handler (hw_config->irq, gusintr, "Gravis Ultrasound");
49
50 if (gus_wave_detect (hw_config->io_base))
51
52
53 {
54 mem_start = gus_wave_init (mem_start, hw_config->irq, hw_config->dma);
55 #ifndef EXCLUDE_MIDI
56 mem_start = gus_midi_init (mem_start);
57 #endif
58 #ifndef EXCLUDE_SEQUENCER
59 sound_timer_init (hw_config->io_base + 8);
60 #endif
61 return mem_start;
62 }
63
64 #ifndef EXCLUDE_GUS_IODETECT
65
66
67
68
69
70 for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10)
71 if (io_addr != hw_config->io_base)
72
73
74 if (gus_wave_detect (io_addr))
75 {
76 printk (" WARNING! GUS found at %x, config was %x ", io_addr, hw_config->io_base);
77 mem_start = gus_wave_init (mem_start, hw_config->irq, hw_config->dma);
78 #ifndef EXCLUDE_MIDI
79 mem_start = gus_midi_init (mem_start);
80 #endif
81 #ifndef EXCLUDE_SEQUENCER
82 sound_timer_init (io_addr + 8);
83 #endif
84 return mem_start;
85 }
86
87 #endif
88
89 return mem_start;
90
91
92 }
93
94 int
95 probe_gus (struct address_info *hw_config)
96 {
97 int io_addr;
98
99 if (gus_wave_detect (hw_config->io_base))
100 return 1;
101
102 #ifndef EXCLUDE_GUS_IODETECT
103
104
105
106
107
108 for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10)
109 if (io_addr != hw_config->io_base)
110
111
112 if (gus_wave_detect (io_addr))
113 return 1;
114
115 #endif
116
117 return 0;
118 }
119
120 void
121 gusintr (INT_HANDLER_PARMS (irq, dummy))
122 {
123 unsigned char src;
124
125 #ifdef linux
126 sti ();
127 #endif
128
129 #ifndef EXCLUDE_GUSMAX
130 if (have_gus_max)
131 ad1848_interrupt (INT_HANDLER_CALL (irq));
132 #endif
133
134 while (1)
135 {
136 if (!(src = INB (u_IrqStatus)))
137 return;
138
139 if (src & DMA_TC_IRQ)
140 {
141 guswave_dma_irq ();
142 }
143
144 if (src & (MIDI_TX_IRQ | MIDI_RX_IRQ))
145 {
146 #ifndef EXCLUDE_MIDI
147 gus_midi_interrupt (0);
148 #endif
149 }
150
151 if (src & (GF1_TIMER1_IRQ | GF1_TIMER2_IRQ))
152 {
153 #ifndef EXCLUDE_SEQUENCER
154 sound_timer_interrupt ();
155 #else
156 gus_write8 (0x45, 0);
157 #endif
158 }
159
160 if (src & (WAVETABLE_IRQ | ENVELOPE_IRQ))
161 {
162 gus_voice_irq ();
163 }
164 }
165 }
166
167 #endif
168
169
170
171
172 #if defined(CONFIGURE_SOUNDCARD) && !defined(EXCLUDE_GUS16)
173
174 int
175 probe_gus_db16 (struct address_info *hw_config)
176 {
177 return ad1848_detect (hw_config->io_base);
178 }
179
180 long
181 attach_gus_db16 (long mem_start, struct address_info *hw_config)
182 {
183 gus_pcm_volume = 100;
184 gus_wave_volume = 90;
185
186 ad1848_init ("GUS 16 bit sampling", hw_config->io_base,
187 hw_config->irq,
188 hw_config->dma,
189 hw_config->dma);
190 return mem_start;
191 }
192
193 #endif