## Automatically generated incremental diff
## From:   linux-2.2.18-pre11
## To:     linux-2.2.18-pre12
## Robot:  $Id: make-incremental-diff,v 1.5 2001/12/01 08:32:36 hpa Exp $

diff -urN linux-2.2.18-pre11/Documentation/Configure.help linux/Documentation/Configure.help
--- linux-2.2.18-pre11/Documentation/Configure.help	Mon Dec  3 20:28:52 2001
+++ linux/Documentation/Configure.help	Mon Dec  3 20:29:27 2001
@@ -12522,6 +12522,23 @@
 CONFIG_RADIO_CADET_PORT
   Enter the I/O address of the card here (most commonly 330). 
 
+Maestro Radio
+CONFIG_RADIO_MAESTRO
+  Choose Y here if you have one of these Maestro sound cards
+  with FM radio included.
+
+  In order to control your radio card, you will need to use programs
+  that are compatible with the Video for Linux API. Information on
+  this API and pointers to "v4l" programs may be found on the WWW at
+  http://roadrunner.swansea.uk.linux.org/v4l.shtml; to browse the WWW,
+  you need to have access to a machine on the Internet that has a
+  program like lynx or netscape.
+
+  If you want to compile this driver as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want),
+  say M here and read Documentation/modules.txt. The module will be
+  called radio-maestro.o
+
 SF16FMI Radio
 CONFIG_RADIO_SF16FMI
   Choose Y here if you have one of these FM radio cards, and then fill
diff -urN linux-2.2.18-pre11/Makefile linux/Makefile
--- linux-2.2.18-pre11/Makefile	Mon Dec  3 20:28:52 2001
+++ linux/Makefile	Mon Dec  3 20:29:27 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 18
-EXTRAVERSION = pre11
+EXTRAVERSION = pre12
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
@@ -22,7 +22,9 @@
 
 AS	=$(CROSS_COMPILE)as
 LD	=$(CROSS_COMPILE)ld
-CC	=$(CROSS_COMPILE)cc -D__KERNEL__ -I$(HPATH)
+CC	=$(CROSS_COMPILE)$(shell if [ -n "`which gcc272 2>/dev/null`" ]; then echo "`which gcc272`";\
+	else  if [ -n "`which kgcc 2>/dev/null`" ]; then echo "`which kgcc`"; else\
+	echo "cc"; fi ; fi)  -D__KERNEL__ -I$(HPATH) 
 CPP	=$(CC) -E
 AR	=$(CROSS_COMPILE)ar
 NM	=$(CROSS_COMPILE)nm
@@ -135,7 +137,7 @@
 endif
 
 ifeq ($(CONFIG_SOUND),y)
-DRIVERS := $(DRIVERS) drivers/sound/sound.a
+DRIVERS := $(DRIVERS) drivers/sound/sounddrivers.o
 endif
 
 ifdef CONFIG_PCI
diff -urN linux-2.2.18-pre11/arch/i386/kernel/mtrr.c linux/arch/i386/kernel/mtrr.c
--- linux-2.2.18-pre11/arch/i386/kernel/mtrr.c	Mon Dec  3 20:28:59 2001
+++ linux/arch/i386/kernel/mtrr.c	Mon Dec  3 20:29:31 2001
@@ -440,6 +440,7 @@
 	/*break;*/
       case X86_VENDOR_CYRIX:
 	/*  Cyrix have 8 ARRs  */
+	return 8;
       case X86_VENDOR_CENTAUR:
         /*  and Centaur has 8 MCR's  */
 	if(boot_cpu_data.x86==5)
diff -urN linux-2.2.18-pre11/drivers/block/rz1000.c linux/drivers/block/rz1000.c
--- linux-2.2.18-pre11/drivers/block/rz1000.c	Mon Jan  4 15:07:27 1999
+++ linux/drivers/block/rz1000.c	Mon Dec  3 20:29:35 2001
@@ -86,9 +86,9 @@
 {
 	struct pci_dev *dev = NULL;
 
-	while (dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, dev))
+	while ((dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, dev)))
 		init_rz1000 (dev, "RZ1000");
-	while (dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, dev))
+	while ((dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, dev)))
 		init_rz1000 (dev, "RZ1001");
 }
 
diff -urN linux-2.2.18-pre11/drivers/char/Makefile linux/drivers/char/Makefile
--- linux-2.2.18-pre11/drivers/char/Makefile	Mon Dec  3 20:29:00 2001
+++ linux/drivers/char/Makefile	Mon Dec  3 20:29:35 2001
@@ -201,13 +201,14 @@
 endif
 
 obj-$(CONFIG_SX) += sx.o generic_serial.o
-obj-$(CONFIG_RIO) += rio/rio.o generic_serial.o
 
 ifeq ($(CONFIG_RIO),y)
+L_OBJS += rio/rio.o generic_serial.o
 SUB_DIRS += rio
 MOD_SUB_DIRS += rio
 else
   ifeq ($(CONFIG_RIO),m)
+  M_OBJS += generic_serial.o
   MOD_SUB_DIRS += rio
   endif
 endif
diff -urN linux-2.2.18-pre11/drivers/char/bttv.c linux/drivers/char/bttv.c
--- linux-2.2.18-pre11/drivers/char/bttv.c	Mon Dec  3 20:29:00 2001
+++ linux/drivers/char/bttv.c	Mon Dec  3 20:29:35 2001
@@ -558,7 +558,7 @@
         /* TurboTV */
         { 3, 1, 0, 2, 3, { 2, 3, 1, 1}, { 1, 1, 2, 3, 0}},
         /* Newer Hauppauge (bt878) */
-	{ 3, 1, 0, 2, 7, { 2, 0, 1, 1}, { 0, 1, 2, 3, 4}},
+	{ 4, 1, 0, 2, 7, { 2, 0, 1, 1}, { 0, 1, 2, 3, 4}},
         /* MIRO PCTV pro */
         { 3, 1, 0, 2, 65551, { 2, 3, 1, 1}, {1,65537, 0, 0,10}},
 	/* ADS Technologies Channel Surfer TV (and maybe TV+FM) */
diff -urN linux-2.2.18-pre11/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
--- linux-2.2.18-pre11/drivers/char/pc_keyb.c	Mon Dec  3 20:29:03 2001
+++ linux/drivers/char/pc_keyb.c	Mon Dec  3 20:29:36 2001
@@ -58,6 +58,7 @@
 static void kbd_write_output_w(int data);
 #ifdef CONFIG_PSMOUSE
 static void aux_write_ack(int val);
+static int aux_reconnect = 0;
 #endif
 
 spinlock_t kbd_controller_lock = SPIN_LOCK_UNLOCKED;
@@ -399,18 +400,20 @@
 		}
 		mouse_reply_expected = 0;
 	}
-    else if(scancode == AUX_RECONNECT){
-        queue->head = queue->tail = 0;  /* Flush input queue */
-        /* ping the mouse :) */
-	kb_wait();
-	kbd_write_command(KBD_CCMD_WRITE_MOUSE);
-	kb_wait();
-	kbd_write_output(AUX_ENABLE_DEV);
-	/* we expect an ACK in response. */
-	mouse_reply_expected++;
-	kb_wait();
-        return;
-    }
+	
+	else if(scancode == AUX_RECONNECT && aux_reconnect)
+	{
+	        queue->head = queue->tail = 0;  /* Flush input queue */
+        	/* ping the mouse :) */
+		kb_wait();
+		kbd_write_command(KBD_CCMD_WRITE_MOUSE);
+		kb_wait();
+		kbd_write_output(AUX_ENABLE_DEV);
+		/* we expect an ACK in response. */
+		mouse_reply_expected++;
+		kb_wait();
+	        return;
+	}
 
 	add_mouse_randomness(scancode);
 	if (aux_count) {
@@ -446,18 +449,21 @@
 		unsigned char scancode;
 
 		scancode = kbd_read_input();
-#  ifdef CHECK_RECONNECT_SCANCODE
-    printk(KERN_INFO "-=db=-: kbd_read_input() : scancode == %d\n",scancode);
-#  endif
-		if (status & KBD_STAT_MOUSE_OBF) {
-			handle_mouse_event(scancode);
-		} else {
-			kbd_exists = 1;
-			if (do_acknowledge(scancode))
-				handle_scancode(scancode, !(scancode & 0x80));
-			mark_bh(KEYBOARD_BH);
+		
+		/* Check for errors. Shouldnt ever happen but it does on Compaq
+		   Presario 16[89]. */
+		   
+		if(!(status&(KBD_STAT_GTO|KBD_STAT_PERR)))
+		{
+			if (status & KBD_STAT_MOUSE_OBF) {
+				handle_mouse_event(scancode);
+			} else {
+				kbd_exists = 1;
+				if (do_acknowledge(scancode))
+					handle_scancode(scancode, !(scancode & 0x80));
+				mark_bh(KEYBOARD_BH);
+			}
 		}
-
 		status = kbd_read_status();
 		
 		if(!work--)
@@ -550,6 +556,7 @@
 	kbd_startup_reset = 1;
 }
 
+
 #define KBD_NO_DATA	(-1)	/* No data */
 #define KBD_BAD_DATA	(-2)	/* Parity or other error */
 
@@ -747,6 +754,11 @@
 }
 
 #if defined CONFIG_PSMOUSE
+
+void __init aux_reconnect_setup(char *str, int *ints)
+{
+	aux_reconnect=1;
+}
 
 /*
  * Check if this is a dual port controller.
diff -urN linux-2.2.18-pre11/drivers/char/radio-maestro.c linux/drivers/char/radio-maestro.c
--- linux-2.2.18-pre11/drivers/char/radio-maestro.c	Mon Dec  3 20:29:03 2001
+++ linux/drivers/char/radio-maestro.c	Mon Dec  3 20:29:36 2001
@@ -96,12 +96,7 @@
 static void sleep_125ms(void)
 {
 	current->state = TASK_INTERRUPTIBLE;
-	schedule_timeout(HZ >> 3);
-}
-
-static void udelay2(void)
-{
-	udelay(2);
+			 schedule_timeout(HZ >> 3);
 }
 
 static void udelay4(void)
@@ -125,11 +120,11 @@
 	udelay16();
 	for (l=24;l--;) {
 		outw(STR_CLK, io);		/* HI state */
-		udelay2();
+		udelay4();
 		if(!l) 
 			dev->tuned = inw(io) & STR_MOST ? 0 : 0xffff;
 		outw(0, io);			/* LO state */
-		udelay2();
+		udelay4();
 		data <<= 1;			/* shift data */
 		rdata = inw(io);
 		if(!l)
@@ -138,7 +133,7 @@
 		else
 			if(rdata & STR_DATA)
 				data++;
-		udelay2();
+		udelay4();
 	}
 	if(dev->muted)
 		outw(STR_WREN, io);
@@ -160,9 +155,9 @@
 		bits = ((data >> 18) & STR_DATA) | STR_WREN ;
 		data <<= 1;			/* shift data */
 		outw(bits, io);			/* start strobe */
-		udelay2();
+		udelay4();
 		outw(bits | STR_CLK, io);	/* HI level */
-		udelay2();   
+		udelay4();   
 		outw(bits, io);			/* LO level */
 		udelay4();
 	}
diff -urN linux-2.2.18-pre11/drivers/net/rclanmtl.c linux/drivers/net/rclanmtl.c
--- linux-2.2.18-pre11/drivers/net/rclanmtl.c	Mon Dec  3 20:29:03 2001
+++ linux/drivers/net/rclanmtl.c	Mon Dec  3 20:29:36 2001
@@ -1831,7 +1831,7 @@
     if (0xFFFFFFFF == off)
         return RC_RTN_FREE_Q_EMPTY;
 
-    p32 = (volatile u32 *)(pPab->pLinOutMsgBlock - ADAPTER_BLOCK_RESERVED_SPACE + sizeof(PAB));
+    p32 = (u32 *)(pPab->pLinOutMsgBlock - ADAPTER_BLOCK_RESERVED_SPACE + sizeof(PAB));
     *p32 = 0xFFFFFFFF;
 
     pMsg = (u32 *)(pPab->pPci45LinBaseAddr + off);
diff -urN linux-2.2.18-pre11/drivers/net/rcpci45.c linux/drivers/net/rcpci45.c
--- linux-2.2.18-pre11/drivers/net/rcpci45.c	Mon Dec  3 20:29:03 2001
+++ linux/drivers/net/rcpci45.c	Mon Dec  3 20:29:36 2001
@@ -1230,7 +1230,7 @@
             }
             RCUD_GETSPEED = &RCuser.RCUS_GETSPEED;
             RCGetLinkSpeed(pDpa->id, (u32 *) &RCUD_GETSPEED->LinkSpeedCode, NULL);
-            printk("RC speed = 0x%ld\n", RCUD_GETSPEED->LinkSpeedCode);
+            printk("RC speed = 0x%d\n", RCUD_GETSPEED->LinkSpeedCode);
             break;
         case RCUC_SETIPANDMASK:
             printk("RC SETIPANDMASK\n");
diff -urN linux-2.2.18-pre11/drivers/scsi/sym53c8xx_defs.h linux/drivers/scsi/sym53c8xx_defs.h
--- linux-2.2.18-pre11/drivers/scsi/sym53c8xx_defs.h	Mon Dec  3 20:29:04 2001
+++ linux/drivers/scsi/sym53c8xx_defs.h	Mon Dec  3 20:29:37 2001
@@ -66,7 +66,9 @@
 #endif
 #include <linux/config.h>
 
+#ifndef LinuxVersionCode
 #define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s))
+#endif
 
 /*
  * NCR PQS/PDS special device support.
diff -urN linux-2.2.18-pre11/drivers/sound/Config.in linux/drivers/sound/Config.in
--- linux-2.2.18-pre11/drivers/sound/Config.in	Mon Dec  3 20:29:04 2001
+++ linux/drivers/sound/Config.in	Mon Dec  3 20:29:37 2001
@@ -263,7 +263,7 @@
   fi
 
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-    dep_tristate 'Support for AD1816(A) based cards (EXPERIMENTAL)' CONFIG_SOUND_AD1816 $CONFIG_SOUND
+    dep_tristate 'Support for AD1816(A) based cards (EXPERIMENTAL)' CONFIG_SOUND_AD1816 $CONFIG_SOUND_OSS
     if [ "$CONFIG_SOUND_AD1816" = "y" ]; then
       hex 'AD1816 audio I/O base 530, 604, E80 or F40' CONFIG_AD1816_BASE 530
       int 'AD1816 audio IRQ 5, 7, 9, 11, 12 or 15' CONFIG_AD1816_IRQ 7
diff -urN linux-2.2.18-pre11/drivers/sound/Makefile linux/drivers/sound/Makefile
--- linux-2.2.18-pre11/drivers/sound/Makefile	Mon Dec  3 20:29:04 2001
+++ linux/drivers/sound/Makefile	Mon Dec  3 20:29:37 2001
@@ -167,19 +167,19 @@
 
 # Translate to Rules.make lists.
 
-L_TARGET	:= sound.a
+O_TARGET	:= sounddrivers.o
 # This is a nice idea but needs depmod altering
 #MOD_LIST_NAME	:= SOUND_MODULES
 
-L_OBJS		:= $(sort $(filter-out $(export-objs), $(obj-y)))
-LX_OBJS		:= $(sort $(filter     $(export-objs), $(obj-y)))
+O_OBJS		:= $(sort $(filter-out $(export-objs), $(obj-y)))
+OX_OBJS		:= $(sort $(filter     $(export-objs), $(obj-y)))
 M_OBJS		:= $(sort $(filter-out $(export-objs), $(obj-m)))
 MX_OBJS		:= $(sort $(filter     $(export-objs), $(obj-m)))
 MI_OBJS		:= $(sort $(filter-out $(export-objs), $(int-m)))
 MIX_OBJS	:= $(sort $(filter     $(export-objs), $(int-m)))
 
 ifeq ($(CONFIG_LOWLEVEL_SOUND),y)
-    L_OBJS	+= lowlevel/lowlevel.o
+    O_OBJS	+= lowlevel/lowlevel.o
 endif
 
 include $(TOPDIR)/Rules.make
diff -urN linux-2.2.18-pre11/drivers/sound/ac97_codec.c linux/drivers/sound/ac97_codec.c
--- linux-2.2.18-pre11/drivers/sound/ac97_codec.c	Mon Dec  3 20:29:04 2001
+++ linux/drivers/sound/ac97_codec.c	Mon Dec  3 20:29:37 2001
@@ -75,8 +75,10 @@
 	{0x83847605, "SigmaTel STAC9704"      , NULL},
 	{0x83847608, "SigmaTel STAC9708"      , NULL},
 	{0x83847609, "SigmaTel STAC9721/23"   , sigmatel_init},
+	{0x54524103, "TriTech TR28023"	      , NULL},
 	{0x54524106, "TriTech TR28026"        , NULL},
 	{0x54524108, "TriTech TR28028"        , NULL},
+	{0x54524123, "TriTech TR?????"	      , NULL},	
 	{0x574D4C00, "Wolfson WM9704"         , NULL},
 	{0x00000000, NULL, NULL}
 };
@@ -123,20 +125,20 @@
 	unsigned int value;
 } mixer_defaults[SOUND_MIXER_NRDEVICES] = {
 	/* all values 0 -> 100 in bytes */
-	{SOUND_MIXER_VOLUME,	0x3232},
-	{SOUND_MIXER_BASS,	0x3232},
-	{SOUND_MIXER_TREBLE,	0x3232},
-	{SOUND_MIXER_PCM,	0x3232},
-	{SOUND_MIXER_SPEAKER,	0x3232},
-	{SOUND_MIXER_LINE,	0x3232},
-	{SOUND_MIXER_MIC,	0x3232},
-	{SOUND_MIXER_CD,	0x3232},
-	{SOUND_MIXER_ALTPCM,	0x3232},
-	{SOUND_MIXER_IGAIN,	0x3232},
-	{SOUND_MIXER_LINE1,	0x3232},
-	{SOUND_MIXER_PHONEIN,	0x3232},
-	{SOUND_MIXER_PHONEOUT,	0x3232},
-	{SOUND_MIXER_VIDEO,	0x3232},
+	{SOUND_MIXER_VOLUME,	0x4343},
+	{SOUND_MIXER_BASS,	0x4343},
+	{SOUND_MIXER_TREBLE,	0x4343},
+	{SOUND_MIXER_PCM,	0x4343},
+	{SOUND_MIXER_SPEAKER,	0x4343},
+	{SOUND_MIXER_LINE,	0x4343},
+	{SOUND_MIXER_MIC,	0x4343},
+	{SOUND_MIXER_CD,	0x4343},
+	{SOUND_MIXER_ALTPCM,	0x4343},
+	{SOUND_MIXER_IGAIN,	0x4343},
+	{SOUND_MIXER_LINE1,	0x4343},
+	{SOUND_MIXER_PHONEIN,	0x4343},
+	{SOUND_MIXER_PHONEOUT,	0x4343},
+	{SOUND_MIXER_VIDEO,	0x4343},
 	{-1,0}
 };
 
@@ -145,20 +147,20 @@
 	unsigned char offset;
 	int scale;
 } ac97_hw[SOUND_MIXER_NRDEVICES]= {
-	[SOUND_MIXER_VOLUME]	=	{AC97_MASTER_VOL_STEREO,63},
-	[SOUND_MIXER_BASS]	=	{AC97_MASTER_TONE,	15},
-	[SOUND_MIXER_TREBLE]	=	{AC97_MASTER_TONE,	15},
-	[SOUND_MIXER_PCM]	=	{AC97_PCMOUT_VOL,	31},
-	[SOUND_MIXER_SPEAKER]	=	{AC97_PCBEEP_VOL,	15},
-	[SOUND_MIXER_LINE]	=	{AC97_LINEIN_VOL,	31},
-	[SOUND_MIXER_MIC]	=	{AC97_MIC_VOL,		31},
-	[SOUND_MIXER_CD]	=	{AC97_CD_VOL,		31},
-	[SOUND_MIXER_ALTPCM]	=	{AC97_HEADPHONE_VOL,	63},
-	[SOUND_MIXER_IGAIN]	=	{AC97_RECORD_GAIN,	31},
-	[SOUND_MIXER_LINE1]	=	{AC97_AUX_VOL,		31},
-	[SOUND_MIXER_PHONEIN]	= 	{AC97_PHONE_VOL,	15},
-	[SOUND_MIXER_PHONEOUT]	= 	{AC97_MASTER_VOL_MONO,	63},
-	[SOUND_MIXER_VIDEO]	=	{AC97_VIDEO_VOL,	31},
+	[SOUND_MIXER_VOLUME]	=	{AC97_MASTER_VOL_STEREO,64},
+	[SOUND_MIXER_BASS]	=	{AC97_MASTER_TONE,	16},
+	[SOUND_MIXER_TREBLE]	=	{AC97_MASTER_TONE,	16},
+	[SOUND_MIXER_PCM]	=	{AC97_PCMOUT_VOL,	32},
+	[SOUND_MIXER_SPEAKER]	=	{AC97_PCBEEP_VOL,	16},
+	[SOUND_MIXER_LINE]	=	{AC97_LINEIN_VOL,	32},
+	[SOUND_MIXER_MIC]	=	{AC97_MIC_VOL,		32},
+	[SOUND_MIXER_CD]	=	{AC97_CD_VOL,		32},
+	[SOUND_MIXER_ALTPCM]	=	{AC97_HEADPHONE_VOL,	64},
+	[SOUND_MIXER_IGAIN]	=	{AC97_RECORD_GAIN,	16},
+	[SOUND_MIXER_LINE1]	=	{AC97_AUX_VOL,		32},
+	[SOUND_MIXER_PHONEIN]	= 	{AC97_PHONE_VOL,	32},
+	[SOUND_MIXER_PHONEOUT]	= 	{AC97_MASTER_VOL_MONO,	64},
+	[SOUND_MIXER_VIDEO]	=	{AC97_VIDEO_VOL,	32},
 };
 
 /* the following tables allow us to go from OSS <-> ac97 quickly. */
@@ -200,11 +202,14 @@
 {
 	u16 val;
 	int ret = 0;
+	int scale;
 	struct ac97_mixer_hw *mh = &ac97_hw[oss_channel];
 
 	val = codec->codec_read(codec , mh->offset);
 
-	if (AC97_STEREO_MASK & (1 << oss_channel)) {
+	if (val & AC97_MUTE) {
+		ret = 0;
+	} else if (AC97_STEREO_MASK & (1 << oss_channel)) {
 		/* nice stereo mixers .. */
 		int left,right;
 
@@ -215,8 +220,14 @@
 			right = (right * 100) / mh->scale;
 			left = (left * 100) / mh->scale;
 		} else {
-			right = 100 - ((right * 100) / mh->scale);
-			left = 100 - ((left * 100) / mh->scale);
+			/* these may have 5 or 6 bit resolution */
+			if(oss_channel == SOUND_MIXER_VOLUME || oss_channel == SOUND_MIXER_ALTPCM)
+				scale = (1 << codec->bit_resolution);
+			else
+				scale = mh->scale;
+
+			right = 100 - ((right * 100) / scale);
+			left = 100 - ((left * 100) / scale);
 		}
 		ret = left | (right << 8);
 	} else if (oss_channel == SOUND_MIXER_SPEAKER) {
@@ -224,7 +235,8 @@
 	} else if (oss_channel == SOUND_MIXER_PHONEIN) {
 		ret = 100 - (((val & 0x1f) * 100) / mh->scale);
 	} else if (oss_channel == SOUND_MIXER_PHONEOUT) {
-		ret = 100 - (((val & 0x1f) * 100) / mh->scale);
+		scale = (1 << codec->bit_resolution);
+		ret = 100 - (((val & 0x1f) * 100) / scale);
 	} else if (oss_channel == SOUND_MIXER_MIC) {
 		ret = 100 - (((val & 0x1f) * 100) / mh->scale);
 		/*  the low bit is optional in the tone sliders and masking
@@ -251,6 +263,7 @@
 		      unsigned int left, unsigned int right)
 {
 	u16 val = 0;
+	int scale;
 	struct ac97_mixer_hw *mh = &ac97_hw[oss_channel];
 
 #ifdef DEBUG
@@ -262,31 +275,45 @@
 
 	if (AC97_STEREO_MASK & (1 << oss_channel)) {
 		/* stereo mixers */
-		if (oss_channel == SOUND_MIXER_IGAIN) {
-			right = (right * mh->scale) / 100;
-			left = (left * mh->scale) / 100;
+		if (left == 0 && right == 0) {
+			val = AC97_MUTE;
 		} else {
-			right = ((100 - right) * mh->scale) / 100;
-			left = ((100 - left) * mh->scale) / 100;
-		}			
-		val = (left << 8) | right;
+			if (oss_channel == SOUND_MIXER_IGAIN) {
+				right = (right * mh->scale) / 100;
+				left = (left * mh->scale) / 100;
+			} else {
+				/* these may have 5 or 6 bit resolution */
+				if (oss_channel == SOUND_MIXER_VOLUME ||
+				    oss_channel == SOUND_MIXER_ALTPCM)
+					scale = (1 << codec->bit_resolution);
+				else
+					scale = mh->scale;
+
+				right = ((100 - right) * scale) / 100;
+				left = ((100 - left) * scale) / 100;
+			}			
+			val = (left << 8) | right;
+		}
+	} else if (oss_channel == SOUND_MIXER_BASS) {
+		val = codec->codec_read(codec , mh->offset) & ~0x0f00;
+		val |= ((((100 - left) * mh->scale) / 100) << 8) & 0x0e00;
+	} else if (oss_channel == SOUND_MIXER_TREBLE) {
+		val = codec->codec_read(codec , mh->offset) & ~0x000f;
+		val |= (((100 - left) * mh->scale) / 100) & 0x000e;
+	} else if(left == 0) {
+		val = AC97_MUTE;
 	} else if (oss_channel == SOUND_MIXER_SPEAKER) {
 		val = (((100 - left) * mh->scale) / 100) << 1;
 	} else if (oss_channel == SOUND_MIXER_PHONEIN) {
 		val = (((100 - left) * mh->scale) / 100);
 	} else if (oss_channel == SOUND_MIXER_PHONEOUT) {
-		val = (((100 - left) * mh->scale) / 100);
+		scale = (1 << codec->bit_resolution);
+		val = (((100 - left) * scale) / 100);
 	} else if (oss_channel == SOUND_MIXER_MIC) {
 		val = codec->codec_read(codec , mh->offset) & ~0x801f;
 		val |= (((100 - left) * mh->scale) / 100);
 		/*  the low bit is optional in the tone sliders and masking
 		    it lets us avoid the 0xf 'bypass'.. */
-	} else if (oss_channel == SOUND_MIXER_BASS) {
-		val = codec->codec_read(codec , mh->offset) & ~0x0f00;
-		val |= ((((100 - left) * mh->scale) / 100) << 8) & 0x0e00;
-	} else if (oss_channel == SOUND_MIXER_TREBLE) {
-		val = codec->codec_read(codec , mh->offset) & ~0x000f;
-		val |= (((100 - left) * mh->scale) / 100) & 0x000e;
 	}
 #ifdef DEBUG
 	printk(" 0x%04x", val);
@@ -423,7 +450,8 @@
 
 	if (_IOC_DIR(cmd) == (_IOC_WRITE|_IOC_READ)) {
 		codec->modcnt++;
-		get_user_ret(val, (int *)arg, -EFAULT);
+		if (get_user(val, (int *)arg))
+			return -EFAULT;
 
 		switch (_IOC_NR(cmd)) {
 		case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
@@ -588,16 +616,19 @@
 	if (!(cap & 0x10))
 		codec->supported_mixers &= ~SOUND_MASK_ALTPCM;
 
+	/* detect bit resolution */
+	codec->codec_write(codec, AC97_MASTER_VOL_STEREO, 0x2020);
+	if(codec->codec_read(codec, AC97_MASTER_VOL_STEREO) == 0x1f1f)
+		codec->bit_resolution = 5;
+	else
+		codec->bit_resolution = 6;
+
 	/* generic OSS to AC97 wrapper */
 	codec->read_mixer = ac97_read_mixer;
 	codec->write_mixer = ac97_write_mixer;
 	codec->recmask_io = ac97_recmask_io;
 	codec->mixer_ioctl = ac97_mixer_ioctl;
 
-	/* initialize volume level */
-	codec->codec_write(codec, AC97_MASTER_VOL_STEREO, 0L);
-	codec->codec_write(codec, AC97_PCMOUT_VOL, 0L);
-
 	/* codec specific initialization for 4-6 channel output or secondary codec stuff */
 	if (codec->codec_init != NULL) {
 		codec->codec_init(codec);
@@ -624,7 +655,7 @@
 static int sigmatel_init(struct ac97_codec * codec)
 {
 	if(codec->id == 0)
-		return;
+		return 0;
 		
 	/* Only set up secondary codec */
 	
diff -urN linux-2.2.18-pre11/drivers/sound/i810_audio.c linux/drivers/sound/i810_audio.c
--- linux-2.2.18-pre11/drivers/sound/i810_audio.c	Mon Sep  4 10:39:21 2000
+++ linux/drivers/sound/i810_audio.c	Mon Dec  3 20:29:37 2001
@@ -1591,6 +1591,7 @@
 	struct i810_card *card = dev->private_data;
 	int count = 1000;
 
+#if 0
 	if (card->pci_id != INTEL440MX) {
 		while(--count && (inl(card->iobase + GLOB_STA) & 0x0100))
 			udelay(10);
@@ -1598,6 +1599,7 @@
 			printk("i810_audio: AC97 access failed.\n");
 		count=1000;
 	}
+#endif
 	while(--count && (inb(card->iobase + CAS) & 1)) 
 		udelay(10);
 	if(!count)
@@ -1610,6 +1612,7 @@
 	struct i810_card *card = dev->private_data;
 	int count = 1000;
 
+#if 0
 	if (card->pci_id != INTEL440MX) {
 		while(--count && (inl(card->iobase + GLOB_STA) & 0x0100))
 			udelay(10);
@@ -1618,6 +1621,7 @@
 
 		count=1000;
 	}
+#endif	
 	while(--count && (inb(card->iobase + CAS) & 1)) 
 		udelay(10);
 	if(!count)
diff -urN linux-2.2.18-pre11/drivers/sound/ymfpci.c linux/drivers/sound/ymfpci.c
--- linux-2.2.18-pre11/drivers/sound/ymfpci.c	Mon Dec  3 20:29:04 2001
+++ linux/drivers/sound/ymfpci.c	Mon Dec  3 20:29:37 2001
@@ -1472,7 +1472,7 @@
 	if (file->f_mode & (FMODE_WRITE | FMODE_READ))
 		poll_wait(file, &dmabuf->wait, wait);
 
-	spin_lock_irqsave(&state->card->lock, flags);
+	spin_lock_irqsave(&state->unit->reg_lock, flags);
 	if (file->f_mode & FMODE_READ) {
 		if (dmabuf->count >= (signed)dmabuf->fragsize)
 			mask |= POLLIN | POLLRDNORM;
@@ -2013,7 +2013,7 @@
 	llseek:		ymf_llseek,
 	read:		ymf_read,
 	write:		ymf_write,
-	/* poll:		ymf_poll, */
+	poll:		ymf_poll,
 	ioctl:		ymf_ioctl,
 	mmap:		ymf_mmap,
 	open:		ymf_open,
diff -urN linux-2.2.18-pre11/drivers/usb/uhci.c linux/drivers/usb/uhci.c
--- linux-2.2.18-pre11/drivers/usb/uhci.c	Mon Dec  3 20:29:04 2001
+++ linux/drivers/usb/uhci.c	Mon Dec  3 20:29:38 2001
@@ -2426,7 +2426,7 @@
 	return 0;
 }
 
-static int __init uhci_init(void)
+int __init uhci_init(void)
 {
 	int retval;
 	struct pci_dev *dev;
diff -urN linux-2.2.18-pre11/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c
--- linux-2.2.18-pre11/drivers/usb/usb-uhci.c	Mon Dec  3 20:29:04 2001
+++ linux/drivers/usb/usb-uhci.c	Mon Dec  3 20:29:38 2001
@@ -2822,7 +2822,7 @@
 	return -1;
 }
 
-static int __init uhci_init (void)
+int __init uhci_init (void)
 {
 	int retval = -ENODEV;
 	struct pci_dev *dev = NULL;
diff -urN linux-2.2.18-pre11/include/linux/ac97_codec.h linux/include/linux/ac97_codec.h
--- linux-2.2.18-pre11/include/linux/ac97_codec.h	Mon Dec  3 20:29:05 2001
+++ linux/include/linux/ac97_codec.h	Mon Dec  3 20:29:39 2001
@@ -156,6 +156,8 @@
 	int supported_mixers;
 	int stereo_mixers;
 	int record_sources;
+
+	int bit_resolution;
 	
 	/* OSS mixer interface */
 	int  (*read_mixer) (struct ac97_codec *codec, int oss_channel);
diff -urN linux-2.2.18-pre11/init/main.c linux/init/main.c
--- linux-2.2.18-pre11/init/main.c	Mon Dec  3 20:29:05 2001
+++ linux/init/main.c	Mon Dec  3 20:29:40 2001
@@ -109,6 +109,7 @@
 #endif
 extern void no_scroll(char *str, int *ints);
 extern void kbd_reset_setup(char *str, int *ints);
+extern void aux_reconnect_setup(char *str, int *ints);
 extern void panic_setup(char *str, int *ints);
 extern void bmouse_setup(char *str, int *ints);
 extern void msmouse_setup(char *str, int *ints);
@@ -757,6 +758,9 @@
 #endif
 #ifdef CONFIG_VT
 	{ "kbd-reset", kbd_reset_setup },
+#endif
+#ifdef CONFIG_PSMOUSE
+	{ "psaux-reconnect", aux_reconnect_setup },
 #endif
 #ifdef CONFIG_BUGi386
 	{ "no-hlt", no_halt },
diff -urN linux-2.2.18-pre11/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
--- linux-2.2.18-pre11/net/ipx/af_ipx.c	Wed Jun  7 14:26:44 2000
+++ linux/net/ipx/af_ipx.c	Mon Dec  3 20:29:42 2001
@@ -1605,7 +1605,7 @@
 				       s->protinfo.af_ipx.node[5],
 				       htons(s->protinfo.af_ipx.port));
 #else
-			len += sprintf(buffer+len,"%08lX:%04X  ",
+			len += sprintf(buffer+len,"%08X:%04X  ",
 				       htonl(i->if_netnum),
 				       htons(s->protinfo.af_ipx.port));
 #endif	/* CONFIG_IPX_INTERN */
