aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c22
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
83static inline void
84superio_outb(int reg, int val)
85{
86 outb(reg, REG);
87 outb(val, VAL);
88}
89
83static int superio_inw(int reg) 90static 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))