From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Soeren Sonnenburg <kernel@nn7.de>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]: pbook apm_emu.c fix remaining time when charging
Date: Sun, 10 Oct 2004 10:09:46 +1000 [thread overview]
Message-ID: <1097366985.5591.16.camel@gaston> (raw)
In-Reply-To: <1097352701.3483.12.camel@localhost>
On Sun, 2004-10-10 at 06:11, Soeren Sonnenburg wrote:
> Hi,
>
> this should make /proc/apm
>
> a) display the remaining time until the battery is fully charged and
> b) when the system is on AC but the battery is not getting charged 0 is
> displayed as remaining time.
>
> Please comment/apply,
> Soeren
if (amperage < 0) {
+ /* when less than 100mA are used the machine must be on AC and as it is
+ not charging the battery is only slightly self decharging and thus full be definition */
+ if (amperage < 100) {
There must be something wrong in the above...
+ time_units = (charge * 59) / (amperage * -1);
+ else
+ time_units = (charge * 16440) / (amperage * -60);
Can you make sure also that amperage is never 0 ?
Ben.
next prev parent reply other threads:[~2004-10-10 0:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-09 20:11 [PATCH]: pbook apm_emu.c fix remaining time when charging Soeren Sonnenburg
2004-10-10 0:09 ` Benjamin Herrenschmidt [this message]
2004-10-10 7:16 ` Soeren Sonnenburg
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=1097366985.5591.16.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=kernel@nn7.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