libqos: move common i2c code to libqos
The functions to read/write 8-bit or 16-bit registers are the same
in tmp105 and pca9552 tests, and in fact they are a special case of
"read block"/"write block" functionality; read block in turn is used
in ds1338-test.
Move everything inside libqos-test, removing the duplication. Account
for the small differences by adding to tmp105-test.c the "read register
after writing" behavior that is specific to it.
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- tests/ds1338-test.c 1 addition, 7 deletionstests/ds1338-test.c
- tests/libqos/i2c.c 47 additions, 0 deletionstests/libqos/i2c.c
- tests/libqos/i2c.h 11 additions, 0 deletionstests/libqos/i2c.h
- tests/pca9552-test.c 8 additions, 29 deletionstests/pca9552-test.c
- tests/tmp105-test.c 21 additions, 59 deletionstests/tmp105-test.c
Please register or sign in to comment