aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/f71882fg.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/f71882fg.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/f71882fg.c')
-rw-r--r--drivers/hwmon/f71882fg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index 6db74434a02e..cbeb4984b5c7 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -74,6 +74,10 @@
74 74
75#define FAN_MIN_DETECT 366 /* Lowest detectable fanspeed */ 75#define FAN_MIN_DETECT 366 /* Lowest detectable fanspeed */
76 76
77static unsigned short force_id;
78module_param(force_id, ushort, 0);
79MODULE_PARM_DESC(force_id, "Override the detected device ID");
80
77static struct platform_device *f71882fg_pdev = NULL; 81static struct platform_device *f71882fg_pdev = NULL;
78 82
79/* Super-I/O Function prototypes */ 83/* Super-I/O Function prototypes */
@@ -843,7 +847,7 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address)
843 goto exit; 847 goto exit;
844 } 848 }
845 849
846 devid = superio_inw(sioaddr, SIO_REG_DEVID); 850 devid = force_id ? force_id : superio_inw(sioaddr, SIO_REG_DEVID);
847 if (devid != SIO_F71882_ID) { 851 if (devid != SIO_F71882_ID) {
848 printk(KERN_INFO DRVNAME ": Unsupported Fintek device\n"); 852 printk(KERN_INFO DRVNAME ": Unsupported Fintek device\n");
849 goto exit; 853 goto exit;