summaryrefslogtreecommitdiffstats
path: root/drivers/sound/dev_table.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
commitc7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch)
tree3682407a599b8f9f03fc096298134cafba1c9b2f /drivers/sound/dev_table.c
parent1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff)
o Merge with Linux 2.1.116.
o New Newport console code. o New G364 console code.
Diffstat (limited to 'drivers/sound/dev_table.c')
-rw-r--r--drivers/sound/dev_table.c68
1 files changed, 31 insertions, 37 deletions
diff --git a/drivers/sound/dev_table.c b/drivers/sound/dev_table.c
index 155cf529d..99e15cb22 100644
--- a/drivers/sound/dev_table.c
+++ b/drivers/sound/dev_table.c
@@ -515,39 +515,32 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
void sound_unload_audiodev(int dev)
{
if (dev != -1)
+ {
audio_devs[dev] = NULL;
+ unregister_sound_dsp((dev<<4)+3);
+ }
}
int sound_alloc_audiodev(void)
-{
- int i;
-
- for (i = 0; i < MAX_AUDIO_DEV; i++)
- {
- if (audio_devs[i] == NULL)
- {
- if (i >= num_audiodevs)
- num_audiodevs = i + 1;
- return i;
- }
- }
- return -1;
+{
+ int i = register_sound_dsp(&oss_sound_fops);
+ if(i==-1)
+ return i;
+ i>>=4;
+ if(i>=num_audiodevs)
+ num_audiodevs = i + 1;
+ return i;
}
int sound_alloc_mididev(void)
{
- int i;
-
- for (i = 0; i < MAX_MIDI_DEV; i++)
- {
- if (midi_devs[i] == NULL)
- {
- if (i >= num_midis)
- num_midis++;
- return i;
- }
- }
- return -1;
+ int i = register_sound_midi(&oss_sound_fops);
+ if(i==-1)
+ return i;
+ i>>=4;
+ if(i>=num_midis)
+ num_midis = i + 1;
+ return i;
}
int sound_alloc_synthdev(void)
@@ -568,18 +561,13 @@ int sound_alloc_synthdev(void)
int sound_alloc_mixerdev(void)
{
- int i;
-
- for (i = 0; i < MAX_MIXER_DEV; i++)
- {
- if (mixer_devs[i] == NULL)
- {
- if (i >= num_mixers)
- num_mixers++;
- return i;
- }
- }
- return -1;
+ int i = register_sound_mixer(&oss_sound_fops);
+ if(i==-1)
+ return -1;
+ i>>=4;
+ if(i>=num_mixers)
+ num_mixers = i + 1;
+ return i;
}
int sound_alloc_timerdev(void)
@@ -601,14 +589,20 @@ int sound_alloc_timerdev(void)
void sound_unload_mixerdev(int dev)
{
if (dev != -1)
+ {
mixer_devs[dev] = NULL;
+ unregister_sound_mixer(dev<<4);
+ }
}
void sound_unload_mididev(int dev)
{
#ifdef CONFIG_MIDI
if (dev != -1)
+ {
midi_devs[dev] = NULL;
+ unregister_sound_midi((dev<<4)+2);
+ }
#endif
}