diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2023-06-15 13:58:24 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-08-16 02:27:01 +0300 |
commit | a11b6c460620f7fb5fae4c3aee5a5ba2e1e1129b (patch) | |
tree | 72f11f7cd2e01bd630103dfee164a4294990b310 /Documentation/devicetree/bindings/rtc | |
parent | eccebd813874b748ac4e79a9fe4c7290117ad3be (diff) | |
download | linux-a11b6c460620f7fb5fae4c3aee5a5ba2e1e1129b.tar.xz |
rtc: isl12022: trigger battery level detection during probe
Since the meaning of the SR_LBAT85 and SR_LBAT75 bits are different in
battery backup mode, they may very well be set after power on, and
stay set for up to a minute (i.e. until the battery detection in VDD
mode happens when the seconds counter hits 59). This would mean that
userspace doing a ioctl(RTC_VL_READ) early on could get a false
positive.
The battery level detection can also be triggered by explicitly
writing a 1 to the TSE bit in the BETA register. Do that once during
boot. Empirically, this does not immediately update the bits in
the status register (i.e., an immediate read of SR after this write
can still show stale values), but the update is done after a few
milliseconds, so certainly before the RTC device gets registered and
userspace has a chance of doing the ioctl() on this device.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20230615105826.411953-7-linux@rasmusvillemoes.dk
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'Documentation/devicetree/bindings/rtc')
0 files changed, 0 insertions, 0 deletions