Skip to content
Commit 066ed427 authored by Thomas VanSelus's avatar Thomas VanSelus Committed by Greg Kroah-Hartman
Browse files

misc: ds1682: Ignore update-in-progress ETC reads



The Elapsed Time Counter (ETC) registers are not buffered for reading.
If a 250ms tick occurs while data is being read out, the result can be
a combination of old and new values. This can occur at the byte level
(giving a time in the future) or the individual bit level (giving a
time in the past). We catch both these cases by reading until we get
two equal or consecutive values. After five unsuccessful attempts we
give up.

Signed-off-by: default avatarThomas VanSelus <tvanselus@xes-inc.com>
Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2fa065fd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment