From 67b671bceb4a8340a30929e9642620d99ed5ad76 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 6 Dec 2007 23:13:42 +0100 Subject: 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 Acked-by: Hans de Goede Signed-off-by: Mark M. Hoffman --- drivers/hwmon/vt1211.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/hwmon/vt1211.c') diff --git a/drivers/hwmon/vt1211.c b/drivers/hwmon/vt1211.c index 7dfcc8d..12b4359 100644 --- a/drivers/hwmon/vt1211.c +++ b/drivers/hwmon/vt1211.c @@ -42,6 +42,10 @@ static int int_mode = -1; module_param(int_mode, int, 0); MODULE_PARM_DESC(int_mode, "Force the temperature interrupt mode"); +static unsigned short force_id; +module_param(force_id, ushort, 0); +MODULE_PARM_DESC(force_id, "Override the detected device ID"); + static struct platform_device *pdev; #define DRVNAME "vt1211" @@ -1280,10 +1284,12 @@ EXIT: static int __init vt1211_find(int sio_cip, unsigned short *address) { int err = -ENODEV; + int devid; superio_enter(sio_cip); - if (superio_inb(sio_cip, SIO_VT1211_DEVID) != SIO_VT1211_ID) { + devid = force_id ? force_id : superio_inb(sio_cip, SIO_VT1211_DEVID); + if (devid != SIO_VT1211_ID) { goto EXIT; } -- cgit v1.1