freebsd-dev/sys/dev/iicbus
Ian Lepore 2444018f7d Rewrite the nxprtc chip init to extend battery life by using power-saving
features offered by the chips.

For 2127 and 2129 chips, fix the detection of when chip-init is needed.  The
chip config needs to be reset whenever power was lost, but the logic was
wrong for 212x chips (it only worked for 8523).  Now the "oscillator
stopped" bit rather than the power manager mode is used to detect startup
after powerfail.

For all chips, disable the clock output pin.

For chips that have a timestamp/tamper-monitor feature, turn off monitoring
of the timestamp trigger pin.

The 8523, 2127, and 2129 chips have a "power manager" feature that offers
several options.  We've been using the default mode which enables
everything.  Now the code sets the power manager options to

 - direct-switch (when Vdd < Vbat, without extra threshold check)
 - no battery monitor
 - no external powerfail monitor

This reduces the current draw while running on battery from 1930nA to 880nA,
which should roughly double the lifespan of the battery under load.

Because battery checking is a nice thing to have, the code now does a check
at startup, and then once a day after that, instead of checking continuously
(but only actually reporting at startup).  The battery check is now done by
setting the power manager back to default mode, sleeping briefly while it
makes a voltage measurement, then switching back to power-saving mode.
2019-07-20 21:10:27 +00:00
..
twsi Add pnpinfo. 2019-05-23 18:19:56 +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
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 Rewrite the nxprtc chip init to extend battery life by using power-saving 2019-07-20 21:10:27 +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