patch-1.3.34 linux/drivers/sound/adlib_card.c

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

diff -u --recursive --new-file v1.3.33/linux/drivers/sound/adlib_card.c linux/drivers/sound/adlib_card.c
@@ -35,9 +35,10 @@
 attach_adlib_card (long mem_start, struct address_info *hw_config)
 {
 
-  if (opl3_detect (FM_MONO))
+  if (opl3_detect (hw_config->io_base, hw_config->osp))
     {
-      mem_start = opl3_init (mem_start);
+      mem_start = opl3_init (mem_start, hw_config->io_base, hw_config->osp);
+      request_region (hw_config->io_base, 4, "OPL3/OPL2");
     }
   return mem_start;
 }
@@ -45,7 +46,20 @@
 int
 probe_adlib (struct address_info *hw_config)
 {
-  return opl3_detect (FM_MONO);
+
+  if (check_region (hw_config->io_base, 4))
+    {
+      printk ("\n\nopl3.c: I/O port %x already in use\n\n", hw_config->io_base);
+      return 0;
+    }
+
+  return opl3_detect (hw_config->io_base, hw_config->osp);
+}
+
+void
+unload_adlib (struct address_info *hw_config)
+{
+  release_region (hw_config->io_base, 4);
 }
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this