[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/2] omap_i2c: Clear SBD bit in STAT register on DAT
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 1/2] omap_i2c: Clear SBD bit in STAT register on DATA read |
Date: |
Wed, 12 Dec 2012 07:29:32 +0100 |
After reading a single-byte I2C response such as the tmp105's response
to 0x01 0x00, the SBD status bit would not get reset on next read, still
indicating validity of only a single byte. Clear it on next word read.
Signed-off-by: Andreas Färber <address@hidden>
---
hw/omap_i2c.c | 1 +
1 Datei geändert, 1 Zeile hinzugefügt(+)
diff --git a/hw/omap_i2c.c b/hw/omap_i2c.c
index ba08e64..308c088 100644
--- a/hw/omap_i2c.c
+++ b/hw/omap_i2c.c
@@ -196,6 +196,7 @@ static uint32_t omap_i2c_read(void *opaque, hwaddr addr)
s->stat |= 1 << 15; /* SBD
*/
s->rxlen = 0;
} else if (s->rxlen > 1) {
+ s->stat &= ~(1 << 15); /* SBD */
if (s->rxlen > 2)
s->fifo >>= 16;
s->rxlen -= 2;
--
1.7.10.4