From: Clemens Koller <clemens.koller@anagramm.de>
To: "Dag-Erling Smørgrav" <des@linpro.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC+PATCH] RTC calibration
Date: Tue, 11 Sep 2007 21:02:47 +0200 [thread overview]
Message-ID: <46E6E657.2050201@anagramm.de> (raw)
In-Reply-To: <ujr1wd52npl.fsf@false.linpro.no>
Dag-Erling Smørgrav schrieb:
> Clemens Koller <clemens.koller@anagramm.de> writes:
>> I am talking about _how_ the calibration register is addressed from
>> userspace. It's a simple register, some bits at address 7 and I would
>> expect to read/modify/write registers to do all the things you want
>> to do. Register access in userspace doesn't put any limitation
>> to applications.
>
> It requires the application to know the hardware intimately.
That's right... there is no need to put that into the kernel and
hide this trivial functionality from userspace.
> Calibration of the M41T11 is implemented using the lower 6 bits of
> register 7; this is not necessarily the case for other existing or
> future chips.
I've read the datasheet.
Your driver is specific for the M41T11 chip as mentioned in your
first mail, isn't it? If any future driver comes up with 8 bits
you wouldn't need to change a generic interface to read/modify/write
these 8 bits, right?
> Let's say I normalize this to [-128;127];
Why do any normalization in the driver? That's what userspace can do
in any way it might be necessary to do.
>> Having only incs and decs without getting the actual value back seems
>> to be an absolutely unnecessary limitation here.
>> You cannot get the current value back to see if it's i.e. in saturation in
>> a way that it doesn't make sense to inc/decrement it further or in bigger steps
>> or reset it to zero...
>
> The driver will return EINVAL if you try to increment or decrement the
> calibration register beyond its limits.
That behaviour seems also odd to me...
I can increment/decrement by an unknown number and then I get an EINVAL.
And I cannot reset it to some default value easily.
I still don't see any reason to implement relative changes to an otherwise
unknown value if it's possible to give absolute values to work with.
Well, that's my opinion, my five cents... I don't want to get into a lenghtly
discussion... I just used common sense how a interface to a register might
look like and your way of a relative manipulation just looks very uncommon
to me, having seen lot's of drivers.
Best regards,
Clemens Koller
__________________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Straße 45/1
Linhof Werksgelände
D-81379 München
Tel.089-741518-50
Fax 089-741518-19
http://www.anagramm-technology.com
next prev parent reply other threads:[~2007-09-11 19:07 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
2007-09-11 15:36 ` Clemens Koller
2007-09-11 16:04 ` Dag-Erling Smørgrav
2007-09-11 19:02 ` Clemens Koller [this message]
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=46E6E657.2050201@anagramm.de \
--to=clemens.koller@anagramm.de \
--cc=des@linpro.no \
--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