Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+22
+22
drivers/hwmon/it87.c
··· 80 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 90 static int superio_inw(int reg) 84 91 { 85 92 int val; ··· 1524 1517 sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); 1525 1518 1526 1519 reg = superio_inb(IT87_SIO_PINX2_REG); 1520 + /* 1521 + * The IT8720F has no VIN7 pin, so VCCH should always be 1522 + * routed internally to VIN7 with an internal divider. 1523 + * Curiously, there still is a configuration bit to control 1524 + * this, which means it can be set incorrectly. And even 1525 + * more curiously, many boards out there are improperly 1526 + * configured, even though the IT8720F datasheet claims 1527 + * that the internal routing of VCCH to VIN7 is the default 1528 + * setting. So we force the internal routing in this case. 1529 + */ 1530 + if (sio_data->type == it8720 && !(reg & (1 << 1))) { 1531 + reg |= (1 << 1); 1532 + superio_outb(IT87_SIO_PINX2_REG, reg); 1533 + pr_notice("it87: Routing internal VCCH to in7\n"); 1534 + } 1527 1535 if (reg & (1 << 0)) 1528 1536 pr_info("it87: in3 is VCC (+5V)\n"); 1529 1537 if (reg & (1 << 1))