From 3c9261ee8d2f5f0031e010a39b7d308bdfbbe83b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 9 Jul 2010 16:22:48 +0200 Subject: [PATCH] --- yaml --- r: 200946 b: refs/heads/master c: 436cad2a41a40c6c32bd9152b63d17eeb1f7c99b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/it87.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e224be84d54e..42c42201fc21 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d535bad90dad4eb42ec6528043fcfb53627d4f89 +refs/heads/master: 436cad2a41a40c6c32bd9152b63d17eeb1f7c99b diff --git a/trunk/drivers/hwmon/it87.c b/trunk/drivers/hwmon/it87.c index 5be09c048c5f..25763d2223b6 100644 --- a/trunk/drivers/hwmon/it87.c +++ b/trunk/drivers/hwmon/it87.c @@ -80,6 +80,13 @@ superio_inb(int reg) return inb(VAL); } +static inline void +superio_outb(int reg, int val) +{ + outb(reg, REG); + outb(val, VAL); +} + static int superio_inw(int reg) { int val; @@ -1517,6 +1524,21 @@ static int __init it87_find(unsigned short *address, sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); reg = superio_inb(IT87_SIO_PINX2_REG); + /* + * 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. + */ + if (sio_data->type == it8720 && !(reg & (1 << 1))) { + reg |= (1 << 1); + superio_outb(IT87_SIO_PINX2_REG, reg); + pr_notice("it87: Routing internal VCCH to in7\n"); + } if (reg & (1 << 0)) pr_info("it87: in3 is VCC (+5V)\n"); if (reg & (1 << 1))