Lines 751-756
main(int argc, char** argv)
Link Here
|
751 |
|
751 |
|
752 |
/* Default values */ |
752 |
/* Default values */ |
753 |
i2c_opt.off = 0; |
753 |
i2c_opt.off = 0; |
|
|
754 |
i2c_opt.addr = 0; |
754 |
i2c_opt.verbose = 0; |
755 |
i2c_opt.verbose = 0; |
755 |
i2c_opt.dir = 'r'; /* direction = read */ |
756 |
i2c_opt.dir = 'r'; /* direction = read */ |
756 |
i2c_opt.width = "8"; |
757 |
i2c_opt.width = "8"; |
Lines 875-886
main(int argc, char** argv)
Link Here
|
875 |
return(EX_USAGE); |
876 |
return(EX_USAGE); |
876 |
} |
877 |
} |
877 |
|
878 |
|
878 |
if (i2c_opt.verbose) |
|
|
879 |
fprintf(stderr, "dev: %s, addr: 0x%x, r/w: %c, " |
880 |
"offset: 0x%02x, width: %s, count: %u\n", dev, |
881 |
i2c_opt.addr >> 1, i2c_opt.dir, i2c_opt.off, |
882 |
i2c_opt.width, i2c_opt.count); |
883 |
|
884 |
fd = open(dev, O_RDWR); |
879 |
fd = open(dev, O_RDWR); |
885 |
if (fd == -1) { |
880 |
if (fd == -1) { |
886 |
fprintf(stderr, "Error opening I2C controller (%s): %s\n", |
881 |
fprintf(stderr, "Error opening I2C controller (%s): %s\n", |
Lines 890-895
main(int argc, char** argv)
Link Here
|
890 |
|
885 |
|
891 |
switch (do_what) { |
886 |
switch (do_what) { |
892 |
case 'a': |
887 |
case 'a': |
|
|
888 |
if (i2c_opt.verbose) |
889 |
fprintf(stderr, "dev: %s, addr: 0x%x, r/w: %c, " |
890 |
"offset: 0x%02x, width: %s, count: %u\n", dev, |
891 |
i2c_opt.addr >> 1, i2c_opt.dir, i2c_opt.off, |
892 |
i2c_opt.width, i2c_opt.count); |
893 |
error = access_bus(fd, i2c_opt); |
893 |
error = access_bus(fd, i2c_opt); |
894 |
break; |
894 |
break; |
895 |
case 's': |
895 |
case 's': |