From: "Dag-Erling Smørgrav" <des@linpro.no>
To: Clemens Koller <clemens.koller@anagramm.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC+PATCH] RTC calibration
Date: Tue, 11 Sep 2007 17:02:10 +0200 [thread overview]
Message-ID: <ujrabrt2qkt.fsf@false.linpro.no> (raw)
In-Reply-To: <46E6A737.6080805@anagramm.de> (Clemens Koller's message of "Tue, 11 Sep 2007 16:33:27 +0200")
Clemens Koller <clemens.koller@anagramm.de> writes:
> It looks odd to me to do only differential up and down adjustments.
> I would prefer read_calibration_register and write_calibration_register
> access and let the userspace decide how much it wants to
> increment/decrement the register.
Without knowing exacly which chip is present, there is no way for the
userland calibration tool to know how big a difference a calibration
step makes. I don't see the value in telling the caller that the
current calibration value is N when it actually has no idea what N
means, what the allowable range is, if the scale is linear,
logarithmic, exponential, discontinuous...
The M41T11, for instance, has a calibration register that runs from
-31 to +31, with negative values are multiples of ~2.034 ppm while
positive values are multiples of ~4.068 ppm.
Therefore, I prefer to leave it to the driver author to decide what a
reasonable step in either direction is. The only consequence for the
userland calibration tool is that the RTC may take longer to converge
on hardware that has smaller calibration steps.
> Or - do you adjust your date also after you changed your battery
> with +1567days,7h,34m,12sec instead of telling it's 11th Sept. 2007, 4:33pm ?
No, the calibration process should start by setting the RTC to the
same time as the reference clock once it becomes available, then
waiting for a sufficient amount of time (at least three or four hours
to begin with, then progressively longer as the divergence decreases)
before measuring and adjusting.
Alternatively, if you don't want to set the RTC, you measure the
delta, wait sufficiently long, measure the delta again, and compare
the two deltas (this method is actually exactly the same as the one
outlined above, except that above the initial delta is 0)
DES
--
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
next prev parent reply other threads:[~2007-09-11 15:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-11 13:48 [RFC+PATCH] RTC calibration Dag-Erling Smørgrav
2007-09-11 14:33 ` Clemens Koller
2007-09-11 15:02 ` Dag-Erling Smørgrav [this message]
2007-09-11 15:36 ` Clemens Koller
2007-09-11 16:04 ` Dag-Erling Smørgrav
2007-09-11 19:02 ` Clemens Koller
2007-10-31 11:03 ` Pavel Machek
2007-09-11 15:23 ` Mark Gross
2007-09-11 15:51 ` Dag-Erling Smørgrav
2007-09-11 16:28 ` Dag-Erling Smørgrav
2007-09-12 10:49 ` Arne Georg Gleditsch
2007-09-12 10:59 ` Dag-Erling Smørgrav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ujrabrt2qkt.fsf@false.linpro.no \
--to=des@linpro.no \
--cc=clemens.koller@anagramm.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox