# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1005  -> 1.1006 
#	 sound/oss/trident.h	1.8     -> 1.9    
#	 sound/oss/trident.c	1.32    -> 1.33   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/02/20	mulix@alhambra.mulix.org	1.1006
# use the standard pr_debug macro instead of TRDBG
# --------------------------------------------
#
diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c
--- a/sound/oss/trident.c	Thu Feb 20 13:40:18 2003
+++ b/sound/oss/trident.c	Thu Feb 20 13:40:18 2003
@@ -202,6 +202,7 @@
 #include <linux/interrupt.h>
 #include <linux/pm.h>
 #include <linux/gameport.h>
+#include <linux/kernel.h> 
 #include <asm/uaccess.h>
 #include <asm/hardirq.h>
 #include <asm/io.h>
@@ -539,8 +540,8 @@
 
 	outl(global_control, TRID_REG(card, T4D_LFO_GC_CIR));
 
-	TRDBG("trident: Enable Loop Interrupts, globctl = 0x%08X\n",
-	      inl(TRID_REG(card, T4D_LFO_GC_CIR)));
+	pr_debug("trident: Enable Loop Interrupts, globctl = 0x%08X\n",
+		 inl(TRID_REG(card, T4D_LFO_GC_CIR)));
 
 	return (TRUE);
 }
@@ -553,8 +554,8 @@
 	global_control &= ~(ENDLP_IE | MIDLP_IE);
 	outl(global_control, TRID_REG(card, T4D_LFO_GC_CIR));
 
-	TRDBG("trident: Disabled Loop Interrupts, globctl = 0x%08X\n",
-	      global_control);
+	pr_debug("trident: Disabled Loop Interrupts, globctl = 0x%08X\n",
+		 global_control);
 
 	return (TRUE);
 }
@@ -571,8 +572,8 @@
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: enabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr);
+	pr_debug("trident: enabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr);
 #endif /* DEBUG */ 
 }
 
@@ -591,8 +592,8 @@
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: disabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr);
+	pr_debug("trident: disabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr);
 #endif /* DEBUG */ 
 }
 
@@ -610,8 +611,8 @@
 
 #ifdef DEBUG 
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: start voice on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_START_B? "START_B":"START_A",reg,addr);
+	pr_debug("trident: start voice on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr==T4D_START_B? "START_B":"START_A",reg,addr);
 #endif /* DEBUG */ 
 }
 
@@ -629,8 +630,8 @@
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, addr));
-	TRDBG("trident: stop voice on channel %d, %s = 0x%08x(addr:%X)\n",
-	      channel, addr==T4D_STOP_B? "STOP_B":"STOP_A",reg,addr);
+	pr_debug("trident: stop voice on channel %d, %s = 0x%08x(addr:%X)\n",
+		 channel, addr==T4D_STOP_B? "STOP_B":"STOP_A",reg,addr);
 #endif /* DEBUG */ 
 }
 
@@ -648,8 +649,8 @@
 
 #ifdef DEBUG
 	if (reg & mask)
-		TRDBG("trident: channel %d has interrupt, %s = 0x%08x\n",
-		      channel,reg==T4D_AINT_B? "AINT_B":"AINT_A", reg);
+		pr_debug("trident: channel %d has interrupt, %s = 0x%08x\n",
+			 channel,reg==T4D_AINT_B? "AINT_B":"AINT_A", reg);
 #endif /* DEBUG */ 
 	return (reg & mask) ? TRUE : FALSE;
 }
@@ -666,8 +667,8 @@
 
 #ifdef DEBUG
 	reg = inl(TRID_REG(card, T4D_AINT_B));
-	TRDBG("trident: Ack channel %d interrupt, AINT_B = 0x%08x\n",
-	      channel, reg);
+	pr_debug("trident: Ack channel %d interrupt, AINT_B = 0x%08x\n",
+		 channel, reg);
 #endif /* DEBUG */ 
 }
 
@@ -915,7 +916,7 @@
 
 	trident_write_voice_regs(state);
 
-	TRDBG("trident: called trident_set_dac_rate : rate = %d\n", rate);
+	pr_debug("trident: called trident_set_dac_rate : rate = %d\n", rate);
 
 	return rate;
 }
@@ -935,7 +936,7 @@
 
 	trident_write_voice_regs(state);
 
-	TRDBG("trident: called trident_set_adc_rate : rate = %d\n", rate);
+	pr_debug("trident: called trident_set_adc_rate : rate = %d\n", rate);
 
 	return rate;
 }
@@ -979,9 +980,9 @@
 		/* stereo */
 		channel->control |= CHANNEL_STEREO;
 
-	TRDBG("trident: trident_play_setup, LBA = 0x%08x, "
-	      "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n",
-	      channel->lba, channel->delta, channel->eso, channel->control);
+	pr_debug("trident: trident_play_setup, LBA = 0x%08x, "
+		 "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n",
+		 channel->lba, channel->delta, channel->eso, channel->control);
 
 	trident_write_voice_regs(state);
 }
@@ -1065,9 +1066,9 @@
 		/* stereo */
 		channel->control |= CHANNEL_STEREO;
 	
-	TRDBG("trident: trident_rec_setup, LBA = 0x%08x, "
-	      "Delat = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n",
-	      channel->lba, channel->delta, channel->eso, channel->control);
+	pr_debug("trident: trident_rec_setup, LBA = 0x%08x, "
+		 "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n",
+		 channel->lba, channel->delta, channel->eso, channel->control);
 
 	trident_write_voice_regs(state);
 }
@@ -1102,8 +1103,8 @@
 	}
 
 	
-	TRDBG("trident: trident_get_dma_addr: chip reported channel: %d, "
-	      "cso = 0x%04x\n", dmabuf->channel->num, cso);
+	pr_debug("trident: trident_get_dma_addr: chip reported channel: %d, "
+		 "cso = 0x%04x\n", dmabuf->channel->num, cso);
 
 	/* ESO and CSO are in units of Samples, convert to byte offset */
 	cso <<= sample_shift[dmabuf->fmt];
@@ -1212,8 +1213,8 @@
 					    &dmabuf->dma_handle)))
 		return -ENOMEM;
 
-	TRDBG("trident: allocated %ld (order = %d) bytes at %p\n",
-	      PAGE_SIZE << order, order, rawbuf);
+	pr_debug("trident: allocated %ld (order = %d) bytes at %p\n",
+		 PAGE_SIZE << order, order, rawbuf);
 
 	dmabuf->ready  = dmabuf->mapped = 0;
 	dmabuf->rawbuf = rawbuf;
@@ -1350,10 +1351,11 @@
 		/* set the ready flag for the dma buffer */
 		dmabuf->ready = 1;
 
-		TRDBG("trident: prog_dmabuf(%d), sample rate = %d, format = %d, numfrag = %d, "
-		      "fragsize = %d dmasize = %d\n",
-		      dmabuf->channel->num, dmabuf->rate, dmabuf->fmt, dmabuf->numfrag,
-		      dmabuf->fragsize, dmabuf->dmasize);
+		pr_debug("trident: prog_dmabuf(%d), sample rate = %d, "
+			 "format = %d, numfrag = %d, fragsize = %d "
+			 "dmasize = %d\n", dmabuf->channel->num, dmabuf->rate, 
+			 dmabuf->fmt, dmabuf->numfrag, dmabuf->fragsize, 
+			 dmabuf->dmasize);
 	}
 	unlock_set_fmt(state);
 	return 0;
@@ -1705,7 +1707,7 @@
 	/* FIXED: read interrupt status only once */
 	irq_status=inl(TRID_REG(card, T4D_AINT_A) );
 
-	TRDBG("cyber_address_interrupt: irq_status 0x%X\n",irq_status);
+	pr_debug("cyber_address_interrupt: irq_status 0x%X\n",irq_status);
 
 	for (i = 0; i < NR_HW_CH; i++) {
 		channel = 31 - i; 
@@ -1713,7 +1715,7 @@
 			/* clear bit by writing a 1, zeroes are ignored */ 		
 			outl( (1 << channel), TRID_REG(card, T4D_AINT_A));
 		
-			TRDBG("cyber_interrupt: channel %d\n", channel);
+			pr_debug("cyber_interrupt: channel %d\n", channel);
 
 			if ((state = card->states[i]) != NULL) {
 				trident_update_ptr(state);
@@ -1736,7 +1738,7 @@
 	spin_lock(&card->lock);
 	event = inl(TRID_REG(card, T4D_MISCINT));
 
-	TRDBG("trident: trident_interrupt called, MISCINT = 0x%08x\n", event);
+	pr_debug("trident: trident_interrupt called, MISCINT = 0x%08x\n", event);
 
 	if (event & ADDRESS_IRQ) {
 		card->address_interrupt(card);
@@ -1774,7 +1776,7 @@
 	unsigned swptr;
 	int cnt;
 
-	TRDBG("trident: trident_read called, count = %d\n", count);
+	pr_debug("trident: trident_read called, count = %d\n", count);
 
 	VALIDATE_STATE(state);
 	if (ppos != &file->f_pos)
@@ -1828,7 +1830,7 @@
 			   which results in a (potential) buffer overrun. And worse, there is
 			   NOTHING we can do to prevent it. */
 			if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) {
-				TRDBG(KERN_ERR "trident: recording schedule timeout, "
+				pr_debug(KERN_ERR "trident: recording schedule timeout, "
 				      "dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
 				      dmabuf->dmasize, dmabuf->fragsize, dmabuf->count,
 				      dmabuf->hwptr, dmabuf->swptr);
@@ -1886,7 +1888,7 @@
 	unsigned int state_cnt;
 	unsigned int copy_count;
 
-	TRDBG("trident: trident_write called, count = %d\n", count);
+	pr_debug("trident: trident_write called, count = %d\n", count);
 
 	VALIDATE_STATE(state);
 	if (ppos != &file->f_pos)
@@ -1955,7 +1957,7 @@
 			   which results in a (potential) buffer underrun. And worse, there is
 			   NOTHING we can do to prevent it. */
 			if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) {
-				TRDBG(KERN_ERR "trident: playback schedule timeout, "
+				pr_debug(KERN_ERR "trident: playback schedule timeout, "
 				      "dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
 				      dmabuf->dmasize, dmabuf->fragsize, dmabuf->count,
 				      dmabuf->hwptr, dmabuf->swptr);
@@ -2138,7 +2140,7 @@
 	VALIDATE_STATE(state);
 	mapped = ((file->f_mode & FMODE_WRITE) && dmabuf->mapped) ||
 		((file->f_mode & FMODE_READ) && dmabuf->mapped);
-	TRDBG("trident: trident_ioctl, command = %2d, arg = 0x%08x\n",
+	pr_debug("trident: trident_ioctl, command = %2d, arg = 0x%08x\n",
 	      _IOC_NR(cmd), arg ? *(int *)arg : 0);
 
 	switch (cmd) 
@@ -2703,7 +2705,7 @@
 	state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&card->open_sem);
 
-	TRDBG("trident: open virtual channel %d, hard channel %d\n", 
+	pr_debug("trident: open virtual channel %d, hard channel %d\n", 
               state->virt, dmabuf->channel->num);
 
 	return 0;
@@ -2725,7 +2727,7 @@
 		drain_dac(state, file->f_flags & O_NONBLOCK);
 	}
 
-	TRDBG("trident: closing virtual channel %d, hard channel %d\n", 
+	pr_debug("trident: closing virtual channel %d, hard channel %d\n", 
 	      state->virt, dmabuf->channel->num);
 
 	/* stop DMA state machine and free DMA buffers/channels */
@@ -2924,7 +2926,7 @@
 	}
 	if(!block)
 	{
-		TRDBG("accesscodecsemaphore: try unlock\n");
+		pr_debug("accesscodecsemaphore: try unlock\n");
 		block = 1;
 		goto unlock;
 	}
@@ -3003,7 +3005,7 @@
 		if(ncount <=0)
 			break;
 		if(ncount--==1) {
-			TRDBG("ali_ac97_read :try clear busy flag\n");
+			pr_debug("ali_ac97_read :try clear busy flag\n");
 			aud_reg = inl(TRID_REG(card,  ALI_AC97_WRITE));
 			outl((aud_reg & 0xffff7fff), TRID_REG(card, ALI_AC97_WRITE));
 		}
@@ -3062,7 +3064,7 @@
 		if(ncount <= 0)
 			break;
 		if(ncount-- == 1) {
-			TRDBG("ali_ac97_set :try clear busy flag!!\n");
+			pr_debug("ali_ac97_set :try clear busy flag!!\n");
 			outw(wcontrol & 0x7fff, TRID_REG(card, ALI_AC97_WRITE));
 		}
 		udelay(10);
diff -Nru a/sound/oss/trident.h b/sound/oss/trident.h
--- a/sound/oss/trident.h	Thu Feb 20 13:40:18 2003
+++ b/sound/oss/trident.h	Thu Feb 20 13:40:18 2003
@@ -360,16 +360,4 @@
 	return r;
 }
 
-#ifdef DEBUG
-
-#define TRDBG(msg, args...) do {          \
-        printk(KERN_DEBUG msg , ##args ); \
-} while (0)
-
-#else /* !defined(DEBUG) */ 
-
-#define TRDBG(msg, args...) do { } while (0)
-
-#endif /* DEBUG */ 
-
 #endif /* __TRID4DWAVE_H */
