diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-04-05 19:51:36 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2016-04-19 09:32:37 -0400 |
commit | a0df926d33232f311d6a4d834391fec21b60db30 (patch) | |
tree | f394cadb4224f886eb685180fea1901f46402619 | |
parent | f1bbe618604a4aa833a4af0b1ecdfb47a25455c6 (diff) |
hwmon: (it87) Enhance validation for fan4 and fan5
Several of the chips supported by this driver have a configuration
register to enable fan4 and fan5. Use those registers to determine
if fan4 and fan5 tachometers are supported.
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/it87.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index f40d81a0a9fc..5adb269918fb 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -2415,6 +2415,29 @@ static int __init it87_find(int sioaddr, unsigned short *address, | |||
2415 | 2415 | ||
2416 | superio_select(sioaddr, GPIO); | 2416 | superio_select(sioaddr, GPIO); |
2417 | 2417 | ||
2418 | /* Check for fan4, fan5 */ | ||
2419 | if (has_five_fans(config)) { | ||
2420 | reg = superio_inb(sioaddr, IT87_SIO_GPIO2_REG); | ||
2421 | switch (sio_data->type) { | ||
2422 | case it8718: | ||
2423 | if (reg & BIT(5)) | ||
2424 | sio_data->skip_fan |= BIT(3); | ||
2425 | if (reg & BIT(4)) | ||
2426 | sio_data->skip_fan |= BIT(4); | ||
2427 | break; | ||
2428 | case it8720: | ||
2429 | case it8721: | ||
2430 | case it8728: | ||
2431 | if (!(reg & BIT(5))) | ||
2432 | sio_data->skip_fan |= BIT(3); | ||
2433 | if (!(reg & BIT(4))) | ||
2434 | sio_data->skip_fan |= BIT(4); | ||
2435 | break; | ||
2436 | default: | ||
2437 | break; | ||
2438 | } | ||
2439 | } | ||
2440 | |||
2418 | reg = superio_inb(sioaddr, IT87_SIO_GPIO3_REG); | 2441 | reg = superio_inb(sioaddr, IT87_SIO_GPIO3_REG); |
2419 | if (!sio_data->skip_vid) { | 2442 | if (!sio_data->skip_vid) { |
2420 | /* We need at least 4 VID pins */ | 2443 | /* We need at least 4 VID pins */ |