freebsd-dev/sys/dev/iicbus
Ian Lepore c56cf3d276 Ensure a measurement is complete before reading the result in ads111x.
Also, disable the comparator by default; it's not used for anything.

The previous logic would start a measurement, and then pause_sbt() for the
averaging time currently configured in the chip.  After waiting that long,
the code would blindly read the measurement register and return its value.
The problem is that the chip's idea of averaging time is based on its
internal free-running 1MHz oscillator, which may be running at a wildly
different rate than the kernel clock.  If the chip's internal timer was
running slower than the kernel clock, we'd end up grabbing a stale result
from an old measurement.

The driver now still uses pause_sbt() to yield the cpu while waiting for
the measurement to complete, but after sleeping it checks the chip's status
register to ensure the measurement engine is idle.  If it's not, the driver
uses a retry loop to wait a bit (5% of the original wait time) then check
again for completion.
2019-09-05 19:07:48 +00:00
..
twsi twsi: Fix build when DEBUG is used on 32bits arch. 2019-08-15 18:59:52 +00:00
ad7417.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
ad7418.c Remove some unused header files from the ad7418 driver. 2019-06-23 17:20:39 +00:00
adm1030.c
ads111x.c Ensure a measurement is complete before reading the result in ads111x. 2019-09-05 19:07:48 +00:00
adt746x.c Clean up OF_getprop_alloc API 2018-04-08 22:59:34 +00:00
ds13rtc.c Add pnpinfo to all i2c drivers that have FDT compat data. 2019-05-23 18:24:27 +00:00
ds1307.c Add pnpinfo to all i2c drivers that have FDT compat data. 2019-05-23 18:24:27 +00:00
ds1307reg.h DS1307: Add the mcp7941x enable bit 2017-11-08 01:28:20 +00:00
ds1631.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
ds1672.c Build the ds1672 driver as a module. Add a detach() to unregister the rtc. 2018-03-06 02:30:34 +00:00
ds1775.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
ds3231.c Switch to the new bcd_clocktime conversion routines, and add calls to the 2018-03-05 00:15:56 +00:00
ds3231reg.h
icee.c Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other 2019-05-23 16:03:30 +00:00
if_ic.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iic_recover_bus.c
iic_recover_bus.h
iic.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iic.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iicbb_if.m
iicbb.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iicbus_if.m Add a default implementation that returns ENODEV for start, repeat_start, 2017-09-11 23:47:49 +00:00
iicbus.c revert r273728 and parts of r306589, iicbus no-stop by default feature 2019-05-29 09:08:20 +00:00
iicbus.h Restore the ability for i2c slave devices to do IO from their probe method. 2019-07-08 20:26:56 +00:00
iicoc.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iicoc.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iiconf.c Restore the ability for i2c slave devices to do IO from their probe method. 2019-07-08 20:26:56 +00:00
iiconf.h Fix a bug introduced with recursive bus ownership support in r321584. 2018-01-23 23:30:19 +00:00
iicsmb.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
isl12xx.c Add pnpinfo to all i2c drivers that have FDT compat data. 2019-05-23 18:24:27 +00:00
lm75.c
max6690.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
nxprtc.c Add support for setting the aging/frequency-offset register via sysctl. 2019-07-21 17:14:39 +00:00
ofw_iicbus.c Allow i2c hardware drivers to declare their own relationships to ofw_iicbus 2018-02-18 19:33:28 +00:00
rtc8583.c Add pnpinfo to all i2c drivers that have FDT compat data. 2019-05-23 18:24:27 +00:00
s35390a.c Switch to the new bcd_clocktime conversion routines, and add calls to the 2018-03-05 00:43:53 +00:00
sy8106a.c Add pnpinfo to all i2c drivers that have FDT compat data. 2019-05-23 18:24:27 +00:00
syr827.c Add pnpinfo to all i2c drivers that have FDT compat data. 2019-05-23 18:24:27 +00:00