diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-12-06 17:13:42 -0500 |
---|---|---|
committer | Mark M. Hoffman <mhoffman@lightlink.com> | 2008-02-07 20:39:42 -0500 |
commit | 67b671bceb4a8340a30929e9642620d99ed5ad76 (patch) | |
tree | d302333633bdbd752151933366aaaabfdc60e719 /drivers/hwmon/w83627hf.c | |
parent | b20ff13a6ad64f07ce78c75e6a335c185270d73c (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/w83627hf.c')
-rw-r--r-- | drivers/hwmon/w83627hf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c index 879d0a6544cc..181f4e8590b1 100644 --- a/drivers/hwmon/w83627hf.c +++ b/drivers/hwmon/w83627hf.c | |||
@@ -75,6 +75,10 @@ static int init = 1; | |||
75 | module_param(init, bool, 0); | 75 | module_param(init, bool, 0); |
76 | MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization"); | 76 | MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization"); |
77 | 77 | ||
78 | static unsigned short force_id; | ||
79 | module_param(force_id, ushort, 0); | ||
80 | MODULE_PARM_DESC(force_id, "Override the detected device ID"); | ||
81 | |||
78 | /* modified from kernel/include/traps.c */ | 82 | /* modified from kernel/include/traps.c */ |
79 | static int REG; /* The register to read/write */ | 83 | static int REG; /* The register to read/write */ |
80 | #define DEV 0x07 /* Register: Logical device select */ | 84 | #define DEV 0x07 /* Register: Logical device select */ |
@@ -1014,7 +1018,7 @@ static int __init w83627hf_find(int sioaddr, unsigned short *addr, | |||
1014 | VAL = sioaddr + 1; | 1018 | VAL = sioaddr + 1; |
1015 | 1019 | ||
1016 | superio_enter(); | 1020 | superio_enter(); |
1017 | val= superio_inb(DEVID); | 1021 | val = force_id ? force_id : superio_inb(DEVID); |
1018 | switch (val) { | 1022 | switch (val) { |
1019 | case W627_DEVID: | 1023 | case W627_DEVID: |
1020 | sio_data->type = w83627hf; | 1024 | sio_data->type = w83627hf; |