patch-2.1.6 linux/drivers/sound/gus_card.c

Next file: linux/drivers/sound/gus_midi.c
Previous file: linux/drivers/sound/finetune.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.5/linux/drivers/sound/gus_card.c linux/drivers/sound/gus_card.c
@@ -6,7 +6,7 @@
 /*
  * Copyright (C) by Hannu Savolainen 1993-1996
  *
- * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
  * Version 2 (June 1991). See the "COPYING" file distributed with this software
  * for more info.
  */
@@ -15,7 +15,7 @@
 
 #include "sound_config.h"
 
-#if defined(CONFIG_GUS)
+#if defined(CONFIG_GUSHW)
 
 #include "gus_hw.h"
 
@@ -27,75 +27,31 @@
 extern int      have_gus_max;
 int             gus_pnp_flag = 0;
 
-int            *gus_osp;
-
 void
 attach_gus_card (struct address_info *hw_config)
 {
-  int             io_addr;
-
-  gus_osp = hw_config->osp;
   snd_set_irq_handler (hw_config->irq, gusintr, "Gravis Ultrasound", hw_config->osp);
 
-  if (gus_wave_detect (hw_config->io_base))	/*
-						 * Try first the default
-						 */
-    {
-      gus_wave_init (hw_config);
-
-      request_region (hw_config->io_base, 16, "GUS");
-      request_region (hw_config->io_base + 0x100, 12, "GUS");	/* 0x10c-> is MAX */
-
-      if (sound_alloc_dma (hw_config->dma, "GUS"))
-	printk ("gus_card.c: Can't allocate DMA channel\n");
-      if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma)
-	if (sound_alloc_dma (hw_config->dma2, "GUS(2)"))
-	  printk ("gus_card.c: Can't allocate DMA channel2\n");
-#ifdef CONFIG_MIDI
-      gus_midi_init ();
-#endif
-      return;
-    }
-
-#ifndef EXCLUDE_GUS_IODETECT
+  gus_wave_init (hw_config);
 
-  /*
-   * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6)
-   */
+  request_region (hw_config->io_base, 16, "GUS");
+  request_region (hw_config->io_base + 0x100, 12, "GUS");	/* 0x10c-> is MAX */
 
-  for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10)
-    if (io_addr != hw_config->io_base)	/*
-					 * Already tested
-					 */
-      if (gus_wave_detect (io_addr))
-	{
-	  hw_config->io_base = io_addr;
-
-	  printk (" WARNING! GUS found at %x, config was %x ", io_addr, hw_config->io_base);
-	  gus_wave_init (hw_config);
-	  request_region (io_addr, 16, "GUS");
-	  request_region (io_addr + 0x100, 12, "GUS");	/* 0x10c-> is MAX */
-	  if (sound_alloc_dma (hw_config->dma, "GUS"))
-	    printk ("gus_card.c: Can't allocate DMA channel\n");
-	  if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma)
-	    if (sound_alloc_dma (hw_config->dma2, "GUS"))
-	      printk ("gus_card.c: Can't allocate DMA channel2\n");
+  if (sound_alloc_dma (hw_config->dma, "GUS"))
+    printk ("gus_card.c: Can't allocate DMA channel\n");
+  if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma)
+    if (sound_alloc_dma (hw_config->dma2, "GUS(2)"))
+      printk ("gus_card.c: Can't allocate DMA channel2\n");
 #ifdef CONFIG_MIDI
-	  gus_midi_init ();
+  gus_midi_init ();
 #endif
-	  return;
-	}
-
-#endif
-
 }
 
 int
 probe_gus (struct address_info *hw_config)
 {
-  int             io_addr, irq;
-
-  gus_osp = hw_config->osp;
+  int             irq;
+  int             io_addr;
 
   if (hw_config->card_subtype == 1)
     gus_pnp_flag = 1;
@@ -226,7 +182,7 @@
 void
 attach_gus_db16 (struct address_info *hw_config)
 {
-#ifdef CONFIG_GUS
+#ifdef CONFIG_GUSHW
   gus_pcm_volume = 100;
   gus_wave_volume = 90;
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov