Changeset 690
- Timestamp:
- 01/09/00 23:45:57 (13 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/dump/i2cdump.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/dump/i2cdump.c
r501 r690 28 28 void help(void) 29 29 { 30 FILE *fptr; 31 char s[100]; 32 30 33 fprintf(stderr,"Syntax: i2cdump I2CBUS ADDRESS MODE\n"); 31 34 fprintf(stderr," MODE may be 'b' or 'w'\n"); 35 fprintf(stderr," I2CBUS is an integer\n"); 36 if((fptr = fopen("/proc/bus/i2c", "r"))) { 37 fprintf(stderr," Installed I2C busses:\n"); 38 while(fgets(s, 100, fptr)) 39 fprintf(stderr, " %s", s); 40 fclose(fptr); 41 } 32 42 } 33 43 … … 92 102 } 93 103 94 if (ioctl(file,I2C_SLAVE,address) < 0) { 104 /* use FORCE so that we can look at registers even when 105 a driver is also running */ 106 if (ioctl(file,I2C_SLAVE_FORCE,address) < 0) { 95 107 fprintf(stderr,"Error: Could not set address to %d: %s\n",address, 96 108 strerror(errno));
