]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.2.18pre12 2.2.18pre12
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:22:28 +0000 (15:22 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:22:28 +0000 (15:22 -0500)
o Fix cyrix MTRR handling bug  (IIZUKA Daisuke)
o Fix ymfpci poll (Alan Cox, Arjan)
o Update radio-maestro, add Configure.help (Adam Tla/lka>
o Fix rio/generic serial build bug (Marcelo Tossati)
o USB build bug fix (Arjan van de Ven)
o Fix missing ac97_codec.c return value (Arjan van de Ven)
o Fix several warnings (Arjan van de Ven)
o Made the PS/2 reconnect behaviour optional (Alan Cox)
| Its now 'psaux-reconnect' on the boot line
o Allow for newer Hauppauge with 4 ports (Krischan Jodies)
o Switch sound drivers from library to object (Arjan van de Ven)
o Kill the not working ac97 lock on the 810 (Alan Cox)
o Automatically select older compilers for kernel
builds on Debian and RH (Arjan van de Ven)
o Start volumes higher on ac97, teach the driver  (Rui Sousa)
about 5bit and 6bit codec precision and use
the mute bit.

21 files changed:
Documentation/Configure.help
Makefile
arch/i386/kernel/mtrr.c
drivers/block/rz1000.c
drivers/char/Makefile
drivers/char/bttv.c
drivers/char/pc_keyb.c
drivers/char/radio-maestro.c
drivers/net/rclanmtl.c
drivers/net/rcpci45.c
drivers/scsi/sym53c8xx_defs.h
drivers/sound/Config.in
drivers/sound/Makefile
drivers/sound/ac97_codec.c
drivers/sound/i810_audio.c
drivers/sound/ymfpci.c
drivers/usb/uhci.c
drivers/usb/usb-uhci.c
include/linux/ac97_codec.h
init/main.c
net/ipx/af_ipx.c

index e8f2160bdeaa59d7a4094452b4e86f754af32f99..0d1f12798a7a8db916dfc7f48eacf774630b3042 100644 (file)
@@ -12522,6 +12522,23 @@ ADS Cadet AM/FM Radio Tuner Card I/O Port
 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
index 958db18579f06fcd48bdda734f8ecbcc14145d5e..a4b5131f5867b7ceecc747ca576a18ab6fb73664 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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 @@ CROSS_COMPILE         =
 
 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 @@ DRIVERS := $(DRIVERS) drivers/cdrom/cdrom.a
 endif
 
 ifeq ($(CONFIG_SOUND),y)
-DRIVERS := $(DRIVERS) drivers/sound/sound.a
+DRIVERS := $(DRIVERS) drivers/sound/sounddrivers.o
 endif
 
 ifdef CONFIG_PCI
index 292026e31adc777a58dcb8f41bba5f58d80c3964..5143c33c2c05019aa9d8df4d18b4f42e0b15e310 100644 (file)
@@ -440,6 +440,7 @@ static unsigned int get_num_var_ranges (void)
        /*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)
index fe8c229004db35e83218c4363ca9a1bb3e9890ee..e250a6d862d66e3917a767c7c898bc9ed4050754 100644 (file)
@@ -86,9 +86,9 @@ __initfunc(void ide_probe_for_rz100x (void))  /* called from ide.c */
 {
        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");
 }
 
index fb475531f53118e6f1ada2218f4d2854afa03595..20c34e04e7945bc3e797fb94fb6ed08e0adba53f 100644 (file)
@@ -201,13 +201,14 @@ else
 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
index a09457cb0931dd369b9e460a8c20020b9a94f445..3de59e8eba1d63dd34bf7203e6931a8f3c789d11 100644 (file)
@@ -558,7 +558,7 @@ static struct tvcard tvcards[] =
         /* 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) */
index 16cd4833b42556a4c171a406a88ffd2621b63bb9..16150dc75457032cc1b4b972877e75bc28707516 100644 (file)
@@ -58,6 +58,7 @@ static void kbd_write_command_w(int data);
 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 @@ static inline void handle_mouse_event(unsigned char scancode)
                }
                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 @@ static unsigned char handle_kbd_event(void)
                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 @@ void __init kbd_reset_setup(char *str, int *ints)
        kbd_startup_reset = 1;
 }
 
+
 #define KBD_NO_DATA    (-1)    /* No data */
 #define KBD_BAD_DATA   (-2)    /* Parity or other error */
 
@@ -748,6 +755,11 @@ void __init pckbd_init_hw(void)
 
 #if defined CONFIG_PSMOUSE
 
+void __init aux_reconnect_setup(char *str, int *ints)
+{
+       aux_reconnect=1;
+}
+
 /*
  * Check if this is a dual port controller.
  */
index 662e5c188609ccc218f11db5af5cac34480c6f1b..d6a2bf98289ac8514d7df72396184dce7cfe840e 100644 (file)
@@ -96,12 +96,7 @@ static int users = 0;
 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 @@ static __u32 radio_bits_get(struct radio_device *dev)
        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 @@ static __u32 radio_bits_get(struct radio_device *dev)
                else
                        if(rdata & STR_DATA)
                                data++;
-               udelay2();
+               udelay4();
        }
        if(dev->muted)
                outw(STR_WREN, io);
@@ -160,9 +155,9 @@ static void radio_bits_set(struct radio_device *dev, __u32 data)
                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();
        }
index 4be76a70d84622d1cfd9c77291cec3607a2bf297..04d9b44175c821c4b8c5ad67e1a143012a3b7174 100644 (file)
@@ -1831,7 +1831,7 @@ RCGetRavlinIPandMask(u16 AdapterID, u32 * pIpAddr, u32 * pNetMask,
     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);
index 34bcc0551fbb255029fc6479bd306dcd429b66b2..eb42e822064a0d1d37cf3ec55b01772070faf0d7 100644 (file)
@@ -1230,7 +1230,7 @@ static int RCioctl(struct device *dev, struct ifreq *rq, int cmd)
             }
             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");
index 168e4cf2e61bb3886ab9e5de23f24b086b05dae9..444d56890e1f3f321bc7dbeaba8e45f3f5989be4 100644 (file)
@@ -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.
index 4f086238dbba1e24ac933ff683038f83b8828bba..f4b5be5b5bdba3743c4a3416fe0d90d21d7730d4 100644 (file)
@@ -263,7 +263,7 @@ if [ "$CONFIG_SOUND_OSS" = "y" -o "$CONFIG_SOUND_OSS" = "m" ]; then
   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
index 09795558e9bb7055cf99b60b01ab86d38e071a41..643aac4ef93c242009e2c83fbf3e5b5940dce30e 100644 (file)
@@ -167,19 +167,19 @@ obj-y             := $(filter-out $(list-multi), $(obj-y)) $(int-y)
 
 # 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
index ff59d81e9c8d950f6e45efcbb6f1a53751111e57..a9b36e2321f8ecd25677afc9fd853f6bc6da0f4f 100644 (file)
@@ -75,8 +75,10 @@ static struct {
        {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 @@ static struct mixer_defaults {
        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 @@ static struct ac97_mixer_hw {
        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 @@ static int ac97_read_mixer(struct ac97_codec *codec, int oss_channel)
 {
        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 @@ static int ac97_read_mixer(struct ac97_codec *codec, int oss_channel)
                        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 @@ static int ac97_read_mixer(struct ac97_codec *codec, int oss_channel)
        } 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 @@ static void ac97_write_mixer(struct ac97_codec *codec, int oss_channel,
                      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 @@ static void ac97_write_mixer(struct ac97_codec *codec, int oss_channel,
 
        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 @@ static int ac97_mixer_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned
 
        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 @@ static int ac97_init_mixer(struct ac97_codec *codec)
        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 ac97_init_modem(struct ac97_codec *codec)
 static int sigmatel_init(struct ac97_codec * codec)
 {
        if(codec->id == 0)
-               return;
+               return 0;
                
        /* Only set up secondary codec */
        
index 71f9a617cf582c0868fb6f47284a85e3edd4db1f..788131f305bc41ab856d2c3b8acf7f0b6ef565a6 100644 (file)
@@ -1591,6 +1591,7 @@ static u16 i810_ac97_get(struct ac97_codec *dev, u8 reg)
        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 @@ static u16 i810_ac97_get(struct ac97_codec *dev, u8 reg)
                        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 @@ static void i810_ac97_set(struct ac97_codec *dev, u8 reg, u16 data)
        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 @@ static void i810_ac97_set(struct ac97_codec *dev, u8 reg, u16 data)
 
                count=1000;
        }
+#endif 
        while(--count && (inb(card->iobase + CAS) & 1)) 
                udelay(10);
        if(!count)
index e92129be2dadc3c11eea18d15f2bdf06e0fb0254..c98b25f629fa213bf58d1b9aea2881a397d0251a 100644 (file)
@@ -1472,7 +1472,7 @@ static unsigned int ymf_poll(struct file *file, struct poll_table_struct *wait)
        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 @@ static /*const*/ struct file_operations ymf_fops = {
        llseek:         ymf_llseek,
        read:           ymf_read,
        write:          ymf_write,
-       /* poll:                ymf_poll, */
+       poll:           ymf_poll,
        ioctl:          ymf_ioctl,
        mmap:           ymf_mmap,
        open:           ymf_open,
index 824d634ba924f006254ecdd74c2118ab5f306af0..45c017743cff4d97d7365324cb5587191a9422c9 100644 (file)
@@ -2426,7 +2426,7 @@ static int handle_pm_event(struct pm_dev *dev, pm_request_t rqst, void *data)
        return 0;
 }
 
-static int __init uhci_init(void)
+int __init uhci_init(void)
 {
        int retval;
        struct pci_dev *dev;
index 4d2bcaf9bea94cacb6410fd0efe4680f83f2df62..596de251ef22c9a1be4e742019a7aea5f0d1a998 100644 (file)
@@ -2822,7 +2822,7 @@ _static int __init start_uhci (struct pci_dev *dev)
        return -1;
 }
 
-static int __init uhci_init (void)
+int __init uhci_init (void)
 {
        int retval = -ENODEV;
        struct pci_dev *dev = NULL;
index 0dee37c21ffc2b5a8449c854cd4e517e895eecd6..e4329f8449605350e818b93f40bc11cd457ca019 100644 (file)
@@ -156,6 +156,8 @@ struct ac97_codec {
        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);
index 4bbd9157492b7e2b2e31d27b22cdfb8bfa70fd3f..bacfb9717193bcac50ac47f8d612954b50f89d1a 100644 (file)
@@ -109,6 +109,7 @@ extern int microcode_init(void);
 #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);
@@ -758,6 +759,9 @@ static struct kernel_param cooked_params[] __initdata = {
 #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 },
        { "no387", no_387 },
index 3c0e67a8b51cd6f23faed20f2105cb7359849d31..e66f28cca59944257d88c2b6617f20dcd165c76f 100644 (file)
@@ -1605,7 +1605,7 @@ static int ipx_get_info(char *buffer, char **start, off_t offset,
                                       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 */