summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-06-18 14:20:54 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-06-18 14:20:54 +0000
commitfa9c80db42a4afac715fc6fc2f1bba04ad59de35 (patch)
tree06d48168a5553718343021afa0f7a4908ff1d0d8
parent6a83117174227ba3699b567f1789e2fbfff54d31 (diff)
downloadFreeBSD-src-fa9c80db42a4afac715fc6fc2f1bba04ad59de35.zip
FreeBSD-src-fa9c80db42a4afac715fc6fc2f1bba04ad59de35.tar.gz
Revert changes accidentally committed as part of r209298.
-rw-r--r--sys/dev/iicbus/iiconf.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c
index e59dc35..1610b35 100644
--- a/sys/dev/iicbus/iiconf.c
+++ b/sys/dev/iicbus/iiconf.c
@@ -363,7 +363,7 @@ iicbus_transfer(device_t bus, struct iic_msg *msgs, uint32_t nmsgs)
int
iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
{
- int i, error, lenread, lenwrote, nkid, rpstart, addr;
+ int i, error, lenread, lenwrote, nkid;
device_t *children, bus;
if ((error = device_get_children(dev, &children, &nkid)) != 0)
@@ -373,38 +373,14 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
return (EIO);
}
bus = children[0];
- rpstart = 0;
free(children, M_TEMP);
for (i = 0, error = 0; i < nmsgs && error == 0; i++) {
- addr = msgs[i].slave;
if (msgs[i].flags & IIC_M_RD)
- addr |= LSB;
+ error = iicbus_block_read(bus, msgs[i].slave,
+ msgs[i].buf, msgs[i].len, &lenread);
else
- addr &= ~LSB;
-
- if (!(msgs[i].flags & IIC_M_NOSTART)) {
- if (rpstart)
- error = iicbus_repeated_start(bus, addr, 0);
- else
- error = iicbus_start(bus, addr, 0);
- }
-
- if (error)
- break;
-
- if (msgs[i].flags & IIC_M_RD)
- error = iicbus_read(bus, msgs[i].buf, msgs[i].len,
- &lenread, IIC_LAST_READ, 0);
- else
- error = iicbus_write(bus, msgs[i].buf, msgs[i].len,
- &lenwrote, 0);
-
- if (!(msgs[i].flags & IIC_M_NOSTOP)) {
- rpstart = 0;
- iicbus_stop(bus);
- } else {
- rpstart = 1; /* Next message gets repeated start */
- }
+ error = iicbus_block_write(bus, msgs[i].slave,
+ msgs[i].buf, msgs[i].len, &lenwrote);
}
return (error);
}
OpenPOWER on IntegriCloud