patch-2.4.2 linux/drivers/sound/sscape.c

Next file: linux/drivers/sound/trident.c
Previous file: linux/drivers/sound/soundcard.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.1/linux/drivers/sound/sscape.c linux/drivers/sound/sscape.c
@@ -15,6 +15,8 @@
  * Sergey Smitienko	: ensoniq p'n'p support
  * Christoph Hellwig	: adapted to module_init/module_exit
  * Bartlomiej Zolnierkiewicz : added __init to attach_sscape()
+ * Chris Rankin		: Specify that this module owns the coprocessor
+ * Arnaldo C. de Melo	: added missing restore_flags in sscape_pnp_upload_file
  */
 
 #include <linux/init.h>
@@ -34,7 +36,7 @@
 #include <asm/io.h>
 #include <asm/segment.h>
 #include <linux/wait.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/proc_fs.h>
@@ -600,6 +602,7 @@
 static coproc_operations sscape_coproc_operations =
 {
 	"SoundScape M68K",
+	THIS_MODULE,
 	sscape_coproc_open,
 	sscape_coproc_close,
 	sscape_coproc_ioctl,
@@ -671,7 +674,7 @@
 		return;
 	}
 	
-	if (sscape_is_pnp == 0) {
+	if (!sscape_is_pnp) {
 	
 	    save_flags(flags);
 	    cli();
@@ -967,7 +970,10 @@
 		memcpy(devc->raw_buf, dt, l); dt += l;
 		sscape_start_dma(devc->dma, devc->raw_buf_phys, l, 0x48);
 		sscape_pnp_start_dma ( devc, 0 );
-		if (sscape_pnp_wait_dma ( devc, 0 ) == 0) return 0;
+		if (sscape_pnp_wait_dma ( devc, 0 ) == 0) {
+			restore_flags(flags);	    
+			return 0;
+		}
 	}
 	
 	restore_flags(flags);	    
@@ -1087,8 +1093,8 @@
 		sscape_pnp_write_codec( devc, 10, (sscape_pnp_read_codec(devc, 10) & 0x7f) |
 		 ( sscape_mic_enable == 0 ? 0x00 : 0x80) );
 	}
-	sscape_write_host_ctrl2( devc, 0x84, 0x32 );
-	sscape_write_host_ctrl2( devc, 0x86, 0x32 );
+	sscape_write_host_ctrl2( devc, 0x84, 0x64 );  /* MIDI volume */
+	sscape_write_host_ctrl2( devc, 0x86, 0x64 );  /* MIDI volume?? */
 	sscape_write_host_ctrl2( devc, 0x8A, sscape_ext_midi);
 
 	sscape_pnp_write_codec ( devc, 6, 0x3f ); //WAV_VOL
@@ -1239,10 +1245,7 @@
 
 	sscape_pnp_write_codec( devc, 0, sscape_pnp_read_codec( devc, 0) | 0x20);
 	sscape_pnp_write_codec( devc, 0, sscape_pnp_read_codec( devc, 1) | 0x20);
-	
-	release_region(devc->codec, 2);
-	release_region(devc->base, 8);		
-		
+
 	return 1;	
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)