diff options
-rw-r--r-- | miscutils/i2c_tools.c | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index 52fc5ec6b..fc392d9dc 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c | |||
@@ -454,19 +454,20 @@ static void confirm_action(int bus_addr, int mode, int data_addr, int pec) | |||
454 | 454 | ||
455 | #if ENABLE_I2CGET | 455 | #if ENABLE_I2CGET |
456 | //usage:#define i2cget_trivial_usage | 456 | //usage:#define i2cget_trivial_usage |
457 | //usage: "[-f] [-y] BUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]" | 457 | //usage: "[-fy] BUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]" |
458 | //usage:#define i2cget_full_usage "\n\n" | 458 | //usage:#define i2cget_full_usage "\n\n" |
459 | //usage: "Read from I2C/SMBus chip registers\n" | 459 | //usage: "Read from I2C/SMBus chip registers" |
460 | //usage: "\n I2CBUS i2c bus number" | 460 | //usage: "\n" |
461 | //usage: "\n ADDRESS 0x03 - 0x77" | 461 | //usage: "\n I2CBUS I2C bus number" |
462 | //usage: "\n ADDRESS 0x03-0x77" | ||
462 | //usage: "\nMODE is:" | 463 | //usage: "\nMODE is:" |
463 | //usage: "\n b read byte data (default)" | 464 | //usage: "\n b Read byte data (default)" |
464 | //usage: "\n w read word data" | 465 | //usage: "\n w Read word data" |
465 | //usage: "\n c write byte/read byte" | 466 | //usage: "\n c Write byte/read byte" |
466 | //usage: "\n Append p for SMBus PEC" | 467 | //usage: "\n Append p for SMBus PEC" |
467 | //usage: "\n" | 468 | //usage: "\n" |
468 | //usage: "\n -f force access" | 469 | //usage: "\n -f Force access" |
469 | //usage: "\n -y disable interactive mode" | 470 | //usage: "\n -y Disable interactive mode" |
470 | int i2cget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 471 | int i2cget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
471 | int i2cget_main(int argc UNUSED_PARAM, char **argv) | 472 | int i2cget_main(int argc UNUSED_PARAM, char **argv) |
472 | { | 473 | { |
@@ -536,23 +537,24 @@ int i2cget_main(int argc UNUSED_PARAM, char **argv) | |||
536 | 537 | ||
537 | #if ENABLE_I2CSET | 538 | #if ENABLE_I2CSET |
538 | //usage:#define i2cset_trivial_usage | 539 | //usage:#define i2cset_trivial_usage |
539 | //usage: "[-f] [-y] [-m MASK] BUS CHIP-ADDR DATA-ADDR [VALUE] ... [MODE]" | 540 | //usage: "[-fy] [-m MASK] BUS CHIP-ADDRESS DATA-ADDRESS [VALUE] ... [MODE]" |
540 | //usage:#define i2cset_full_usage "\n\n" | 541 | //usage:#define i2cset_full_usage "\n\n" |
541 | //usage: "Set I2C registers\n" | 542 | //usage: "Set I2C registers" |
542 | //usage: "\n I2CBUS i2c bus number" | 543 | //usage: "\n" |
543 | //usage: "\n ADDRESS 0x03 - 0x77" | 544 | //usage: "\n I2CBUS I2C bus number" |
545 | //usage: "\n ADDRESS 0x03-0x77" | ||
544 | //usage: "\nMODE is:" | 546 | //usage: "\nMODE is:" |
545 | //usage: "\n c byte, no value" | 547 | //usage: "\n c Byte, no value" |
546 | //usage: "\n b byte data (default)" | 548 | //usage: "\n b Byte data (default)" |
547 | //usage: "\n w word data" | 549 | //usage: "\n w Word data" |
548 | //usage: "\n i I2C block data" | 550 | //usage: "\n i I2C block data" |
549 | //usage: "\n s SMBus block data" | 551 | //usage: "\n s SMBus block data" |
550 | //usage: "\n Append p for SMBus PEC" | 552 | //usage: "\n Append p for SMBus PEC" |
551 | //usage: "\n" | 553 | //usage: "\n" |
552 | //usage: "\n -f force access" | 554 | //usage: "\n -f Force access" |
553 | //usage: "\n -y disable interactive mode" | 555 | //usage: "\n -y Disable interactive mode" |
554 | //usage: "\n -r read back and compare the result" | 556 | //usage: "\n -r Read back and compare the result" |
555 | //usage: "\n -m MASK mask specifying which bits to write" | 557 | //usage: "\n -m MASK Mask specifying which bits to write" |
556 | int i2cset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 558 | int i2cset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
557 | int i2cset_main(int argc, char **argv) | 559 | int i2cset_main(int argc, char **argv) |
558 | { | 560 | { |
@@ -895,23 +897,24 @@ static void dump_word_data(int bus_fd, unsigned first, unsigned last) | |||
895 | } | 897 | } |
896 | 898 | ||
897 | //usage:#define i2cdump_trivial_usage | 899 | //usage:#define i2cdump_trivial_usage |
898 | //usage: "[-f] [-r FIRST-LAST] [-y] BUS ADDR [MODE]" | 900 | //usage: "[-fy] [-r FIRST-LAST] BUS ADDR [MODE]" |
899 | //usage:#define i2cdump_full_usage "\n\n" | 901 | //usage:#define i2cdump_full_usage "\n\n" |
900 | //usage: "Examine I2C registers\n" | 902 | //usage: "Examine I2C registers" |
901 | //usage: "\n I2CBUS i2c bus number" | 903 | //usage: "\n" |
902 | //usage: "\n ADDRESS 0x03 - 0x77" | 904 | //usage: "\n I2CBUS I2C bus number" |
905 | //usage: "\n ADDRESS 0x03-0x77" | ||
903 | //usage: "\nMODE is:" | 906 | //usage: "\nMODE is:" |
904 | //usage: "\n b byte (default)" | 907 | //usage: "\n b Byte (default)" |
905 | //usage: "\n w word" | 908 | //usage: "\n w Word" |
906 | //usage: "\n W word on even register addresses" | 909 | //usage: "\n W Word on even register addresses" |
907 | //usage: "\n i I2C block" | 910 | //usage: "\n i I2C block" |
908 | //usage: "\n s SMBus block" | 911 | //usage: "\n s SMBus block" |
909 | //usage: "\n c consecutive byte" | 912 | //usage: "\n c Consecutive byte" |
910 | //usage: "\n Append p for SMBus PEC" | 913 | //usage: "\n Append p for SMBus PEC" |
911 | //usage: "\n" | 914 | //usage: "\n" |
912 | //usage: "\n -f force access" | 915 | //usage: "\n -f Force access" |
913 | //usage: "\n -y disable interactive mode" | 916 | //usage: "\n -y Disable interactive mode" |
914 | //usage: "\n -r limit the number of registers being accessed" | 917 | //usage: "\n -r Limit the number of registers being accessed" |
915 | int i2cdump_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 918 | int i2cdump_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
916 | int i2cdump_main(int argc UNUSED_PARAM, char **argv) | 919 | int i2cdump_main(int argc UNUSED_PARAM, char **argv) |
917 | { | 920 | { |
@@ -1208,8 +1211,8 @@ static void will_skip(const char *cmd) | |||
1208 | //usage:#define i2cdetect_full_usage "\n\n" | 1211 | //usage:#define i2cdetect_full_usage "\n\n" |
1209 | //usage: "Detect I2C chips" | 1212 | //usage: "Detect I2C chips" |
1210 | //usage: "\n" | 1213 | //usage: "\n" |
1211 | //usage: "\n -l Print list of installed buses" | 1214 | //usage: "\n -l List installed buses" |
1212 | //usage: "\n -F BUS# Print list of functionalities on this bus" | 1215 | //usage: "\n -F BUS# List functionalities on this bus" |
1213 | //usage: "\n -y Disable interactive mode" | 1216 | //usage: "\n -y Disable interactive mode" |
1214 | //usage: "\n -a Force scanning of non-regular addresses" | 1217 | //usage: "\n -a Force scanning of non-regular addresses" |
1215 | //usage: "\n -q Use smbus quick write commands for probing (default)" | 1218 | //usage: "\n -q Use smbus quick write commands for probing (default)" |