From 6063dbaef76003a9b0f58ed661447012568ba508 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Nov 2007 15:22:28 -0500 Subject: [PATCH] Linux 2.2.18pre12 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. --- Documentation/Configure.help | 17 +++++ Makefile | 8 +- arch/i386/kernel/mtrr.c | 1 + drivers/block/rz1000.c | 4 +- drivers/char/Makefile | 3 +- drivers/char/bttv.c | 2 +- drivers/char/pc_keyb.c | 58 +++++++++------ drivers/char/radio-maestro.c | 17 ++--- drivers/net/rclanmtl.c | 2 +- drivers/net/rcpci45.c | 2 +- drivers/scsi/sym53c8xx_defs.h | 2 + drivers/sound/Config.in | 2 +- drivers/sound/Makefile | 8 +- drivers/sound/ac97_codec.c | 135 +++++++++++++++++++++------------- drivers/sound/i810_audio.c | 4 + drivers/sound/ymfpci.c | 4 +- drivers/usb/uhci.c | 2 +- drivers/usb/usb-uhci.c | 2 +- include/linux/ac97_codec.h | 2 + init/main.c | 4 + net/ipx/af_ipx.c | 2 +- 21 files changed, 176 insertions(+), 105 deletions(-) diff --git a/Documentation/Configure.help b/Documentation/Configure.help index e8f2160bdeaa..0d1f12798a7a 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -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 diff --git a/Makefile b/Makefile index 958db18579f0..a4b5131f5867 100644 --- 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 diff --git a/arch/i386/kernel/mtrr.c b/arch/i386/kernel/mtrr.c index 292026e31adc..5143c33c2c05 100644 --- a/arch/i386/kernel/mtrr.c +++ b/arch/i386/kernel/mtrr.c @@ -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) diff --git a/drivers/block/rz1000.c b/drivers/block/rz1000.c index fe8c229004db..e250a6d862d6 100644 --- a/drivers/block/rz1000.c +++ b/drivers/block/rz1000.c @@ -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"); } diff --git a/drivers/char/Makefile b/drivers/char/Makefile index fb475531f531..20c34e04e794 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -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 diff --git a/drivers/char/bttv.c b/drivers/char/bttv.c index a09457cb0931..3de59e8eba1d 100644 --- a/drivers/char/bttv.c +++ b/drivers/char/bttv.c @@ -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) */ diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c index 16cd4833b425..16150dc75457 100644 --- a/drivers/char/pc_keyb.c +++ b/drivers/char/pc_keyb.c @@ -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. */ diff --git a/drivers/char/radio-maestro.c b/drivers/char/radio-maestro.c index 662e5c188609..d6a2bf98289a 100644 --- a/drivers/char/radio-maestro.c +++ b/drivers/char/radio-maestro.c @@ -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(); } diff --git a/drivers/net/rclanmtl.c b/drivers/net/rclanmtl.c index 4be76a70d846..04d9b44175c8 100644 --- a/drivers/net/rclanmtl.c +++ b/drivers/net/rclanmtl.c @@ -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); diff --git a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c index 34bcc0551fbb..eb42e822064a 100644 --- a/drivers/net/rcpci45.c +++ b/drivers/net/rcpci45.c @@ -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"); diff --git a/drivers/scsi/sym53c8xx_defs.h b/drivers/scsi/sym53c8xx_defs.h index 168e4cf2e61b..444d56890e1f 100644 --- a/drivers/scsi/sym53c8xx_defs.h +++ b/drivers/scsi/sym53c8xx_defs.h @@ -66,7 +66,9 @@ #endif #include +#ifndef LinuxVersionCode #define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) +#endif /* * NCR PQS/PDS special device support. diff --git a/drivers/sound/Config.in b/drivers/sound/Config.in index 4f086238dbba..f4b5be5b5bdb 100644 --- a/drivers/sound/Config.in +++ b/drivers/sound/Config.in @@ -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 diff --git a/drivers/sound/Makefile b/drivers/sound/Makefile index 09795558e9bb..643aac4ef93c 100644 --- a/drivers/sound/Makefile +++ b/drivers/sound/Makefile @@ -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 diff --git a/drivers/sound/ac97_codec.c b/drivers/sound/ac97_codec.c index ff59d81e9c8d..a9b36e2321f8 100644 --- a/drivers/sound/ac97_codec.c +++ b/drivers/sound/ac97_codec.c @@ -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 */ diff --git a/drivers/sound/i810_audio.c b/drivers/sound/i810_audio.c index 71f9a617cf58..788131f305bc 100644 --- a/drivers/sound/i810_audio.c +++ b/drivers/sound/i810_audio.c @@ -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) diff --git a/drivers/sound/ymfpci.c b/drivers/sound/ymfpci.c index e92129be2dad..c98b25f629fa 100644 --- a/drivers/sound/ymfpci.c +++ b/drivers/sound/ymfpci.c @@ -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, diff --git a/drivers/usb/uhci.c b/drivers/usb/uhci.c index 824d634ba924..45c017743cff 100644 --- a/drivers/usb/uhci.c +++ b/drivers/usb/uhci.c @@ -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; diff --git a/drivers/usb/usb-uhci.c b/drivers/usb/usb-uhci.c index 4d2bcaf9bea9..596de251ef22 100644 --- a/drivers/usb/usb-uhci.c +++ b/drivers/usb/usb-uhci.c @@ -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; diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index 0dee37c21ffc..e4329f844960 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h @@ -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); diff --git a/init/main.c b/init/main.c index 4bbd9157492b..bacfb9717193 100644 --- a/init/main.c +++ b/init/main.c @@ -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 }, diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 3c0e67a8b51c..e66f28cca599 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -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 */ -- 2.39.5