svn commit: r350031 - stable/11/sys/dev/iicbus
Andriy Gapon
avg at FreeBSD.org
Tue Jul 16 15:02:30 UTC 2019
Author: avg
Date: Tue Jul 16 15:02:28 2019
New Revision: 350031
URL: https://svnweb.freebsd.org/changeset/base/350031
Log:
MFC r348355: revert r273728 and parts of r306589, iicbus no-stop by default feature
After r349227 the only consumer of that broken code is gone from this
branch.
Modified:
stable/11/sys/dev/iicbus/iicbus.c
stable/11/sys/dev/iicbus/iicbus.h
stable/11/sys/dev/iicbus/iiconf.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/iicbus/iicbus.c
==============================================================================
--- stable/11/sys/dev/iicbus/iicbus.c Tue Jul 16 14:59:39 2019 (r350030)
+++ stable/11/sys/dev/iicbus/iicbus.c Tue Jul 16 15:02:28 2019 (r350031)
@@ -192,9 +192,6 @@ iicbus_read_ivar(device_t bus, device_t child, int whi
case IICBUS_IVAR_ADDR:
*result = devi->addr;
break;
- case IICBUS_IVAR_NOSTOP:
- *result = devi->nostop;
- break;
}
return (0);
}
@@ -211,9 +208,6 @@ iicbus_write_ivar(device_t bus, device_t child, int wh
if (devi->addr != 0)
return (EINVAL);
devi->addr = value;
- case IICBUS_IVAR_NOSTOP:
- devi->nostop = value;
- break;
}
return (0);
}
Modified: stable/11/sys/dev/iicbus/iicbus.h
==============================================================================
--- stable/11/sys/dev/iicbus/iicbus.h Tue Jul 16 14:59:39 2019 (r350030)
+++ stable/11/sys/dev/iicbus/iicbus.h Tue Jul 16 15:02:28 2019 (r350031)
@@ -52,19 +52,16 @@ struct iicbus_ivar
{
uint32_t addr;
struct resource_list rl;
- bool nostop;
};
enum {
- IICBUS_IVAR_ADDR, /* Address or base address */
- IICBUS_IVAR_NOSTOP, /* nostop defaults */
+ IICBUS_IVAR_ADDR /* Address or base address */
};
#define IICBUS_ACCESSOR(A, B, T) \
__BUS_ACCESSOR(iicbus, A, IICBUS, B, T)
IICBUS_ACCESSOR(addr, ADDR, uint32_t)
-IICBUS_ACCESSOR(nostop, NOSTOP, bool)
#define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock)
#define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock)
Modified: stable/11/sys/dev/iicbus/iiconf.c
==============================================================================
--- stable/11/sys/dev/iicbus/iiconf.c Tue Jul 16 14:59:39 2019 (r350030)
+++ stable/11/sys/dev/iicbus/iiconf.c Tue Jul 16 15:02:28 2019 (r350031)
@@ -418,7 +418,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs
{
int i, error, lenread, lenwrote, nkid, rpstart, addr;
device_t *children, bus;
- bool nostop, started;
+ bool started;
if ((error = device_get_children(dev, &children, &nkid)) != 0)
return (IIC_ERESOURCE);
@@ -429,7 +429,6 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs
bus = children[0];
rpstart = 0;
free(children, M_TEMP);
- nostop = iicbus_get_nostop(dev);
started = false;
for (i = 0, error = 0; i < nmsgs && error == 0; i++) {
addr = msgs[i].slave;
@@ -457,12 +456,11 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs
if (error != 0)
break;
- if ((msgs[i].flags & IIC_M_NOSTOP) != 0 ||
- (nostop && i + 1 < nmsgs)) {
- rpstart = 1; /* Next message gets repeated start */
- } else {
+ if (!(msgs[i].flags & IIC_M_NOSTOP)) {
rpstart = 0;
iicbus_stop(bus);
+ } else {
+ rpstart = 1; /* Next message gets repeated start */
}
}
if (error != 0 && started)
More information about the svn-src-all
mailing list