summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-04-05 16:51:36 -0700
committerGuenter Roeck <linux@roeck-us.net>2016-04-19 06:32:37 -0700
commita0df926d33232f311d6a4d834391fec21b60db30 (patch)
treef394cadb4224f886eb685180fea1901f46402619 /drivers/hwmon
parentf1bbe618604a4aa833a4af0b1ecdfb47a25455c6 (diff)
downloadlinux-a0df926d33232f311d6a4d834391fec21b60db30.tar.bz2
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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/it87.c23
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,
superio_select(sioaddr, GPIO);
+ /* Check for fan4, fan5 */
+ if (has_five_fans(config)) {
+ reg = superio_inb(sioaddr, IT87_SIO_GPIO2_REG);
+ switch (sio_data->type) {
+ case it8718:
+ if (reg & BIT(5))
+ sio_data->skip_fan |= BIT(3);
+ if (reg & BIT(4))
+ sio_data->skip_fan |= BIT(4);
+ break;
+ case it8720:
+ case it8721:
+ case it8728:
+ if (!(reg & BIT(5)))
+ sio_data->skip_fan |= BIT(3);
+ if (!(reg & BIT(4)))
+ sio_data->skip_fan |= BIT(4);
+ break;
+ default:
+ break;
+ }
+ }
+
reg = superio_inb(sioaddr, IT87_SIO_GPIO3_REG);
if (!sio_data->skip_vid) {
/* We need at least 4 VID pins */