Changeset 5393

Show
Ignore:
Timestamp:
11/20/08 20:41:19 (4 years ago)
Author:
khali
Message:

Make reading back the written value optional.

Location:
i2c-tools/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/CHANGES

    r5390 r5393  
    2424          Better error message on missing adapter functionality 
    2525          Set the data value mask with -m 
     26          Make reading back the written value optional 
    2627  i2c-stub-from-dump: Add support for partial dumps 
    2728                      Report if only garbage is found in dump file 
  • i2c-tools/trunk/tools/i2cset.8

    r5392 r5393  
    88.RB [ -y ] 
    99.RB [ "-m mask" ] 
     10.RB [ -r ] 
    1011.I i2cbus 
    1112.I chip-address 
     
    4748mode are symmetrical for the device you are accessing. This may or may not 
    4849be the case, as neither I2C nor SMBus guarantees this. 
     50.TP 
     51.B -r 
     52Read back the value right after writing it, and compare the result with the 
     53value written. This used to be the default behavior. The same limitations 
     54apply as those of option \fB-m\fR. 
    4955.PP 
    5056There are three required options to i2cset. \fIi2cbus\fR indicates the number 
  • i2c-tools/trunk/tools/i2cset.c

    r5391 r5393  
    135135        int pec = 0; 
    136136        int flags = 0; 
    137         int force = 0, yes = 0, version = 0; 
     137        int force = 0, yes = 0, version = 0, readback = 0; 
    138138 
    139139        /* handle (optional) flags first */ 
     
    148148                        flags++; 
    149149                        break; 
     150                case 'r': readback = 1; break; 
    150151                default: 
    151152                        fprintf(stderr, "Error: Unsupported option " 
     
    307308                        exit(1); 
    308309                } 
     310        } 
     311 
     312        if (!readback) { /* We're done */ 
     313                close(file); 
     314                exit(0); 
    309315        } 
    310316