Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / dev / sound / isa / i386 / sound_calls.h
1 /*
2  *      DMA buffer calls
3  */
4
5 int DMAbuf_open(int dev, int mode);
6 int DMAbuf_release(int dev, int mode);
7 int DMAbuf_getwrbuffer(int dev, char **buf, int *size, int dontblock);
8 int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock);
9 int DMAbuf_rmchars(int dev, int buff_no, int c);
10 int DMAbuf_start_output(int dev, int buff_no, int l);
11 int DMAbuf_ioctl(int dev, u_int cmd, ioctl_arg arg, int local);
12 void DMAbuf_init(void);
13 int DMAbuf_start_dma (int dev, u_long physaddr, int count, int dma_mode);
14 int DMAbuf_open_dma (int dev);
15 void DMAbuf_close_dma (int dev);
16 void DMAbuf_reset_dma (int dev);
17 void DMAbuf_inputintr(int dev);
18 void DMAbuf_outputintr(int dev, int underflow_flag);
19 void DMAbuf_start_devices(u_int devmask);
20 #ifdef ALLOW_POLL
21 int DMAbuf_select(int dev, struct fileinfo *file, int sel_type, select_table * wait);
22 #endif
23
24 /*
25  *      System calls for /dev/dsp and /dev/audio
26  */
27
28 int audio_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
29 int audio_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
30 int audio_open (int dev, struct fileinfo *file);
31 void audio_release (int dev, struct fileinfo *file);
32 int audio_ioctl (int dev, struct fileinfo *file,
33            u_int cmd, ioctl_arg arg);
34 int audio_lseek (int dev, struct fileinfo *file, off_t offset, int orig);
35 /* long audio_init (void); */
36
37 #ifdef ALLOW_SELECT
38 int  audio_poll(int dev, struct fileinfo *file, int events, select_table * wait);
39 #endif
40
41 /*
42  *      System calls for the /dev/sequencer
43  */
44
45 int sequencer_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
46 int sequencer_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
47 int sequencer_open (int dev, struct fileinfo *file);
48 void sequencer_release (int dev, struct fileinfo *file);
49 int sequencer_ioctl (int dev, struct fileinfo *file,
50            u_int cmd, ioctl_arg arg);
51 int sequencer_lseek (int dev, struct fileinfo *file, off_t offset, int orig);
52 void sequencer_init (void);
53 void sequencer_timer(void  *dummy);
54 int note_to_freq(int note_num);
55 u_long compute_finetune(u_long base_freq, int bend, int range);
56 void seq_input_event(u_char *event, int len);
57 void seq_copy_to_input (u_char *event, int len);
58
59
60 /*
61  *      System calls for the /dev/midi
62  */
63
64 int MIDIbuf_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
65 int MIDIbuf_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
66 int MIDIbuf_open (int dev, struct fileinfo *file);
67 void MIDIbuf_release (int dev, struct fileinfo *file);
68 int MIDIbuf_ioctl (int dev, struct fileinfo *file,
69            u_int cmd, ioctl_arg arg);
70 int MIDIbuf_lseek (int dev, struct fileinfo *file, off_t offset, int orig);
71 void MIDIbuf_bytes_received(int dev, u_char *buf, int count);
72
73 /*
74  *
75  *      Misc calls from various sources
76  */
77
78 /*      From soundcard.c        */
79 void soundcard_init(void);
80 void tenmicrosec(int);
81 void request_sound_timer (int count);
82 void sound_stop_timer(void);
83 int snd_ioctl_return(int *addr, int value);
84 int snd_set_irq_handler (int int_lvl, void(*hndlr)(int), sound_os_info *osp);
85 void sound_dma_malloc(int dev);
86 void sound_dma_free(int dev);
87 void conf_printf(char *name, struct address_info *hw_config);
88 void conf_printf2(char *name, int base, int irq, int dma, int dma2);
89
90 /*      From sound_switch.c     */
91 int sound_read_sw (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
92 int sound_write_sw (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
93 int sound_open_sw (int dev, struct fileinfo *file);
94 void sound_release_sw (int dev, struct fileinfo *file);
95 int sound_ioctl_sw (int dev, struct fileinfo *file, u_int cmd, ioctl_arg arg);
96
97 /*      From sb_dsp.c   */
98 int sb_dsp_detect (struct address_info *hw_config);
99 void sb_dsp_init (struct address_info *hw_config);
100 void sb_dsp_disable_midi(void);
101 int sb_dsp_command (u_char val);
102 ointhand2_t sbintr;
103 int sb_reset_dsp (void);
104
105 /*      From sb16_dsp.c */
106 void sb16_dsp_interrupt (int irq);
107 void sb16_dsp_init(struct address_info *hw_config);
108 int sb16_dsp_detect(struct address_info *hw_config);
109
110 /*      From sb16_midi.c        */
111 void sb16midiintr (int unit);
112 void attach_sb16midi(struct address_info * hw_config);
113 int probe_sb16midi(struct address_info *hw_config);
114 void sb_midi_interrupt(int dummy);
115
116 /*      From sb_midi.c  */
117 void sb_midi_init(int model);
118
119 /*      From sb_mixer.c */
120 void sb_setmixer (u_int port, u_int value);
121 int sb_getmixer (u_int port);
122 void sb_mixer_set_stereo(int mode);
123 int sb_mixer_init(int major_model);
124
125 /*      From opl3.c     */
126 int opl3_detect (int ioaddr, sound_os_info *osp);
127 void opl3_init(int ioaddr, sound_os_info *osp);
128
129 /*      From sb_card.c  */
130 void attach_sb_card(struct address_info *hw_config);
131 int probe_sb(struct address_info *hw_config);
132
133 /*  From awe_wave.c  */
134 void  attach_awe(struct address_info *hw_config);
135 int probe_awe(struct address_info *hw_config);
136
137 /*      From adlib_card.c       */
138 void attach_adlib_card(struct address_info *hw_config);
139 int probe_adlib(struct address_info *hw_config);
140
141 /*      From pas_card.c */
142 void attach_pas_card(struct address_info *hw_config);
143 int probe_pas(struct address_info *hw_config);
144 ointhand2_t pasintr;
145 int pas_set_intr(int mask);
146 int pas_remove_intr(int mask);
147 u_char pas_read(int ioaddr);
148 void pas_write(u_char data, int ioaddr);
149
150 /*      From pas_audio.c */
151 void pas_pcm_interrupt(u_char status, int cause);
152 void pas_pcm_init(struct address_info *hw_config);
153
154 /*      From pas_mixer.c */
155 int pas_init_mixer(void);
156
157 /*      From pas_midi.c */
158 void pas_midi_init(void);
159 void pas_midi_interrupt(void);
160
161 /*      From gus_card.c */
162 void attach_gus_card(struct address_info * hw_config);
163 int probe_gus(struct address_info *hw_config);
164 int gus_set_midi_irq(int num);
165 ointhand2_t gusintr;
166 void attach_gus_db16(struct address_info * hw_config);
167 int probe_gus_db16(struct address_info *hw_config);
168
169 /*      From gus_wave.c */
170 int gus_wave_detect(int baseaddr);
171 void gus_wave_init(struct address_info *hw_config);
172 void gus_voice_irq(void);
173 u_char gus_read8 (int reg);
174 void gus_write8(int reg, u_int data);
175 void guswave_dma_irq(void);
176 void gus_delay(void);
177 int gus_default_mixer_ioctl (int dev, u_int cmd, ioctl_arg arg);
178 void gus_timer_command (u_int addr, u_int val);
179
180 /*      From gus_midi.c */
181 void gus_midi_init(void);
182 void gus_midi_interrupt(int dummy);
183
184 /*      From mpu401.c */
185 void attach_mpu401(struct address_info * hw_config);
186 int probe_mpu401(struct address_info *hw_config);
187 ointhand2_t mpuintr;
188
189 /*      From uart6850.c */
190 void attach_uart6850(struct address_info * hw_config);
191 ointhand2_t m6850intr;
192 int probe_uart6850(struct address_info *hw_config);
193
194 /*      From opl3.c */
195 void enable_opl3_mode(int left, int right, int both);
196
197 /*      From patmgr.c */
198 int pmgr_open(int dev);
199 void pmgr_release(int dev);
200 int pmgr_read (int dev, struct fileinfo *file, snd_rw_buf * buf, int count);
201 int pmgr_write (int dev, struct fileinfo *file, snd_rw_buf * buf, int count);
202 int pmgr_access(int dev, struct patmgr_info *rec);
203 int pmgr_inform(int dev, int event, u_long parm1, u_long parm2,
204                                     u_long parm3, u_long parm4);
205
206 /*      From ics2101.c */
207 void ics2101_mixer_init(void);
208
209 /*      From sound_timer.c */
210 void sound_timer_interrupt(void);
211 void sound_timer_syncinterval(u_int new_usecs);
212
213 /*      From ad1848.c */
214 void ad1848_init (char *name, int io_base, int irq, int dma_playback, int dma_capture, int share_dma, sound_os_info *osp);
215 ointhand2_t adintr;
216
217 int ad1848_detect (int io_base, int *flags, sound_os_info *osp);
218 #define AD_F_CS4231     0x0001  /* Returned if a CS4232 (or compatible) detected */
219 #define AD_F_CS4248     0x0001  /* Returned if a CS4248 (or compatible) detected */
220
221 void     ad1848_interrupt (int irq);
222 void attach_mss(struct address_info * hw_config);
223 int probe_mss(struct address_info *hw_config);
224 void attach_pnp_ad1848(struct address_info * hw_config);
225 int probe_pnp_ad1848(struct address_info *hw_config);
226
227 /*      From pss.c */
228 int probe_pss (struct address_info *hw_config);
229 void attach_pss (struct address_info *hw_config);
230 int probe_pss_mpu (struct address_info *hw_config);
231 void attach_pss_mpu (struct address_info *hw_config);
232 int probe_pss_mss (struct address_info *hw_config);
233 void attach_pss_mss (struct address_info *hw_config);
234
235 /*      From sscape.c */
236 int probe_sscape (struct address_info *hw_config);
237 void attach_sscape (struct address_info *hw_config);
238 int probe_ss_mss(struct address_info *hw_config);
239 void attach_ss_mss(struct address_info * hw_config);
240 ointhand2_t sscapeintr;
241
242 int pss_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
243 int pss_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
244 int pss_open (int dev, struct fileinfo *file);
245 void pss_release (int dev, struct fileinfo *file);
246 int pss_ioctl (int dev, struct fileinfo *file,
247            u_int cmd, ioctl_arg arg);
248 int pss_lseek (int dev, struct fileinfo *file, off_t offset, int orig);
249 void pss_init(void);
250
251 /* From aedsp16.c */
252 int InitAEDSP16_SBPRO(struct address_info *hw_config);
253 int InitAEDSP16_MSS(struct address_info *hw_config);
254 int InitAEDSP16_MPU401(struct address_info *hw_config);
255
256 /*      From midi_synth.c       */
257 void do_midi_msg (int synthno, u_char *msg, int mlen);
258
259 /*      From trix.c     */
260 void attach_trix_wss (struct address_info *hw_config);
261 int probe_trix_wss (struct address_info *hw_config);
262 void attach_trix_sb (struct address_info *hw_config);
263 int probe_trix_sb (struct address_info *hw_config);
264 void attach_trix_mpu (struct address_info *hw_config);
265 int probe_trix_mpu (struct address_info *hw_config);
266
267 /*      From mad16.c    */
268 void attach_mad16 (struct address_info *hw_config);
269 int probe_mad16 (struct address_info *hw_config);
270 void attach_mad16_mpu (struct address_info *hw_config);
271 int probe_mad16_mpu (struct address_info *hw_config);
272 int mad16_sb_dsp_detect (struct address_info *hw_config);
273 void mad16_sb_dsp_init (struct address_info *hw_config);
274
275 /* From cs4232.c */
276
277 int probe_cs4232 (struct address_info *hw_config);
278 void attach_cs4232 (struct address_info *hw_config);
279 int probe_cs4232_mpu (struct address_info *hw_config);
280 void attach_cs4232_mpu (struct address_info *hw_config);
281
282 /*      From maui.c */
283 void attach_maui(struct address_info * hw_config);
284 int probe_maui(struct address_info *hw_config);
285
286 /*      From sound_pnp.c */
287 void sound_pnp_init(void);
288 void sound_pnp_disconnect(void);
289
290 /*      From pcm86.c */
291 void attach_nss(struct address_info * hw_config);
292 int probe_nss(struct address_info *hw_config);
293 ointhand2_t nssintr;