This commit:
commit 8efe444038
Author: Andres Salomon <dilinger@queued.net>
Date: Wed Dec 12 14:12:56 2007 -0500
power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL
Removed CAPACITY_LEVEL from every other code, leaving the array with sysfs
attributes with one more entry than the number of enums in power_supply.h.
This leads to some attributes containing the value of the attribute right
after it. For example, temp_ambient would have the value of
time_to_empty_now. In my case, I had time_to_full_avg have the value which
should be in model_name, when the former was usually empty.
Cc: Andres Salomon <dilinger@debian.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
egrep serial /proc/acpi/battery/BAT0/info
serial number: 32090
serial number can tell you from the imminent danger
of beeing set on fire.
Signed-off-by: maximilian attems <max@stro.at>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Add LiMn (one of the most common for small non-rechargable batteries)
battery technology and voltage_min/_max properties support.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
In power_supply_create_attrs(), we create static attributes as referenced
by power_supply_static_attrs[i]. After that, if we fail, we unregister
via power_supply_static_attrs[psy->properties[i]]. This is incorrect, as
psy->properties has absolutely no bearing on static attribs. This patch
fixes it to unregister the correct attrib.
Another line which was unnecessarily line wrapped is also unwrapped.
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
The CAPACITY_LEVEL stuff defines various levels of charge; however, what
is the difference between them? What differentiates between HIGH and NORMAL,
LOW and CRITICAL, etc?
As it appears that these are fairly arbitrary, we end up making such policy
decisions in the kernel (or in hardware). This is the sort of decision that
should be made in userspace, not in the kernel.
If the hardware does not support _CAPACITY and it cannot be easily calculated,
then perhaps the driver should register a custom CAPACITY_LEVEL attribute;
however, userspace should not become accustomed to looking for such a thing,
and we should certainly not encourage drivers to provide CAPACITY_LEVEL
stubs.
The following removes support for POWER_SUPPLY_PROP_CAPACITY_LEVEL. The
OLPC battery driver is the only driver making use of this, so it's
removed from there as well.
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This changes the uevent buffer functions to use a struct instead of a
long list of parameters. It does no longer require the caller to do the
proper buffer termination and size accounting, which is currently wrong
in some places. It fixes a known bug where parts of the uevent
environment are overwritten because of wrong index calculations.
Many thanks to Mathieu Desnoyers for finding bugs and improving the
error handling.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Need to null terminate environment. Found by inspection
while looking for similar problems to platform uevent bug
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
This class is result of "external power" and "battery" classes merge,
as suggested by David Woodhouse. He also implemented uevent support.
Here how userspace seeing it now:
# ls /sys/class/power\ supply/
ac main-battery usb
# cat /sys/class/power\ supply/ac/type
AC
# cat /sys/class/power\ supply/usb/type
USB
# cat /sys/class/power\ supply/main-battery/type
Battery
# cat /sys/class/power\ supply/ac/online
1
# cat /sys/class/power\ supply/usb/online
0
# cat /sys/class/power\ supply/main-battery/status
Charging
# cat /sys/class/leds/h5400\:red-left/trigger
none h5400-radio timer hwtimer ac-online usb-online
main-battery-charging-or-full [main-battery-charging]
main-battery-full
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>