From: Pavel Machek <pavel@ucw.cz>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: sharpsl_pm: using milivolts instead of custom units?
Date: Fri, 11 Nov 2005 20:18:40 +0100 [thread overview]
Message-ID: <20051111191839.GA29471@elf.ucw.cz> (raw)
In-Reply-To: <1131712513.7794.7.camel@localhost.localdomain>
Hi!
> > #ifdef CONFIG_SA1100_COLLIE
> > struct battery_thresh spitz_battery_levels_noac[] = {
> > { 368, 100},
> > { 358, 25},
> > { 356, 5},
> > { 0, 0},
> > ...
> >
> > ...so it could get very confusing. Would it be feasible to convert to
> > mV as soon as possible and have all constants in milivolts? I realize
> > they may be slightly different for different models, but they should
> > at least be comparable.
>
> The battery levels are totally different between the models and each is
> going to need a levels translation table as its an extremely none linear
> decay curve. Using ADC values here makes a lot of sense as that's as
> granular as the information ever gets and you don't start to lose
> accuracy anywhere with rounding.
Well, all the models have li-ion batteries, so levels (in milivolts)
for stuff like "battery empty" should be very similar. If conversion
from ADC to voltage is non-trivial, that's a show stopper I guess.
> I still think you've much bigger problems to worry about as this code is
> heavily PXA biased and is going to need a lot of changes to work on the
> SA1100. Its why I've put it in mach-pxa rather than common and a
> separate driver for collie based on this code might be easier.
Actually I think I can refactor in a way that a common core can be
share. I'd hate to copy 1000 lines...
Pavel
--
Thanks, Sharp!
prev parent reply other threads:[~2005-11-11 19:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-11 12:03 Pavel Machek
2005-11-11 12:35 ` Richard Purdie
2005-11-11 19:18 ` Pavel Machek [this message]
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=20051111191839.GA29471@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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
all inboxes | Powered by JetHome®