aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/quirks.c30
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 @@
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/pnp.h> 18#include <linux/pnp.h>
19#include <linux/io.h>
19#include "base.h" 20#include "base.h"
20 21
21 22
@@ -106,6 +107,34 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
106 return; 107 return;
107} 108}
108 109
110static void quirk_smc_enable(struct pnp_dev *dev)
111{
112 unsigned int firbase;
113
114 if (!dev->active || !pnp_port_valid(dev, 1))
115 return;
116
117 /*
118 * On the HP/Compaq nw8240 (and probably other similar machines),
119 * there is an SMCF010 device with two I/O port regions:
120 *
121 * 0x3e8-0x3ef SIR
122 * 0x100-0x10f FIR
123 *
124 * _STA reports the device is enabled, but in fact, the BIOS
125 * neglects to enable the FIR range. Fortunately, it does fully
126 * enable the device if we call _SRS.
127 */
128 firbase = pnp_port_start(dev, 1);
129 if (inb(firbase + 0x7 /* IRCC_MASTER */) == 0xff) {
130 pnp_err("%s (%s) enabled but not responding, disabling and "
131 "re-enabling", dev->dev.bus_id, pnp_dev_name(dev));
132 pnp_disable_dev(dev);
133 pnp_activate_dev(dev);
134 }
135}
136
137
109/* 138/*
110 * PnP Quirks 139 * PnP Quirks
111 * Cards or devices that need some tweaking due to incomplete resource info 140 * Cards or devices that need some tweaking due to incomplete resource info
@@ -126,6 +155,7 @@ static struct pnp_fixup pnp_fixups[] = {
126 { "CTL0043", quirk_sb16audio_resources }, 155 { "CTL0043", quirk_sb16audio_resources },
127 { "CTL0044", quirk_sb16audio_resources }, 156 { "CTL0044", quirk_sb16audio_resources },
128 { "CTL0045", quirk_sb16audio_resources }, 157 { "CTL0045", quirk_sb16audio_resources },
158 { "SMCf010", quirk_smc_enable },
129 { "" } 159 { "" }
130}; 160};
131 161