From: "Shem Multinymous" <multinymous@gmail.com>
To: "Anton Vorontsov" <cbou@mail.ru>
Cc: linux-kernel@vger.kernel.org, kernel-discuss@handhelds.org,
dwmw2@infradead.org
Subject: Re: [PATCH 3/7] [RFC] Battery monitoring class
Date: Thu, 12 Apr 2007 11:00:07 -0400 [thread overview]
Message-ID: <41840b750704120800l6ab2b0f8qeda6931d7c7e9bc6@mail.gmail.com> (raw)
In-Reply-To: <20070411232503.GC20095@zarina>
Hi Anton,
A few comments on the ever-contentious choice of battery attributes:
On 4/11/07, Anton Vorontsov <cbou@mail.ru> wrote:
> + * All voltages, currents, capacities and temperatures in mV, mA, mAh and
> + * tenths of a degree unless otherwise stated. It's driver's job to convert
> + * its raw values to which this class operates. If for some reason driver
> + * can't afford this requirement, then it have to create its own attributes,
> + * plus additional "XYZ_units" for each of them.
> + */
Many (most, I believe) laptop batteries report capacity in mWh
(energy), not mAh (charge). You can't convert between the two without
a detailed, up-to-date physical model of the battery. This is too
common to relegate to a non-standardized "XYZ_units" extension.
> +BATTERY_INT_ATTR(min_voltage);
> +BATTERY_INT_ATTR(min_current);
> +BATTERY_INT_ATTR(min_capacity);
> +BATTERY_INT_ATTR(max_voltage);
> +BATTERY_INT_ATTR(max_current);
> +BATTERY_INT_ATTR(max_capacity);
> +BATTERY_INT_ATTR(temp);
> +BATTERY_INT_ATTR(voltage);
> +BATTERY_INT_ATTR(current);
> +BATTERY_INT_ATTR(capacity);
I suggest adding "remaining operating time" and "remaining charging
time". You can try deducing these from the above attributes, but in
practice this gives very inaccurate predictions. On laptops (e.g.,
ThinkPad) the BIOS or EC often provides much better estimates, using a
more accurate physical model.
I also see you omitted a host of other common attributes, like design
capacity, cycle count, model string, and temperatures. There was an
extensive LKML discussion of the choice and naming of attributes, in
the context of David Woodhouse's patch; there are futher observations
there. Also, here's the list of attributes in my tp_smapi ThinkPad
driver: http://thinkwiki.org/wiki/tp_smapi#Battery_charge_control_features
Does "max capaxity" correspond to what's usually denoted "last full capacity".
I understand you allow adding custom attributes, but they're of
limited use if generic userspace tools don't know their name and
semantics. It's important to standardize all reasonably common
attributes.
Shem
next prev parent reply other threads:[~2007-04-12 15:00 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 23:25 Anton Vorontsov
2007-04-12 2:53 ` Randy Dunlap
2007-04-12 16:51 ` Anton Vorontsov
2007-04-12 3:43 ` Greg KH
2007-04-12 12:25 ` Henrique de Moraes Holschuh
2007-04-12 13:43 ` Anton Vorontsov
2007-04-12 13:08 ` Matthew Garrett
2007-04-12 14:15 ` Anton Vorontsov
2007-04-12 14:24 ` Matthew Garrett
2007-04-12 14:36 ` [Kernel-discuss] " Paul Sokolovsky
2007-04-12 18:56 ` Henrique de Moraes Holschuh
2007-04-12 20:44 ` Anton Vorontsov
2007-04-13 0:51 ` Henrique de Moraes Holschuh
2007-04-13 2:15 ` Anton Vorontsov
2007-04-24 19:36 ` Pavel Machek
2007-04-13 2:34 ` Shem Multinymous
2007-04-13 2:36 ` Anton Vorontsov
2007-04-13 13:51 ` Henrique de Moraes Holschuh
2007-04-12 15:00 ` Shem Multinymous [this message]
2007-04-12 15:18 ` Anton Vorontsov
2007-04-12 17:23 ` Shem Multinymous
2007-04-13 13:49 ` Anton Vorontsov
2007-04-15 0:43 ` Anton Vorontsov
2007-05-04 9:59 ` Pavel Machek
2007-04-15 19:56 ` Pavel Machek
2007-04-15 22:10 ` [Kernel-discuss] " Anton Vorontsov
2007-04-15 22:08 ` Ondrej Zajicek
2007-04-15 22:50 ` Anton Vorontsov
2007-04-16 0:57 ` Henrique de Moraes Holschuh
2007-04-16 1:57 ` Anton Vorontsov
2007-04-16 14:34 ` Henrique de Moraes Holschuh
2007-04-16 2:32 ` [Kernel-discuss] " ian
2007-04-16 3:12 ` Anton Vorontsov
2007-04-16 8:28 ` ian
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=41840b750704120800l6ab2b0f8qeda6931d7c7e9bc6@mail.gmail.com \
--to=multinymous@gmail.com \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=kernel-discuss@handhelds.org \
--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
all inboxes | Powered by JetHome®