summaryrefslogtreecommitdiffstats
path: root/include/hw/i2c
diff options
context:
space:
mode:
authorCorey Minyard2018-11-30 20:20:12 +0100
committerCorey Minyard2019-02-28 04:06:08 +0100
commit905cec6d11088e585fcedb3fd606510959ee50ff (patch)
tree72a23061b2a05e7fa89068afe89847c202ca6244 /include/hw/i2c
parenti2c: Don't check return value from i2c_recv() (diff)
downloadqemu-905cec6d11088e585fcedb3fd606510959ee50ff.tar.gz
qemu-905cec6d11088e585fcedb3fd606510959ee50ff.tar.xz
qemu-905cec6d11088e585fcedb3fd606510959ee50ff.zip
i2c:smbus: Correct the working of quick commands
The logic of handling quick SMBus commands was wrong. If you get a finish event with no data, that's a quick command. Document the quick command while we are at it. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'include/hw/i2c')
-rw-r--r--include/hw/i2c/smbus_slave.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/i2c/smbus_slave.h b/include/hw/i2c/smbus_slave.h
index 46b8948f0f..5ef1c72ad0 100644
--- a/include/hw/i2c/smbus_slave.h
+++ b/include/hw/i2c/smbus_slave.h
@@ -40,6 +40,11 @@ typedef struct SMBusDevice SMBusDevice;
typedef struct SMBusDeviceClass
{
I2CSlaveClass parent_class;
+
+ /*
+ * An operation with no data, special in SMBus.
+ * This may be NULL, quick commands are ignore in that case.
+ */
void (*quick_cmd)(SMBusDevice *dev, uint8_t read);
void (*send_byte)(SMBusDevice *dev, uint8_t val);
uint8_t (*receive_byte)(SMBusDevice *dev);