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

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

diff -u --recursive --new-file v2.3.35/linux/drivers/sound/msnd_pinnacle.c linux/drivers/sound/msnd_pinnacle.c
@@ -104,18 +104,18 @@
 	LPDAQD lpDAQ;
 
 	dev.last_playbank = -1;
-	writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wHead);
-	writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wTail);
+	isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wHead);
+	isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wTail);
 
 	for (n = 0, lpDAQ = dev.base + DAPQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) {
-		writew(PCTODSP_BASED((DWORD)(DAP_BUFF_SIZE * n)), lpDAQ + DAQDS_wStart);
-		writew(0, lpDAQ + DAQDS_wSize);
-		writew(1, lpDAQ + DAQDS_wFormat);
-		writew(dev.play_sample_size, lpDAQ + DAQDS_wSampleSize);
-		writew(dev.play_channels, lpDAQ + DAQDS_wChannels);
-		writew(dev.play_sample_rate, lpDAQ + DAQDS_wSampleRate);
-		writew(HIMT_PLAY_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg);
-		writew(n, lpDAQ + DAQDS_wFlags);
+		isa_writew(PCTODSP_BASED((DWORD)(DAP_BUFF_SIZE * n)), lpDAQ + DAQDS_wStart);
+		isa_writew(0, lpDAQ + DAQDS_wSize);
+		isa_writew(1, lpDAQ + DAQDS_wFormat);
+		isa_writew(dev.play_sample_size, lpDAQ + DAQDS_wSampleSize);
+		isa_writew(dev.play_channels, lpDAQ + DAQDS_wChannels);
+		isa_writew(dev.play_sample_rate, lpDAQ + DAQDS_wSampleRate);
+		isa_writew(HIMT_PLAY_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg);
+		isa_writew(n, lpDAQ + DAQDS_wFlags);
 	}
 }
 
@@ -126,25 +126,25 @@
 	unsigned long flags;
 
 	dev.last_recbank = 2;
-	writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DARQ + JQS_wHead);
-	writew(PCTODSP_OFFSET(dev.last_recbank * DAQDS__size), dev.DARQ + JQS_wTail);
+	isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DARQ + JQS_wHead);
+	isa_writew(PCTODSP_OFFSET(dev.last_recbank * DAQDS__size), dev.DARQ + JQS_wTail);
 
 	/* Critical section: bank 1 access */
 	spin_lock_irqsave(&dev.lock, flags);
 	outb(HPBLKSEL_1, dev.io + HP_BLKS);
-	memset_io(dev.base, 0, DAR_BUFF_SIZE * 3);
+	isa_memset_io(dev.base, 0, DAR_BUFF_SIZE * 3);
 	outb(HPBLKSEL_0, dev.io + HP_BLKS);
 	spin_unlock_irqrestore(&dev.lock, flags);
 
 	for (n = 0, lpDAQ = dev.base + DARQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) {
-		writew(PCTODSP_BASED((DWORD)(DAR_BUFF_SIZE * n)) + 0x4000, lpDAQ + DAQDS_wStart);
-		writew(DAR_BUFF_SIZE, lpDAQ + DAQDS_wSize);
-		writew(1, lpDAQ + DAQDS_wFormat);
-		writew(dev.rec_sample_size, lpDAQ + DAQDS_wSampleSize);
-		writew(dev.rec_channels, lpDAQ + DAQDS_wChannels);
-		writew(dev.rec_sample_rate, lpDAQ + DAQDS_wSampleRate);
-		writew(HIMT_RECORD_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg);
-		writew(n, lpDAQ + DAQDS_wFlags);
+		isa_writew(PCTODSP_BASED((DWORD)(DAR_BUFF_SIZE * n)) + 0x4000, lpDAQ + DAQDS_wStart);
+		isa_writew(DAR_BUFF_SIZE, lpDAQ + DAQDS_wSize);
+		isa_writew(1, lpDAQ + DAQDS_wFormat);
+		isa_writew(dev.rec_sample_size, lpDAQ + DAQDS_wSampleSize);
+		isa_writew(dev.rec_channels, lpDAQ + DAQDS_wChannels);
+		isa_writew(dev.rec_sample_rate, lpDAQ + DAQDS_wSampleRate);
+		isa_writew(HIMT_RECORD_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg);
+		isa_writew(n, lpDAQ + DAQDS_wFlags);
 	}
 }
 
@@ -180,9 +180,9 @@
 
 	for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) {
 		if (file->f_mode & FMODE_WRITE)
-			writew(data, lpDAQ + DAQDS_wSampleSize);
+			isa_writew(data, lpDAQ + DAQDS_wSampleSize);
 		if (file->f_mode & FMODE_READ)
-			writew(data, lpDARQ + DAQDS_wSampleSize);
+			isa_writew(data, lpDARQ + DAQDS_wSampleSize);
 	}
 	if (file->f_mode & FMODE_WRITE)
 		dev.play_sample_size = data;
@@ -312,9 +312,9 @@
 
 		for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) {
 			if (file->f_mode & FMODE_WRITE)
-				writew(data, lpDAQ + DAQDS_wSampleRate);
+				isa_writew(data, lpDAQ + DAQDS_wSampleRate);
 			if (file->f_mode & FMODE_READ)
-				writew(data, lpDARQ + DAQDS_wSampleRate);
+				isa_writew(data, lpDARQ + DAQDS_wSampleRate);
 		}
 		if (file->f_mode & FMODE_WRITE)
 			dev.play_sample_rate = data;
@@ -355,9 +355,9 @@
 									
 		for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) {
 			if (file->f_mode & FMODE_WRITE)
-				writew(data, lpDAQ + DAQDS_wChannels);
+				isa_writew(data, lpDAQ + DAQDS_wChannels);
 			if (file->f_mode & FMODE_READ)
-				writew(data, lpDARQ + DAQDS_wChannels);
+				isa_writew(data, lpDARQ + DAQDS_wChannels);
 		}
 		if (file->f_mode & FMODE_WRITE)
 			dev.play_channels = data;
@@ -394,28 +394,28 @@
 	}
 }
 
-#define update_volm(a,b)					\
-	writew((dev.left_levels[a] >> 1) *			\
-	       readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff,	\
-	       dev.SMA + SMA_##b##Left);			\
-	writew((dev.right_levels[a] >> 1)  *			\
-	       readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff,	\
+#define update_volm(a,b)						\
+	isa_writew((dev.left_levels[a] >> 1) *				\
+	       isa_readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff,	\
+	       dev.SMA + SMA_##b##Left);				\
+	isa_writew((dev.right_levels[a] >> 1)  *			\
+	       isa_readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff,	\
 	       dev.SMA + SMA_##b##Right);
 
-#define update_potm(d,s,ar)					\
-	writeb((dev.left_levels[d] >> 8) *			\
-	       readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff,	\
-	       dev.SMA + SMA_##s##Left);			\
-	writeb((dev.right_levels[d] >> 8) *			\
-	       readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff,	\
-	       dev.SMA + SMA_##s##Right);			\
-	if (msnd_send_word(&dev, 0, 0, ar) == 0)		\
+#define update_potm(d,s,ar)						\
+	isa_writeb((dev.left_levels[d] >> 8) *				\
+	       isa_readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff,	\
+	       dev.SMA + SMA_##s##Left);				\
+	isa_writeb((dev.right_levels[d] >> 8) *				\
+	       isa_readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff,	\
+	       dev.SMA + SMA_##s##Right);				\
+	if (msnd_send_word(&dev, 0, 0, ar) == 0)			\
 		chk_send_dsp_cmd(&dev, HDEX_AUX_REQ);
 
 #define update_pot(d,s,ar)				\
-	writeb(dev.left_levels[d] >> 8,			\
+	isa_writeb(dev.left_levels[d] >> 8,		\
 	       dev.SMA + SMA_##s##Left);		\
-	writeb(dev.right_levels[d] >> 8,		\
+	isa_writeb(dev.right_levels[d] >> 8,		\
 	       dev.SMA + SMA_##s##Right);		\
 	if (msnd_send_word(&dev, 0, 0, ar) == 0)	\
 		chk_send_dsp_cmd(&dev, HDEX_AUX_REQ);
@@ -444,23 +444,23 @@
 		/* master volume unscaled controls */
 	case SOUND_MIXER_LINE:			/* line pot control */
 		/* scaled by IMIX in digital mix */
-		writeb(bLeft, dev.SMA + SMA_bInPotPosLeft);
-		writeb(bRight, dev.SMA + SMA_bInPotPosRight);
+		isa_writeb(bLeft, dev.SMA + SMA_bInPotPosLeft);
+		isa_writeb(bRight, dev.SMA + SMA_bInPotPosRight);
 		if (msnd_send_word(&dev, 0, 0, HDEXAR_IN_SET_POTS) == 0)
 			chk_send_dsp_cmd(&dev, HDEX_AUX_REQ);
 		break;
 #ifndef MSND_CLASSIC
 	case SOUND_MIXER_MIC:			/* mic pot control */
 		/* scaled by IMIX in digital mix */
-		writeb(bLeft, dev.SMA + SMA_bMicPotPosLeft);
-		writeb(bRight, dev.SMA + SMA_bMicPotPosRight);
+		isa_writeb(bLeft, dev.SMA + SMA_bMicPotPosLeft);
+		isa_writeb(bRight, dev.SMA + SMA_bMicPotPosRight);
 		if (msnd_send_word(&dev, 0, 0, HDEXAR_MIC_SET_POTS) == 0)
 			chk_send_dsp_cmd(&dev, HDEX_AUX_REQ);
 		break;
 #endif
 	case SOUND_MIXER_VOLUME:		/* master volume */
-		writew(wLeft, dev.SMA + SMA_wCurrMastVolLeft);
-		writew(wRight, dev.SMA + SMA_wCurrMastVolRight);
+		isa_writew(wLeft, dev.SMA + SMA_wCurrMastVolLeft);
+		isa_writew(wRight, dev.SMA + SMA_wCurrMastVolRight);
 		/* fall through */
 
 	case SOUND_MIXER_LINE1:			/* aux pot control */
@@ -834,18 +834,18 @@
 	LPDAQD DAQD;
 
 	/* Increment the tail and check for queue wrap */
-	wTmp = readw(dev.DARQ + JQS_wTail) + PCTODSP_OFFSET(DAQDS__size);
-	if (wTmp > readw(dev.DARQ + JQS_wSize))
+	wTmp = isa_readw(dev.DARQ + JQS_wTail) + PCTODSP_OFFSET(DAQDS__size);
+	if (wTmp > isa_readw(dev.DARQ + JQS_wSize))
 		wTmp = 0;
-	while (wTmp == readw(dev.DARQ + JQS_wHead) && timeout--)
+	while (wTmp == isa_readw(dev.DARQ + JQS_wHead) && timeout--)
 		udelay(1);
-	writew(wTmp, dev.DARQ + JQS_wTail);
+	isa_writew(wTmp, dev.DARQ + JQS_wTail);
 
 	/* Get our digital audio queue struct */
 	DAQD = bank * DAQDS__size + dev.base + DARQ_DATA_BUFF;
 
 	/* Get length of data */
-	size = readw(DAQD + DAQDS_wSize);
+	size = isa_readw(DAQD + DAQDS_wSize);
 
 	/* Read data from the head (unprotected bank 1 access okay
            since this is only called inside an interrupt) */
@@ -868,8 +868,8 @@
 	register int protect = start, nbanks = 0;
 	LPDAQD DAQD;
 
-	DAPQ_tail = readw(dev.DAPQ + JQS_wTail);
-	while (DAPQ_tail != readw(dev.DAPQ + JQS_wHead) || start) {
+	DAPQ_tail = isa_readw(dev.DAPQ + JQS_wTail);
+	while (DAPQ_tail != isa_readw(dev.DAPQ + JQS_wHead) || start) {
 		register int bank_num = DAPQ_tail / PCTODSP_OFFSET(DAQDS__size);
 		register int n;
 		unsigned long flags;
@@ -904,12 +904,12 @@
 		DAQD = bank_num * DAQDS__size + dev.base + DAPQ_DATA_BUFF;
 
 		/* Write size of this bank */
-		writew(n, DAQD + DAQDS_wSize);
+		isa_writew(n, DAQD + DAQDS_wSize);
 		++nbanks;
 
 		/* Then advance the tail */
 		DAPQ_tail = (++bank_num % 3) * PCTODSP_OFFSET(DAQDS__size);
-		writew(DAPQ_tail, dev.DAPQ + JQS_wTail);
+		isa_writew(DAPQ_tail, dev.DAPQ + JQS_wTail);
 		
 		/* Tell the DSP to play the bank */
 		msnd_send_dsp_cmd(&dev, HDEX_PLAY_START);
@@ -1110,15 +1110,15 @@
 	inb(dev.io + HP_RXL);
 
 	/* Evaluate queued DSP messages */
-	while (readw(dev.DSPQ + JQS_wTail) != readw(dev.DSPQ + JQS_wHead)) {
+	while (isa_readw(dev.DSPQ + JQS_wTail) != isa_readw(dev.DSPQ + JQS_wHead)) {
 		register WORD wTmp;
 
-		eval_dsp_msg(readw(dev.pwDSPQData + readw(dev.DSPQ + JQS_wHead)));
+		eval_dsp_msg(isa_readw(dev.pwDSPQData + 2*isa_readw(dev.DSPQ + JQS_wHead)));
 
-		if ((wTmp = readw(dev.DSPQ + JQS_wHead) + 1) > readw(dev.DSPQ + JQS_wSize))
-			writew(0, dev.DSPQ + JQS_wHead);
+		if ((wTmp = isa_readw(dev.DSPQ + JQS_wHead) + 1) > isa_readw(dev.DSPQ + JQS_wSize))
+			isa_writew(0, dev.DSPQ + JQS_wHead);
 		else
-			writew(wTmp, dev.DSPQ + JQS_wHead);
+			isa_writew(wTmp, dev.DSPQ + JQS_wHead);
 	}
 }
 
@@ -1211,7 +1211,7 @@
 	}
 	printk(KERN_INFO LOGNAME ": %s revision %s, Xilinx version %s, "
 #endif /* MSND_CLASSIC */
-	       "I/O 0x%x-0x%x, IRQ %d, memory mapped to 0x%p-0x%p\n",
+	       "I/O 0x%x-0x%x, IRQ %d, memory mapped to 0x%lX-0x%lX\n",
 	       dev.name,
 #ifndef MSND_CLASSIC
 	       rev, xv,
@@ -1225,12 +1225,12 @@
 	return 0;
 }
 
-static void msnd_init_queue(volatile BYTE *base, int start, int size)
+static void msnd_init_queue(unsigned long 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);
+	isa_writew(PCTODSP_BASED(start), base + JQS_wStart);
+	isa_writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize);
+	isa_writew(0, base + JQS_wHead);
+	isa_writew(0, base + JQS_wTail);
 }
 
 static int init_sma(void)
@@ -1244,22 +1244,22 @@
 #endif
 	outb(HPBLKSEL_0, dev.io + HP_BLKS);
 	if (initted) {
-		mastVolLeft = readw(dev.SMA + SMA_wCurrMastVolLeft);
-		mastVolRight = readw(dev.SMA + SMA_wCurrMastVolRight);
+		mastVolLeft = isa_readw(dev.SMA + SMA_wCurrMastVolLeft);
+		mastVolRight = isa_readw(dev.SMA + SMA_wCurrMastVolRight);
 	} else
 		mastVolLeft = mastVolRight = 0;
-	memset_io(dev.base, 0, 0x8000);
+	isa_memset_io(dev.base, 0, 0x8000);
 
 	/* Critical section: bank 1 access */
 	spin_lock_irqsave(&dev.lock, flags);
 	outb(HPBLKSEL_1, dev.io + HP_BLKS);
-	memset_io(dev.base, 0, 0x8000);
+	isa_memset_io(dev.base, 0, 0x8000);
 	outb(HPBLKSEL_0, dev.io + HP_BLKS);
 	spin_unlock_irqrestore(&dev.lock, flags);
 
-	dev.pwDSPQData = (volatile WORD *)(dev.base + DSPQ_DATA_BUFF);
-	dev.pwMODQData = (volatile WORD *)(dev.base + MODQ_DATA_BUFF);
-	dev.pwMIDQData = (volatile WORD *)(dev.base + MIDQ_DATA_BUFF);
+	dev.pwDSPQData = (dev.base + DSPQ_DATA_BUFF);
+	dev.pwMODQData = (dev.base + MODQ_DATA_BUFF);
+	dev.pwMIDQData = (dev.base + MIDQ_DATA_BUFF);
 
 	/* Motorola 56k shared memory base */
 	dev.SMA = dev.base + SMA_STRUCT_START;
@@ -1286,19 +1286,19 @@
 
 	/* Setup some DSP values */
 #ifndef MSND_CLASSIC
-	writew(1, dev.SMA + SMA_wCurrPlayFormat);
-	writew(dev.play_sample_size, dev.SMA + SMA_wCurrPlaySampleSize);
-	writew(dev.play_channels, dev.SMA + SMA_wCurrPlayChannels);
-	writew(dev.play_sample_rate, dev.SMA + SMA_wCurrPlaySampleRate);
-#endif
-	writew(dev.play_sample_rate, dev.SMA + SMA_wCalFreqAtoD);
-	writew(mastVolLeft, dev.SMA + SMA_wCurrMastVolLeft);
-	writew(mastVolRight, dev.SMA + SMA_wCurrMastVolRight);
+	isa_writew(1, dev.SMA + SMA_wCurrPlayFormat);
+	isa_writew(dev.play_sample_size, dev.SMA + SMA_wCurrPlaySampleSize);
+	isa_writew(dev.play_channels, dev.SMA + SMA_wCurrPlayChannels);
+	isa_writew(dev.play_sample_rate, dev.SMA + SMA_wCurrPlaySampleRate);
+#endif
+	isa_writew(dev.play_sample_rate, dev.SMA + SMA_wCalFreqAtoD);
+	isa_writew(mastVolLeft, dev.SMA + SMA_wCurrMastVolLeft);
+	isa_writew(mastVolRight, dev.SMA + SMA_wCurrMastVolRight);
 #ifndef MSND_CLASSIC
-	writel(0x00010000, dev.SMA + SMA_dwCurrPlayPitch);
-	writel(0x00000001, dev.SMA + SMA_dwCurrPlayRate);
+	isa_writel(0x00010000, dev.SMA + SMA_dwCurrPlayPitch);
+	isa_writel(0x00000001, dev.SMA + SMA_dwCurrPlayRate);
 #endif
-	writew(0x303, dev.SMA + SMA_wCurrInputTagBits);
+	isa_writew(0x303, dev.SMA + SMA_wCurrInputTagBits);
 
 	initted = 1;
 
@@ -1307,12 +1307,12 @@
 
 static int __init calibrate_adc(WORD srate)
 {
-	writew(srate, dev.SMA + SMA_wCalFreqAtoD);
+	isa_writew(srate, dev.SMA + SMA_wCalFreqAtoD);
 	if (dev.calibrate_signal == 0)
-		writew(readw(dev.SMA + SMA_wCurrHostStatusFlags)
+		isa_writew(isa_readw(dev.SMA + SMA_wCurrHostStatusFlags)
 		       | 0x0001, dev.SMA + SMA_wCurrHostStatusFlags);
 	else
-		writew(readw(dev.SMA + SMA_wCurrHostStatusFlags)
+		isa_writew(isa_readw(dev.SMA + SMA_wCurrHostStatusFlags)
 		       & ~0x0001, dev.SMA + SMA_wCurrHostStatusFlags);
 	if (msnd_send_word(&dev, 0, 0, HDEXAR_CAL_A_TO_D) == 0 &&
 	    chk_send_dsp_cmd(&dev, HDEX_AUX_REQ) == 0) {
@@ -1342,7 +1342,7 @@
 		return -EBUSY;
 	}
 #endif
-	memcpy_toio(dev.base, PERMCODE, PERMCODESIZE);
+	isa_memcpy_toio(dev.base, PERMCODE, PERMCODESIZE);
 	if (msnd_upload_host(&dev, INITCODE, INITCODESIZE) < 0) {
 		printk(KERN_WARNING LOGNAME ": Error uploading to DSP\n");
 		return -ENODEV;
@@ -1395,7 +1395,7 @@
 	}
 
 	timeout = 200;
-	while (readw(dev.base)) {
+	while (isa_readw(dev.base)) {
 		mdelay(1);
 		if (!timeout--) {
 			printk(KERN_DEBUG LOGNAME ": DSP reset timeout\n");
@@ -1897,7 +1897,7 @@
 	dev.io = io;
 	dev.numio = DSP_NUMIO;
 	dev.irq = irq;
-	dev.base = phys_to_virt(mem);
+	dev.base = mem;
 	dev.fifosize = fifosize * 1024;
 	dev.calibrate_signal = calibrate_signal ? 1 : 0;
 	dev.recsrc = 0;

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