30 #include <linux/time.h>
67 unsigned int valid_open_flags;
69 chip = substream->
rmidi->private_data;
73 if (chip->
open & ~valid_open_flags) {
74 spin_unlock_irqrestore(&chip->
open_lock, flags);
80 spin_unlock_irqrestore(&chip->
open_lock, flags);
85 spin_unlock_irqrestore(&chip->
open_lock, flags);
94 unsigned int valid_open_flags;
96 chip = substream->
rmidi->private_data;
100 if (chip->
open & ~valid_open_flags) {
101 spin_unlock_irqrestore(&chip->
open_lock, flags);
107 spin_unlock_irqrestore(&chip->
open_lock, flags);
112 spin_unlock_irqrestore(&chip->
open_lock, flags);
122 chip = substream->
rmidi->private_data;
127 spin_unlock_irqrestore(&chip->
open_lock, flags);
130 spin_unlock_irqrestore(&chip->
open_lock, flags);
140 chip = substream->
rmidi->private_data;
145 spin_unlock_irqrestore(&chip->
open_lock, flags);
148 spin_unlock_irqrestore(&chip->
open_lock, flags);
158 chip = substream->
rmidi->private_data;
173 spin_unlock_irqrestore(&chip->
open_lock, flags);
184 chip = substream->
rmidi->private_data;
190 spin_unlock_irqrestore(&chip->
open_lock, flags);
195 while ((
inb(
SBP(chip,
STATUS)) & 0x80) != 0 && --timeout > 0)
199 spin_unlock_irqrestore(&chip->
open_lock, flags);
208 spin_unlock_irqrestore(&chip->
open_lock, flags);
212 static void snd_sb8dsp_midi_output_timer(
unsigned long data)
215 struct snd_sb * chip = substream->
rmidi->private_data;
221 spin_unlock_irqrestore(&chip->
open_lock, flags);
222 snd_sb8dsp_midi_output_write(substream);
230 chip = substream->
rmidi->private_data;
235 chip->
midi_timer.function = snd_sb8dsp_midi_output_timer;
246 spin_unlock_irqrestore(&chip->
open_lock, flags);
249 snd_sb8dsp_midi_output_write(substream);
254 .open = snd_sb8dsp_midi_output_open,
255 .close = snd_sb8dsp_midi_output_close,
256 .trigger = snd_sb8dsp_midi_output_trigger,
261 .open = snd_sb8dsp_midi_input_open,
262 .close = snd_sb8dsp_midi_input_close,
263 .trigger = snd_sb8dsp_midi_input_trigger,