Changeset 5200
- Timestamp:
- 04/24/08 14:08:02 (5 years ago)
- Location:
- i2c-tools/trunk/tools
- Files:
-
- 6 modified
-
i2cbusses.c (modified) (2 diffs)
-
i2cbusses.h (modified) (1 diff)
-
i2cdetect.c (modified) (2 diffs)
-
i2cdump.c (modified) (1 diff)
-
i2cget.c (modified) (1 diff)
-
i2cset.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/tools/i2cbusses.c
r5196 r5200 296 296 297 297 /* 298 this just prints out the installed i2c busses in a consistent format, whether 299 on a 2.4 kernel using /proc or a 2.6 kernel using /sys. 300 If procfmt == 1, print out exactly /proc/bus/i2c format on stdout. 301 This allows this to be used in a program to emulate /proc/bus/i2c on a 302 sysfs system. 303 */ 304 void print_i2c_busses(int procfmt) 298 * Print the installed i2c busses. The format is those of Linux 2.4's 299 * /proc/bus/i2c for historical compatibility reasons. 300 */ 301 void print_i2c_busses(void) 305 302 { 306 303 struct i2c_adap *adapters; … … 314 311 315 312 for (count = 0; adapters[count].name; count++) { 316 if (count == 0 && !procfmt) 317 fprintf(stderr," Installed I2C busses:\n"); 318 if (procfmt) 319 /* match 2.4 /proc/bus/i2c format as closely as possible */ 320 printf("i2c-%d\t%-10s\t%-32s\t%s\n", 321 adapters[count].nr, 322 adapters[count].funcs, 323 adapters[count].name, 324 adapters[count].algo); 325 else 326 fprintf(stderr, " i2c-%d\t%-10s\t%s\n", 327 adapters[count].nr, 328 adapters[count].funcs, 329 adapters[count].name); 330 } 331 332 if(count == 0 && !procfmt) 333 fprintf(stderr,"Error: No I2C busses found!\n" 334 "Be sure you have done 'modprobe i2c-dev'\n" 335 "and also modprobed your i2c bus drivers\n"); 313 printf("i2c-%d\t%-10s\t%-32s\t%s\n", 314 adapters[count].nr, adapters[count].funcs, 315 adapters[count].name, adapters[count].algo); 316 } 336 317 337 318 free_adapters(adapters); -
i2c-tools/trunk/tools/i2cbusses.h
r5193 r5200 23 23 #define _I2CBUSSES_H 24 24 25 void print_i2c_busses( int procfmt);25 void print_i2c_busses(void); 26 26 27 27 int lookup_i2c_bus(const char *i2cbus_arg); -
i2c-tools/trunk/tools/i2cdetect.c
r5199 r5200 50 50 " If provided, FIRST and LAST limit the probing range.\n" 51 51 " With -l, lists installed busses only\n"); 52 print_i2c_busses(0);53 52 } 54 53 … … 227 226 228 227 if (list) { 229 print_i2c_busses( 1);228 print_i2c_busses(); 230 229 exit(0); 231 230 } -
i2c-tools/trunk/tools/i2cdump.c
r5199 r5200 49 49 "bank 0, reg 0x4e)\n" 50 50 " BANK is the command for smbusblock accesses (default 0)\n"); 51 print_i2c_busses(0);52 51 } 53 52 -
i2c-tools/trunk/tools/i2cget.c
r5199 r5200 48 48 " Append 'p' to MODE for PEC checking\n" 49 49 " I2CBUS is an integer\n"); 50 print_i2c_busses(0);51 50 exit(1); 52 51 } -
i2c-tools/trunk/tools/i2cset.c
r5199 r5200 41 41 " Append 'p' to MODE for PEC checking\n" 42 42 " I2CBUS is an integer\n"); 43 print_i2c_busses(0);44 43 exit(1); 45 44 }
