summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
authorAndrew Paprocki <andrew@ishiboo.com>2008-08-06 22:41:06 +0200
committerJean Delvare <khali@mahadeva.delvare>2008-08-06 22:41:06 +0200
commit816d8c6a2580562698cf0fa0b9e5b4dd570e636e (patch)
tree6f2b41ba4e144a04315fe56cb50998e8cd3ae24d /drivers/hwmon/it87.c
parent0475169c13e177e1af5a02f5e9f30fda13dc0b86 (diff)
downloadtalos-op-linux-816d8c6a2580562698cf0fa0b9e5b4dd570e636e.tar.gz
talos-op-linux-816d8c6a2580562698cf0fa0b9e5b4dd570e636e.zip
hwmon: (it87) Support for 16-bit fan reading in it8705 >= rev 0x03
The it8705 chip supports 16-bit fan tachometers in revisions at least >= 0x03 (Version G). This patch enables 16-bit fan readings on all revisions >= 0x03 just like the it8712, it8716, and it8718 chips. Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 2a365681f969..30cdb0956779 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -272,9 +272,11 @@ struct it87_data {
static inline int has_16bit_fans(const struct it87_data *data)
{
- /* IT8712F Datasheet 0.9.1, section 8.3.5 indicates 7h == Version I.
- This is the first revision with 16bit tachometer support. */
- return (data->type == it8712 && data->revision >= 0x07)
+ /* IT8705F Datasheet 0.4.1, 3h == Version G.
+ IT8712F Datasheet 0.9.1, section 8.3.5 indicates 7h == Version I.
+ These are the first revisions with 16bit tachometer support. */
+ return (data->type == it87 && data->revision >= 0x03)
+ || (data->type == it8712 && data->revision >= 0x07)
|| data->type == it8716
|| data->type == it8718;
}
@@ -1370,10 +1372,13 @@ static void __devinit it87_init_device(struct platform_device *pdev)
it87_write_value(data, IT87_REG_FAN_16BIT,
tmp | 0x07);
}
- if (tmp & (1 << 4))
- data->has_fan |= (1 << 3); /* fan4 enabled */
- if (tmp & (1 << 5))
- data->has_fan |= (1 << 4); /* fan5 enabled */
+ /* IT8705F only supports three fans. */
+ if (data->type != it87) {
+ if (tmp & (1 << 4))
+ data->has_fan |= (1 << 3); /* fan4 enabled */
+ if (tmp & (1 << 5))
+ data->has_fan |= (1 << 4); /* fan5 enabled */
+ }
}
/* Set current fan mode registers and the default settings for the
OpenPOWER on IntegriCloud