|
@@ -10,30 +10,13 @@
|
|
#include "qemu/osdep.h"
|
|
#include "qemu/osdep.h"
|
|
#include "hw/i2c/i2c.h"
|
|
#include "hw/i2c/i2c.h"
|
|
|
|
|
|
-typedef struct I2CNode I2CNode;
|
|
|
|
-
|
|
|
|
-struct I2CNode {
|
|
|
|
- I2CSlave *elt;
|
|
|
|
- QLIST_ENTRY(I2CNode) next;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
#define I2C_BROADCAST 0x00
|
|
#define I2C_BROADCAST 0x00
|
|
|
|
|
|
-struct I2CBus {
|
|
|
|
- BusState qbus;
|
|
|
|
- QLIST_HEAD(, I2CNode) current_devs;
|
|
|
|
- uint8_t saved_address;
|
|
|
|
- bool broadcast;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
static Property i2c_props[] = {
|
|
static Property i2c_props[] = {
|
|
DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0),
|
|
DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0),
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
};
|
|
};
|
|
|
|
|
|
-#define TYPE_I2C_BUS "i2c-bus"
|
|
|
|
-#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS)
|
|
|
|
-
|
|
|
|
static const TypeInfo i2c_bus_info = {
|
|
static const TypeInfo i2c_bus_info = {
|
|
.name = TYPE_I2C_BUS,
|
|
.name = TYPE_I2C_BUS,
|
|
.parent = TYPE_BUS,
|
|
.parent = TYPE_BUS,
|