freebsd-nq/sys/dev/iicbus
Ian Lepore 34199ee049 Add support for tracking nested calls to iicbus_request/release_bus().
Usually it is sufficient to use iicbus_transfer_excl(), or one of the
higher-level convenience functions that use it, to reserve the bus for the
duration of each register access.  Occasionally it is important that a
series of accesses or read-modify-write operations must be done without any
other intervening access to the device, to prevent corrupting state.

Without support for nested request/release, slave device drivers would have
to stop using high-level convenience functions and resort to working with
arrays of iic_msg structs just for a few operations (often involving
one-time device setup or infrequent configuration changes).

The changes here appear large from a glance at the diff, but in fact they're
nearly trivial, and the large diff is because of changes in indentation and
the re-wrapping of comments caused by that.  One notable change is that
iicbus_release_bus() now ignores the IICBUS_CALLBACK(IIC_RELEASE_BUS) return
value.  The old error handling left the bus in a kind of limbo state where
it was still owned at the iicbus layer, but drivers rarely check the return
of the release call, and it's unclear what they would do to recover from an
error return anyway.  No existing low-level drivers return any kind of error
from IIC_RELEASE_BUS except one EINVAL for "you don't own the bus", to which
the right response is probably to carry on with the process of releasing the
reference to the bus anyway.
2017-07-26 21:06:26 +00:00
..
twsi Always ignore the START and STOP bits whenever the control register is 2017-06-20 18:38:51 +00:00
ad7417.c
ad7418.c Fix drivers that assume ticks starts at zero. These drivers all have logic 2017-07-06 17:03:22 +00:00
adm1030.c
adt746x.c
ds133x.c
ds1307.c
ds1307reg.h
ds1374.c
ds1631.c
ds1672.c
ds1775.c
ds3231.c
ds3231reg.h
icee.c
if_ic.c
iic_recover_bus.c Add iic_recover_bus(), a helper function that can be used by any i2c driver 2017-06-29 01:50:58 +00:00
iic_recover_bus.h Add iic_recover_bus(), a helper function that can be used by any i2c driver 2017-06-29 01:50:58 +00:00
iic.c
iic.h
iicbb_if.m
iicbb.c
iicbus_if.m
iicbus.c
iicbus.h Add support for tracking nested calls to iicbus_request/release_bus(). 2017-07-26 21:06:26 +00:00
iicoc.c
iicoc.h
iiconf.c Add support for tracking nested calls to iicbus_request/release_bus(). 2017-07-26 21:06:26 +00:00
iiconf.h Add a pair of convenience routines for doing simple "register" read/writes 2017-07-26 20:40:24 +00:00
iicsmb.c
lm75.c
max6690.c
ofw_iicbus.c
pcf8563.c
pcf8563reg.h
s35390a.c
sy8106a.c