mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
libqos: convert I2C to qgraph
Create an i2c-bus interface, corresponding to the I2CAdapter struct. Wrap IMXI2C and OMAPI2C with a QOSGraphObject, and add the get_driver function to retrieve the I2CAdapter. The conversion is still not complete; for simplicity, i2c_recv and i2c_send (along with their wrappers) still take an adapter/address pair. Fixing that would be complicated until the tests are converted to qgraph, so it is left for after the conversion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
732c919cf0
commit
c0825c63cf
5 changed files with 83 additions and 8 deletions
|
@ -68,3 +68,11 @@ void i2c_set16(I2CAdapter *i2c, uint8_t addr, uint8_t reg,
|
|||
data[1] = value & 255;
|
||||
i2c_write_block(i2c, addr, reg, data, sizeof(data));
|
||||
}
|
||||
|
||||
void *i2c_device_create(void *i2c_bus, QGuestAllocator *alloc, void *addr)
|
||||
{
|
||||
QI2CDevice *i2cdev = g_new0(QI2CDevice, 1);
|
||||
|
||||
i2cdev->bus = i2c_bus;
|
||||
return &i2cdev->obj;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue