mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-13 17:00:15 +00:00
i2c-detect now checks whether SMBus quick write is in the
functionality matrix. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@648 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
77051058bb
commit
389f9b89f3
1 file changed
+14
@@ -36,6 +36,7 @@ int main(int argc, char *argv[])
|
||||
char *end;
|
||||
int i,j,res,i2cbus,file;
|
||||
char filename[20];
|
||||
long funcs;
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
@@ -61,6 +62,19 @@ int main(int argc, char *argv[])
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ioctl(file,I2C_FUNCS,&funcs) < 0) {
|
||||
fprintf(stderr,
|
||||
"Error: Could not get the adapter functionality maxtrix: %s\n",
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
if (! (funcs & I2C_FUNC_SMBUS_QUICK)) {
|
||||
fprintf(stderr,
|
||||
"Error: Can't use SMBus Quick Write command "
|
||||
"on this bus (ISA bus?)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fprintf(stderr," WARNING! This program can confuse your I2C bus, "
|
||||
"cause data loss and worse!\n");
|
||||
|
||||
Reference in new issue
Block a user