Commit 663a6746 authored by Rudolf Marek's avatar Rudolf Marek Committed by Greg Kroah-Hartman

[PATCH] I2C: fix it8712 detection

Following patch fixes the bug introduced by me in VID VRM patch.
Spotted (and later reviewed) by Jean Delvare. This bug is non-fatal,
it8712 will be just treated as it was before my VID VRM patch.

Tested on it8705 and it8712  hardware.
Signed-off-by: default avatarRudolf Marek <r.marek@sh.cvut.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent fe394f66
...@@ -105,6 +105,10 @@ static int update_vbat; ...@@ -105,6 +105,10 @@ static int update_vbat;
/* Reset the registers on init if true */ /* Reset the registers on init if true */
static int reset; static int reset;
/* Chip Type */
static u16 chip_type;
/* Many IT87 constants specified below */ /* Many IT87 constants specified below */
/* Length of ISA address segment */ /* Length of ISA address segment */
...@@ -592,9 +596,9 @@ static int it87_find(int *address) ...@@ -592,9 +596,9 @@ static int it87_find(int *address)
u16 val; u16 val;
superio_enter(); superio_enter();
val = (superio_inb(DEVID) << 8) | chip_type = (superio_inb(DEVID) << 8) |
superio_inb(DEVID + 1); superio_inb(DEVID + 1);
if (val != IT8712F_DEVID) { if (chip_type != IT8712F_DEVID) {
superio_exit(); superio_exit();
return -ENODEV; return -ENODEV;
} }
...@@ -691,11 +695,9 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -691,11 +695,9 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
if (kind <= 0) { if (kind <= 0) {
i = it87_read_value(new_client, IT87_REG_CHIPID); i = it87_read_value(new_client, IT87_REG_CHIPID);
if (i == 0x90) { if (i == 0x90) {
u16 val;
kind = it87; kind = it87;
val = (superio_inb(DEVID) << 8) | if ((is_isa) && (chip_type == IT8712F_DEVID))
superio_inb(DEVID + 1); kind = it8712;
if (val == IT8712F_DEVID) kind = it8712;
} }
else { else {
if (kind == 0) if (kind == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment