summaryrefslogtreecommitdiff
path: root/tests/libqos/i2c.h
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-09-11 12:19:59 -0500
committerThomas Huth <thuth@redhat.com>2018-02-14 11:43:41 +0100
commitf1dfd507325f25a73d777db5f5d9b3fcac89287b (patch)
tree2488bf7c46c78f5e557bad3df6683333f96880c3 /tests/libqos/i2c.h
parent9b67af76dbe62960794055a732f1e47680621192 (diff)
downloadqemu-f1dfd507325f25a73d777db5f5d9b3fcac89287b.tar.gz
libqos: Use explicit QTestState for i2c operations
Drop one more client of global_qtest by teaching all i2c test functionality to pass in an explicit QTestState, adjusting all callers. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/libqos/i2c.h')
-rw-r--r--tests/libqos/i2c.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/libqos/i2c.h b/tests/libqos/i2c.h
index 6e648f922a..eb40b808bd 100644
--- a/tests/libqos/i2c.h
+++ b/tests/libqos/i2c.h
@@ -9,6 +9,7 @@
#ifndef LIBQOS_I2C_H
#define LIBQOS_I2C_H
+#include "libqtest.h"
typedef struct I2CAdapter I2CAdapter;
struct I2CAdapter {
@@ -16,6 +17,8 @@ struct I2CAdapter {
const uint8_t *buf, uint16_t len);
void (*recv)(I2CAdapter *adapter, uint8_t addr,
uint8_t *buf, uint16_t len);
+
+ QTestState *qts;
};
void i2c_send(I2CAdapter *i2c, uint8_t addr,
@@ -24,9 +27,9 @@ void i2c_recv(I2CAdapter *i2c, uint8_t addr,
uint8_t *buf, uint16_t len);
/* libi2c-omap.c */
-I2CAdapter *omap_i2c_create(uint64_t addr);
+I2CAdapter *omap_i2c_create(QTestState *qts, uint64_t addr);
/* libi2c-imx.c */
-I2CAdapter *imx_i2c_create(uint64_t addr);
+I2CAdapter *imx_i2c_create(QTestState *qts, uint64_t addr);
#endif