aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83627ehf.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-12-06 17:13:42 -0500
committerMark M. Hoffman <mhoffman@lightlink.com>2008-02-07 20:39:42 -0500
commit67b671bceb4a8340a30929e9642620d99ed5ad76 (patch)
treed302333633bdbd752151933366aaaabfdc60e719 /drivers/hwmon/w83627ehf.c
parentb20ff13a6ad64f07ce78c75e6a335c185270d73c (diff)
hwmon: Let the user override the detected Super-I/O device ID
While it is possible to force SMBus-based hardware monitoring chip drivers to drive a not officially supported device, we do not have this possibility for Super-I/O-based drivers. That's unfortunate because sometimes newer chips are fully compatible and just forcing the driver to load would work. Instead of that we have to tell the users to recompile the kernel driver, which isn't an easy task for everyone. So, I propose that we add a module parameter to all Super-I/O based hardware monitoring drivers, letting advanced users force the driver to load on their machine. The user has to provide the device ID of a supposedly compatible device. This requires looking at the source code or a datasheet, so I am confident that users can't randomly force a driver without knowing what they are doing. Thus this should be relatively safe. As you can see from the code, the implementation is pretty simple and unintrusive. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon/w83627ehf.c')
-rw-r--r--drivers/hwmon/w83627ehf.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index d5aa25ce5dbd..699592855bd8 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -59,6 +59,10 @@ static const char * w83627ehf_device_names[] = {
59 "w83627dhg", 59 "w83627dhg",
60}; 60};
61 61
62static unsigned short force_id;
63module_param(force_id, ushort, 0);
64MODULE_PARM_DESC(force_id, "Override the detected device ID");
65
62#define DRVNAME "w83627ehf" 66#define DRVNAME "w83627ehf"
63 67
64/* 68/*
@@ -1445,8 +1449,11 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
1445 1449
1446 superio_enter(sioaddr); 1450 superio_enter(sioaddr);
1447 1451
1448 val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) 1452 if (force_id)
1449 | superio_inb(sioaddr, SIO_REG_DEVID + 1); 1453 val = force_id;
1454 else
1455 val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8)
1456 | superio_inb(sioaddr, SIO_REG_DEVID + 1);
1450 switch (val & SIO_ID_MASK) { 1457 switch (val & SIO_ID_MASK) {
1451 case SIO_W83627EHF_ID: 1458 case SIO_W83627EHF_ID:
1452 sio_data->kind = w83627ehf; 1459 sio_data->kind = w83627ehf;