mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-02 15:25:38 +00:00
Changes regarding the new i2c_check_addr function
Changes in sensors.c: sensors_detect now skips addresses which are already taken. Even a force parameter can not override this, as it could lead to major problems. For ISA addresses, the same is done; but the client drivers still need a check if they claim more than one ISA address (as all of the current ISA clients do). Changes in chip drivers: Removed the comment about needing address registration Changes in i2cdetect.c: Marks addresses which are already claimed Changes in sensors-detect: Warns when an address is already claimed, and skips it. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@667 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
2
TODO
2
TODO
@@ -25,7 +25,7 @@ KERNEL MODULES
|
||||
in Simon Vogl's i2c modules.
|
||||
* Better general locking, or at least a once-over to check no race-conditions
|
||||
remain. This is part of the SMP-safeness, and can better be done at once.
|
||||
* Test SIS5595(/91/98) sensor support. Write generic i2c support.
|
||||
* Test SIS5595(/91/98) sensor support and SMBus support
|
||||
Thomas Dickel <Thomas.Dickel@mni.fh-giessen.de> owns one SIS5595.
|
||||
* adm9240: check whether the current voltage computations are correct.
|
||||
Probably not, as they are different from the datasheet specifications.
|
||||
|
@@ -213,9 +213,6 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address,
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access adm1021_{read,write}_value. */
|
||||
|
@@ -367,9 +367,6 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address,
|
||||
if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access adm9240_{read,write}_value. */
|
||||
|
@@ -185,9 +185,6 @@ printk("bt869.o: probing address %d .\n",address);
|
||||
I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access bt869_{read,write}_value. */
|
||||
|
@@ -180,9 +180,6 @@ int eeprom_detect(struct i2c_adapter *adapter, int address,
|
||||
I2C_FUNC_SMBUS_WRITE_WORD_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access eeprom_{read,write}_value. */
|
||||
|
@@ -317,9 +317,6 @@ static int gl518_detect(struct i2c_adapter *adapter, int address,
|
||||
I2C_FUNC_SMBUS_WORD_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access gl518_{read,write}_value. */
|
||||
|
@@ -312,9 +312,6 @@ static int gl520_detect(struct i2c_adapter *adapter, int address,
|
||||
I2C_FUNC_SMBUS_WORD_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access gl520_{read,write}_value. */
|
||||
|
@@ -159,9 +159,6 @@ int lm75_detect(struct i2c_adapter *adapter, int address,
|
||||
I2C_FUNC_SMBUS_WORD_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access lm75_{read,write}_value. */
|
||||
|
@@ -319,8 +319,6 @@ int lm78_detect(struct i2c_adapter *adapter, int address,
|
||||
if (!is_isa && ! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
if (is_isa) {
|
||||
if (check_region(address,LM78_EXTENT))
|
||||
goto ERROR0;
|
||||
|
@@ -310,9 +310,6 @@ int lm80_detect(struct i2c_adapter *adapter, int address,
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access lm80_{read,write}_value. */
|
||||
|
@@ -172,9 +172,6 @@ int ltc1710_detect(struct i2c_adapter *adapter, int address,
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE))
|
||||
goto ERROR0;
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access ltc1710_{read,write}_value. */
|
||||
|
@@ -146,9 +146,6 @@ int matorb_detect(struct i2c_adapter *adapter, int address,
|
||||
goto ERROR0;
|
||||
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access matorb_{read,write}_value. */
|
||||
|
@@ -204,9 +204,6 @@ int thmc50_detect(struct i2c_adapter *adapter, int address,
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* Here, we have to do the address registration check for the I2C bus.
|
||||
But that is not yet implemented. */
|
||||
|
||||
/* OK. For now, we presume we have a valid client. We now create the
|
||||
client structure, even though we cannot fill it completely yet.
|
||||
But it allows us to access thmc50_{read,write}_value. */
|
||||
|
@@ -653,8 +653,6 @@ int w83781d_detect(struct i2c_adapter *adapter, int address,
|
||||
if (!is_isa && ! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
if (is_isa) {
|
||||
if (check_region(address,W83781D_EXTENT))
|
||||
goto ERROR0;
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/ioport.h>
|
||||
|
||||
#include "version.h"
|
||||
#include <linux/i2c.h>
|
||||
@@ -613,6 +614,9 @@ int sensors_detect(struct i2c_adapter *adapter,
|
||||
for (addr = 0x00;
|
||||
addr <= (is_isa?0xffff:0x7f);
|
||||
addr ++) {
|
||||
if ((is_isa && check_region(addr,1)) ||
|
||||
(!is_isa && i2c_check_addr(adapter,addr)))
|
||||
continue;
|
||||
|
||||
/* If it is in one of the force entries, we don't do any detection
|
||||
at all */
|
||||
|
@@ -87,10 +87,15 @@ int main(int argc, char *argv[])
|
||||
printf("%02x: ",i);
|
||||
for(j = 0; j < 16; j++) {
|
||||
if (ioctl(file,I2C_SLAVE,i+j) < 0) {
|
||||
fprintf(stderr,"Error: Could not set address to %d: %s\n",i+j,
|
||||
if (errno == EBUSY) {
|
||||
printf("UU ");
|
||||
continue;
|
||||
} else {
|
||||
fprintf(stderr,"Error: Could not set address to %02x: %s\n",i+j,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
res = i2c_smbus_write_quick(file, I2C_SMBUS_WRITE);
|
||||
if (res < 0)
|
||||
|
@@ -1082,8 +1082,8 @@ sub scan_adapter
|
||||
next;
|
||||
}
|
||||
|
||||
i2c_set_slave_addr(\*FILE,$addr) or print("Can't set address to $_?!?\n"),
|
||||
next;
|
||||
i2c_set_slave_addr(\*FILE,$addr) or
|
||||
printf("Client at address 0x%02x can not be probed - unload all client drivers first!\n",$addr), next;
|
||||
|
||||
next unless i2c_smbus_write_quick(\*FILE,$SMBUS_WRITE) >= 0;
|
||||
printf "Client found at address 0x%02x\n",$addr;
|
||||
|
Reference in New Issue
Block a user