diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2007-05-08 00:36:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:23 -0700 |
commit | a1e7e636fe9fff531a4fc42e65c8e8416fde5220 (patch) | |
tree | dcc11bc52b2a6be8b1da53d9a7b22b37595a209b | |
parent | 8f81dd149806bc53c68c92f34d61f88427079039 (diff) | |
download | linux-stable-a1e7e636fe9fff531a4fc42e65c8e8416fde5220.tar.gz linux-stable-a1e7e636fe9fff531a4fc42e65c8e8416fde5220.tar.bz2 linux-stable-a1e7e636fe9fff531a4fc42e65c8e8416fde5220.zip |
PNP: workaround HP BIOS defect that leaves SMCF010 device partly enabled
Some HP/Compaq firmware reports via ACPI that the SMCF010 IR device is
enabled, but in fact, it leaves the device partly disabled.
HP nw8240 BIOS 68DTV Ver. F.0F, released 9/15/2005 is one BIOS that has this
problem.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Keith Owens <kaos@ocs.com.au>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Russell King <rmk+serial@arm.linux.org.uk>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/pnp/quirks.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index e97ecefe8584..277df50c89ae 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -16,6 +16,7 @@ #include <linux/string.h> #include <linux/slab.h> #include <linux/pnp.h> +#include <linux/io.h> #include "base.h" @@ -106,6 +107,34 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev) return; } +static void quirk_smc_enable(struct pnp_dev *dev) +{ + unsigned int firbase; + + if (!dev->active || !pnp_port_valid(dev, 1)) + return; + + /* + * On the HP/Compaq nw8240 (and probably other similar machines), + * there is an SMCF010 device with two I/O port regions: + * + * 0x3e8-0x3ef SIR + * 0x100-0x10f FIR + * + * _STA reports the device is enabled, but in fact, the BIOS + * neglects to enable the FIR range. Fortunately, it does fully + * enable the device if we call _SRS. + */ + firbase = pnp_port_start(dev, 1); + if (inb(firbase + 0x7 /* IRCC_MASTER */) == 0xff) { + pnp_err("%s (%s) enabled but not responding, disabling and " + "re-enabling", dev->dev.bus_id, pnp_dev_name(dev)); + pnp_disable_dev(dev); + pnp_activate_dev(dev); + } +} + + /* * PnP Quirks * Cards or devices that need some tweaking due to incomplete resource info @@ -126,6 +155,7 @@ static struct pnp_fixup pnp_fixups[] = { { "CTL0043", quirk_sb16audio_resources }, { "CTL0044", quirk_sb16audio_resources }, { "CTL0045", quirk_sb16audio_resources }, + { "SMCf010", quirk_smc_enable }, { "" } }; |