diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-07-09 10:22:48 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-07-09 10:22:48 -0400 |
commit | 436cad2a41a40c6c32bd9152b63d17eeb1f7c99b (patch) | |
tree | d6077cd22d86eabaa6a833b67b27d00e4cac5873 /drivers/hwmon | |
parent | d535bad90dad4eb42ec6528043fcfb53627d4f89 (diff) |
hwmon: (it87) Fix in7 on IT8720F
The IT8720F has no VIN7 pin, so VCCH should always be routed
internally to VIN7 with an internal divider. Curiously, there still
is a configuration bit to control this, which means it can be set
incorrectly. And even more curiously, many boards out there are
improperly configured, even though the IT8720F datasheet claims that
the internal routing of VCCH to VIN7 is the default setting. So we
force the internal routing in this case.
It turns out that all boards with the wrong setting are from Gigabyte,
so I suspect a BIOS bug. But it's easy enough to workaround in the
driver, so let's do it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jean-Marc Spaggiari <jean-marc@spaggiari.org>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/it87.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 5be09c048c5f..25763d2223b6 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -80,6 +80,13 @@ superio_inb(int reg) | |||
80 | return inb(VAL); | 80 | return inb(VAL); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline void | ||
84 | superio_outb(int reg, int val) | ||
85 | { | ||
86 | outb(reg, REG); | ||
87 | outb(val, VAL); | ||
88 | } | ||
89 | |||
83 | static int superio_inw(int reg) | 90 | static int superio_inw(int reg) |
84 | { | 91 | { |
85 | int val; | 92 | int val; |
@@ -1517,6 +1524,21 @@ static int __init it87_find(unsigned short *address, | |||
1517 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); | 1524 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); |
1518 | 1525 | ||
1519 | reg = superio_inb(IT87_SIO_PINX2_REG); | 1526 | reg = superio_inb(IT87_SIO_PINX2_REG); |
1527 | /* | ||
1528 | * The IT8720F has no VIN7 pin, so VCCH should always be | ||
1529 | * routed internally to VIN7 with an internal divider. | ||
1530 | * Curiously, there still is a configuration bit to control | ||
1531 | * this, which means it can be set incorrectly. And even | ||
1532 | * more curiously, many boards out there are improperly | ||
1533 | * configured, even though the IT8720F datasheet claims | ||
1534 | * that the internal routing of VCCH to VIN7 is the default | ||
1535 | * setting. So we force the internal routing in this case. | ||
1536 | */ | ||
1537 | if (sio_data->type == it8720 && !(reg & (1 << 1))) { | ||
1538 | reg |= (1 << 1); | ||
1539 | superio_outb(IT87_SIO_PINX2_REG, reg); | ||
1540 | pr_notice("it87: Routing internal VCCH to in7\n"); | ||
1541 | } | ||
1520 | if (reg & (1 << 0)) | 1542 | if (reg & (1 << 0)) |
1521 | pr_info("it87: in3 is VCC (+5V)\n"); | 1543 | pr_info("it87: in3 is VCC (+5V)\n"); |
1522 | if (reg & (1 << 1)) | 1544 | if (reg & (1 << 1)) |