patch-2.2.13 linux/drivers/sound/msnd_pinnacle.c

Next file: linux/drivers/sound/msnd_pinnacle.h
Previous file: linux/drivers/sound/msnd_classic.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/drivers/sound/msnd_pinnacle.c linux/drivers/sound/msnd_pinnacle.c
@@ -29,7 +29,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: msnd_pinnacle.c,v 1.73 1998/12/04 14:41:02 andrewtv Exp $
+ * $Id: msnd_pinnacle.c,v 1.75 1999/03/21 16:50:09 andrewtv Exp $
  *
  ********************************************************************/
 
@@ -254,7 +254,7 @@
 	case SNDCTL_DSP_SYNC:
 		dsp_write_flush();
 		return 0;
-		
+
 	case SNDCTL_DSP_GETBLKSIZE:
 		tmp = dsp_get_frag_size();
 		if (put_user(tmp, (int *)arg))
@@ -352,7 +352,7 @@
 				break;
 			}
 		}
-									
+
 		for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) {
 			if (file->f_mode & FMODE_WRITE)
 				writew(data, lpDAQ + DAQDS_wChannels);
@@ -570,7 +570,7 @@
 		return 0;
 	} else if (((cmd >> 8) & 0xff) == 'M') {
 		int val = 0;
-		
+
 		if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
 			switch (cmd & 0xff) {
 			case SOUND_MIXER_RECSRC:
@@ -578,7 +578,7 @@
 					return -EFAULT;
 				val = set_recsrc(val);
 				break;
-				
+
 			default:
 				if (get_user(val, (int *)arg))
 					return -EFAULT;
@@ -592,7 +592,7 @@
 			case SOUND_MIXER_RECSRC:
 				val = dev.recsrc;
 				break;
-				
+
 			case SOUND_MIXER_DEVMASK:
 			case SOUND_MIXER_STEREODEVS:
 				val =   SOUND_MASK_PCM |
@@ -620,7 +620,7 @@
 			case SOUND_MIXER_CAPS:
 				val =   SOUND_CAP_EXCL_INPUT;
 				break;
-				
+
 			default:
 				if ((val = mixer_get(cmd & 0xff)) < 0)
 					return -EINVAL;
@@ -787,7 +787,7 @@
 		/* nothing */
 	} else
 		err = -EINVAL;
-	
+
 	if (err >= 0)
 		mod_inc_ref();
 
@@ -873,7 +873,7 @@
 		register int bank_num = DAPQ_tail / PCTODSP_OFFSET(DAQDS__size);
 		register int n;
 		unsigned long flags;
-		
+
 		/* Write the data to the new tail */
 		if (protect) {
 			/* Critical section: protect fifo in non-interrupt */
@@ -910,11 +910,11 @@
 		/* Then advance the tail */
 		DAPQ_tail = (++bank_num % 3) * PCTODSP_OFFSET(DAQDS__size);
 		writew(DAPQ_tail, dev.DAPQ + JQS_wTail);
-		
+
 		/* Tell the DSP to play the bank */
 		msnd_send_dsp_cmd(&dev, HDEX_PLAY_START);
 	}
-	
+
 	return nbanks;
 }
 
@@ -999,7 +999,7 @@
 				return -EINTR;
 		}
 	}
-	
+
 	return len - count;
 }
 
@@ -1147,7 +1147,7 @@
 static int reset_dsp(void)
 {
 	int timeout = 100;
-		
+
 	outb(HPDSPRESET_ON, dev.io + HP_DSPR);
 	mdelay(1);
 #ifndef MSND_CLASSIC
@@ -1195,7 +1195,7 @@
 	case 0x3: xv = "1.4"; break;
 	default: xv = "unknown"; break;
 	}
-		
+
 	switch (dev.info & 0x7) {
 	case 0x0: rev = "I"; dev.name = pin; break;
 	case 0x1: rev = "F"; dev.name = pin; break;
@@ -1221,16 +1221,8 @@
 	       dev.base, dev.base + 0x7fff);
 
 	release_region(dev.io, dev.numio);
-	
-	return 0;
-}
 
-static void msnd_init_queue(volatile BYTE *base, int start, int size)
-{
-	writew(PCTODSP_BASED(start), base + JQS_wStart);
-	writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize);
-	writew(0, base + JQS_wHead);
-	writew(0, base + JQS_wTail);
+	return 0;
 }
 
 static int init_sma(void)
@@ -1388,7 +1380,7 @@
 
 	if ((err = reset_dsp()) < 0)
 		return err;
-	
+
 	if ((err = upload_dsp_code()) < 0) {
 		printk(KERN_WARNING LOGNAME ": Cannot upload DSP code\n");
 		return err;
@@ -1467,12 +1459,14 @@
 		return dev.mixer_minor;
 	}
 
+	dev.ext_midi_dev = dev.hdr_midi_dev = -1;
+
 	disable_irq(dev.irq);
 	calibrate_adc(dev.play_sample_rate);
 #ifndef MSND_CLASSIC
 	force_recsrc(SOUND_MASK_IMIX);
 #endif
-	
+
 	return 0;
 }
 
@@ -1598,7 +1592,7 @@
 
 	/* Configure specified devices */
 	for (i = 0; i < 4; ++i) {
-		
+
 		switch (i) {
 		case 0:		/* DSP */
 			if (!(device[i].io0 && device[i].irq && device[i].mem))
@@ -1781,7 +1775,7 @@
 
 	printk(KERN_INFO LOGNAME ": Turtle Beach " LONGNAME " Linux Driver Version "
 	       VERSION ", Copyright (C) 1998 Andrew Veliath\n");
-	
+
 	if (io == -1 || irq == -1 || mem == -1)
 		printk(KERN_WARNING LOGNAME ": io, irq and mem must be set\n");
 
@@ -1797,7 +1791,7 @@
 		printk(KERN_ERR LOGNAME ": \"io\" - DSP I/O base must be set to 0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x290, or 0x3E0\n");
 		return -EINVAL;
 	}
-	
+
 	if (irq == -1 ||
 	    !(irq == 5 ||
 	      irq == 7 ||
@@ -1854,7 +1848,7 @@
 		pinnacle_devs[0].mem = mem;
 
 		/* The following are Pinnacle specific */
-		
+
 		/* MPU */
 		pinnacle_devs[1].io0 = mpu_io;
 		pinnacle_devs[1].irq = mpu_irq;
@@ -1901,6 +1895,8 @@
 	dev.fifosize = fifosize * 1024;
 	dev.calibrate_signal = calibrate_signal ? 1 : 0;
 	dev.recsrc = 0;
+	dev.dspq_data_buff = DSPQ_DATA_BUFF;
+	dev.dspq_buff_size = DSPQ_BUFF_SIZE;
 	dev.inc_ref = mod_inc_ref;
 	dev.dec_ref = mod_dec_ref;
 	if (write_ndelay == -1)
@@ -1939,7 +1935,7 @@
 		msnd_fifo_free(&dev.DARF);
 		return err;
 	}
-	
+
 	if ((err = attach_multisound()) < 0) {
 		printk(KERN_ERR LOGNAME ": Attach failed\n");
 		msnd_fifo_free(&dev.DAPF);

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