aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/smsc47b397.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/smsc47b397.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/smsc47b397.c')
-rw-r--r--drivers/hwmon/smsc47b397.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c
index 0b57d2ea2cf7..f61d8f4185b2 100644
--- a/drivers/hwmon/smsc47b397.c
+++ b/drivers/hwmon/smsc47b397.c
@@ -38,6 +38,10 @@
38#include <linux/mutex.h> 38#include <linux/mutex.h>
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41static unsigned short force_id;
42module_param(force_id, ushort, 0);
43MODULE_PARM_DESC(force_id, "Override the detected device ID");
44
41static struct platform_device *pdev; 45static struct platform_device *pdev;
42 46
43#define DRVNAME "smsc47b397" 47#define DRVNAME "smsc47b397"
@@ -333,7 +337,7 @@ static int __init smsc47b397_find(unsigned short *addr)
333 u8 id, rev; 337 u8 id, rev;
334 338
335 superio_enter(); 339 superio_enter();
336 id = superio_inb(SUPERIO_REG_DEVID); 340 id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
337 341
338 if ((id != 0x6f) && (id != 0x81) && (id != 0x85)) { 342 if ((id != 0x6f) && (id != 0x81) && (id != 0x85)) {
339 superio_exit(); 343 superio_exit();