From 2ae7fe9debb8aa20a81b2e45c0b8e592939807ce Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Sun, 13 Dec 1998 14:03:28 +0000 Subject: [PATCH] Winbond-over-SMBus addition git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@74 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/lm78.c | 7 ++++++- src/lm78.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/kernel/chips/lm78.c b/kernel/chips/lm78.c index 27b21a9c..e91d31be 100644 --- a/kernel/chips/lm78.c +++ b/kernel/chips/lm78.c @@ -448,7 +448,7 @@ int lm78_detect_smbus(struct i2c_adapter *adapter) /* Later on, we will keep a list of registered addresses for each adapter, and check whether they are used here */ - if (smbus_read_byte_data(adapter,address,LM78_REG_CONFIG) == 0xff) + if (smbus_read_byte_data(adapter,address,LM78_REG_CONFIG) < 0) continue; /* Real detection code goes here */ @@ -467,6 +467,11 @@ int lm78_detect_smbus(struct i2c_adapter *adapter) type = lm79; type_name = "lm79"; client_name = "LM79 chip"; + } else if (err == 0x02) { + printk("lm78.o: Warning: Winbond W83781D detected (treated as a LM79)\n"); + type = lm79; + type_name = "lm79"; + client_name = "LM79 chip"; } else { #ifdef DEBUG printk("lm78.o: warning: probed non-lm78 chip?!? (%x)\n",err); diff --git a/src/lm78.c b/src/lm78.c index 27b21a9c..e91d31be 100644 --- a/src/lm78.c +++ b/src/lm78.c @@ -448,7 +448,7 @@ int lm78_detect_smbus(struct i2c_adapter *adapter) /* Later on, we will keep a list of registered addresses for each adapter, and check whether they are used here */ - if (smbus_read_byte_data(adapter,address,LM78_REG_CONFIG) == 0xff) + if (smbus_read_byte_data(adapter,address,LM78_REG_CONFIG) < 0) continue; /* Real detection code goes here */ @@ -467,6 +467,11 @@ int lm78_detect_smbus(struct i2c_adapter *adapter) type = lm79; type_name = "lm79"; client_name = "LM79 chip"; + } else if (err == 0x02) { + printk("lm78.o: Warning: Winbond W83781D detected (treated as a LM79)\n"); + type = lm79; + type_name = "lm79"; + client_name = "LM79 chip"; } else { #ifdef DEBUG printk("lm78.o: warning: probed non-lm78 chip?!? (%x)\n",err);