04 Jan, 2012
1 commit
-
This patch converts the drivers in drivers/power/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.Cc: Mike Rapoport
Cc: Lars-Peter Clausen
Cc: Nithish Mahalingam
Cc: MyungJoo Ham
Cc: Haojian Zhuang
Cc: Balaji Rao
Cc: Mark Brown
Signed-off-by: Axel Lin
Acked-by: Clifton Barnes
Signed-off-by: Anton Vorontsov
25 Nov, 2011
2 commits
-
It is no longer used, so we can safely remove it.
Signed-off-by: Anton Vorontsov
-
This patch fixes the following noise (by renaming _drv to _driver):
WARNING: drivers/power/olpc_battery.o(.data+0x100): Section mismatch in reference from the variable olpc_battery_drv to the function .devinit.text:olpc_battery_probe()
The variable olpc_battery_drv references
the function __devinit olpc_battery_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_consoleWARNING: drivers/power/olpc_battery.o(.data+0x104): Section mismatch in reference from the variable olpc_battery_drv to the function .devexit.text:olpc_battery_remove()
The variable olpc_battery_drv references
the function __devexit olpc_battery_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_consoleWARNING: drivers/power/olpc_battery.o(.data+0x128): Section mismatch in reference from the variable olpc_battery_drv to the variable .devinit.rodata:olpc_battery_ids
The variable olpc_battery_drv references
the variable __devinitconst olpc_battery_ids
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_consoleSigned-off-by: Anton Vorontsov
20 Aug, 2011
2 commits
-
Battery and AC events can now be used to wake up the system from suspend.
Signed-off-by: Daniel Drake
Acked-by: Andres Salomon
Signed-off-by: Anton Vorontsov -
This is cleaner, and allows suspend/resume (wakeup) handlers to be
added in an upcoming patch.Signed-off-by: Daniel Drake
Acked-by: Andres Salomon
Signed-off-by: Anton Vorontsov
13 Jan, 2011
5 commits
-
The patches adding support for CURRENT_NOW, VOLTAGE_NOW, CHARGE_NOW and
CHARGE_FULL_DESIGN were based on a tree not including c566d299
("olpc_battery: Ambient temperature is not available on XO-1.5") and
therefore only modified the then-common, now-XO-1 properties list. This
patch adds the new properties to XO-1.5 as well.Signed-off-by: Sascha Silbe
Signed-off-by: Anton Vorontsov -
{CURRENT,VOLTAGE}_AVG are actually {CURRENT,VOLTAGE}_NOW (the EC code
directly passes through the value from the gas gauge instead of the
internally used average). We retain {CURRENT,VOLTAGE}_AVG as an alias
for compatibility reasons, it will be removed later.Signed-off-by: Sascha Silbe
[ pgf@laptop.org: added VOLTAGE_NOW, aliased to VOLTAGE_AVG ]
Signed-off-by: Paul Fox
Signed-off-by: Anton Vorontsov -
CHARGE_NOW is needed by some user space software (read: UPower) for
internal calculations.This patch violates the power supply class definition (as we already
do for CAPACITY though it isn't as obvious there), but this is the best
we can do without adding rather sophisticated algorithms to either the EC
or UPower.Signed-off-by: Sascha Silbe
Signed-off-by: Paul Fox
Signed-off-by: Anton Vorontsov -
Some user space software (read: UPower) uses CHARGE_FULL_DESIGN for internal
calculations. The design capacity of the OLPC batteries is effectively fixed
and only needs to be exported.Signed-off-by: Sascha Silbe
Signed-off-by: Paul Fox
Signed-off-by: Anton Vorontsov -
The XO-1.5 does not support the ambient temperature property.
Create a separate list of properties for that configuration where
ambient temperature is not included, and apply the correct property
list at runtime.Signed-off-by: Daniel Drake
Signed-off-by: Anton Vorontsov
28 Sep, 2010
1 commit
-
When the driver was updated to be endian neutral (8e9c7716c)
the signed part of the s16 values was lost. This is because be16_to_cpu()
returns an unsigned value. This patch casts the values back to a s16
number prior to the the implicit cast up to an int.Signed-off-by: Richard A. Smith
Signed-off-by: Daniel Drake
Cc:
Signed-off-by: Anton Vorontsov
10 Aug, 2010
1 commit
-
drivers/power/olpc_battery.c:387: error: unknown field 'owner' specified in initializer
drivers/power/olpc_battery.c:387: warning: excess elements in struct initializer
drivers/power/olpc_battery.c:387: warning: (near initialization for 'olpc_bat_eeprom.attr')The .owner field has been dropped from the attr struct.
Signed-off-by: David Woodhouse
22 May, 2010
1 commit
-
This allows bin_attr->read,write,mmap callbacks to check file specific data
(such as inode owner) as part of any privilege validation.Signed-off-by: Chris Wright
Signed-off-by: Greg Kroah-Hartman
02 Jul, 2009
1 commit
-
This adds a new sysfs file called 'charge_type' which displays the
type of charging (unknown, n/a, trickle charge, or fast charging).This allows things like battery diagnostics to determine what the
battery/EC is doing without resorting to changing the 'status' sysfs
output.Signed-off-by: Andres Salomon
Acked-by: Mark Brown
Signed-off-by: Anton Vorontsov
01 Jul, 2009
4 commits
-
Grab the error code from EC_BAT_ERRCODE and let the user see it (rather
than attempting to decode it as we do with PROP_HEALTH) with a separate
error sysfs file.Signed-off-by: Andres Salomon
Signed-off-by: Anton Vorontsov -
This reverts commit 8efe444038a205e79b38b7ad03878824901849a8 and
4cbc76eadf56399cd11fb736b33c53aec9caab8c.Richard@laptop.org was apparently using CAPACITY_LEVEL for debugging
battery/EC problems, and was upset that it was removed. This readds it.Conflicts:
Documentation/power_supply_class.txt
Signed-off-by: Andres Salomon
Signed-off-by: Anton Vorontsov -
There are times when the battery is present but trickle charging,
and the EC sets only the TRICKLE bit. So we must check for the bit
when we're checking the charging/present status.Signed-off-by: Andres Salomon
Signed-off-by: Anton Vorontsov -
The eeprom read function was placing values into the wrong place in
'buf'; we were starting from buf[off], rather than buf[0].Also, the for loop that we were using was much uglier than it needed to
be. This cleans it up a bit.Signed-off-by: Andres Salomon
Signed-off-by: Anton Vorontsov
17 Oct, 2008
1 commit
-
Signed-off-by: Harvey Harrison
Acked-by: Andres Salomon
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
19 May, 2008
1 commit
-
As Richard Smith pointed out, ACR * 6250 / 15 provides for less
precision loss than ACR * 4167 / 10, _and_ it doesn't overflow. Switch
to using that equation for CHARGE_COUNTER.Signed-off-by: Andres Salomon
Cc: "Richard A. Smith"
Signed-off-by: Andrew Morton
Signed-off-by: Anton Vorontsov
13 May, 2008
1 commit
-
This adds PROP_CHARGE_COUNTER to the power supply class (documenting it
as well). The OLPC battery driver uses this for spitting out its ACR
values (in uAh). We have some rounding errors (the data sheet claims
416.7, the math actually works out to 416.666667, so we're forced to
choose between overflows or precision loss. I chose precision loss,
and stuck w/ data sheet values), but I don't think anyone will care
that much.Signed-off-by: Andres Salomon
Signed-off-by: Anton Vorontsov
04 May, 2008
4 commits
-
Refuse to run with an EC < 0x44. We're playing it safe, and this is a pretty
old EC version.Also, add a comment about why we're checking the EC version.
Signed-off-by: Andres Salomon
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Anton Vorontsov -
Move portions of the massive switch statement into functions. The layout of
this thing has already caused one bug (a break in the wrong place), it needed
to shrink.Signed-off-by: Andres Salomon
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Anton Vorontsov -
This allows you to dump 0x60 bytes from the battery's EEPROM (starting at
address 0x20). Note that it does an EC command for each byte, so it's pretty
slow. OTOH, if you want to grab just a single byte from somewhere in the
EEPROM, you can do something like:dd bs=1 count=1 skip=16 if=/sys/class/power_supply/olpc-battery/eeprom | od -x
Userspace battery collection/logging information needs this.
Signed-off-by: Andres Salomon
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Anton Vorontsov -
This adds serial number support to the OLPC battery driver.
Signed-off-by: David Woodhouse
Signed-off-by: Andres Salomon
Signed-off-by: Anton Vorontsov
29 Apr, 2008
1 commit
-
This adds support for OLPC XO hardware. Open Firmware on XOs don't contain
the VSA, so it is necessary to emulate the PCI BARs in the kernel. This also
adds functionality for running EC commands, and a CONFIG_OLPC.A number of OLPC drivers depend upon CONFIG_OLPC.
olpc_ec_timeout is a hack to work around Embedded Controller bugs.
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: geode_has_vsa build fix]
[akpm@linux-foundation.org: olpc_register_battery_callback doesn't exist]
Signed-off-by: Andres Salomon
Acked-by: Ingo Molnar
Cc: Thomas Gleixner
Cc: Andi Kleen
Cc: Jordan Crouse
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Feb, 2008
1 commit
-
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
Signed-off-by: David Woodhouse
16 Jul, 2007
1 commit
-
Per Jeff Garzik request.
Signed-off-by: Jeff Garzik
Signed-off-by: Anton Vorontsov
10 Jul, 2007
1 commit
-
Signed-off-by: David Woodhouse
Signed-off-by: Anton Vorontsov