mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
`functionality' checking for clients implemented
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@584 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
e9ac105d87
commit
9d88e65c71
16 files changed
+58
-5
No files matched your search
@@ -207,6 +207,8 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
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. */
|
||||
|
||||
@@ -361,6 +361,9 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
@@ -178,6 +178,10 @@ printk("bt869.o: probing address %d .\n",address);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_READ_BYTE|
|
||||
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. */
|
||||
|
||||
|
||||
@@ -173,6 +173,10 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA |
|
||||
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. */
|
||||
|
||||
|
||||
@@ -303,6 +303,9 @@ static int gl518_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA |
|
||||
I2C_FUNC_SMBUS_WORD_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
|
||||
@@ -305,6 +305,9 @@ static int gl520_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA|
|
||||
I2C_FUNC_SMBUS_WORD_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
/* We need address registration for the I2C bus too. That is not yet
|
||||
implemented. */
|
||||
|
||||
@@ -152,6 +152,10 @@ int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA |
|
||||
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. */
|
||||
|
||||
|
||||
@@ -313,6 +313,9 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
const char *client_name = "";
|
||||
int is_isa = i2c_is_isa_adapter(adapter);
|
||||
|
||||
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) {
|
||||
|
||||
@@ -299,6 +299,9 @@ int lm80_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
@@ -166,6 +166,9 @@ int ltc1710_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
@@ -138,6 +138,11 @@ int matorb_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WRITE_BYTE |
|
||||
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. */
|
||||
|
||||
|
||||
+10
-1
@@ -49,6 +49,7 @@ static const char *version_str = "1.00 25/2/99 Fons Rademakers";
|
||||
#include <linux/i2c.h>
|
||||
#include "version.h"
|
||||
#include "sensors.h"
|
||||
#include "i2c-isa.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
@@ -264,7 +265,10 @@ static ctl_table maxi_dir_table_template[] = {
|
||||
- when a new adapter is inserted (and maxi_driver is still present) */
|
||||
int maxi_attach_adapter(struct i2c_adapter *adapter)
|
||||
{
|
||||
return maxi_detect_smbus(adapter);
|
||||
if (i2c_is_isa_adapter(adapter))
|
||||
return 0;
|
||||
else
|
||||
return maxi_detect_smbus(adapter);
|
||||
}
|
||||
|
||||
/* This function is called whenever a client should be removed:
|
||||
@@ -288,6 +292,10 @@ int maxi_detect_smbus(struct i2c_adapter *adapter)
|
||||
|
||||
/* OK, this is no detection. I know. It will do for now, though. */
|
||||
err = 0;
|
||||
|
||||
if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_BYTE_DATA))
|
||||
goto ERROR0;
|
||||
|
||||
for (address = 0x10; (! err) && (address <= 0x14); address++) {
|
||||
|
||||
/* Later on, we will keep a list of registered addresses for each
|
||||
@@ -375,6 +383,7 @@ ERROR3:
|
||||
ERROR2:
|
||||
kfree(new_client);
|
||||
}
|
||||
ERROR0:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -312,14 +312,11 @@ int sis5595_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
const char *type_name = "";
|
||||
const char *client_name = "";
|
||||
|
||||
/* Make sure we are probing the ISA bus!! This is just a safety check
|
||||
at this moment; sensors_detect really won't call us for I2C busses. */
|
||||
#ifdef DEBUG
|
||||
/* Make sure we are probing the ISA bus!! */
|
||||
if (!i2c_is_isa_adapter(adapter)) {
|
||||
printk("sis5595.o: sis5595_detect called for an I2C bus adapter?!?\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (check_region(address,SIS5595_EXTENT))
|
||||
goto ERROR0;
|
||||
|
||||
@@ -198,6 +198,9 @@ int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
}
|
||||
#endif
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
@@ -645,6 +645,9 @@ int w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
const char *client_name = "";
|
||||
int is_isa = i2c_is_isa_adapter(adapter);
|
||||
|
||||
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) {
|
||||
|
||||
@@ -594,6 +594,10 @@ int sensors_detect(struct i2c_adapter *adapter,
|
||||
int is_isa = i2c_is_isa_adapter(adapter);
|
||||
int adapter_id = is_isa?SENSORS_ISA_BUS:i2c_adapter_id(adapter);
|
||||
|
||||
/* Forget it if we can't probe using SMBUS_QUICK */
|
||||
if ((! is_isa) && ! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_QUICK))
|
||||
return -1;
|
||||
|
||||
for (addr = 0x00;
|
||||
addr <= (is_isa?0xffff:0x7f);
|
||||
addr ++) {
|
||||
|
||||
Reference in new issue
Block a user