29 Jan, 2010
1 commit
-
Don't unconditionally dereference the WM97xx core platform data since
it may not be present, causing an oops.Signed-off-by: Mark Brown
Signed-off-by: Anton Vorontsov
18 Dec, 2009
1 commit
-
Prior to this patch, pmu_battery was unable to report battery full
status. This patch fixes the issue by adding a proper handling code
into pmu_bat_get_property(): if we're on AC and the battery isn't
charging, then the battery is considered full.Signed-off-by: Thomas Champagne
Acked-By: David Woodhouse
Signed-off-by: Anton Vorontsov
16 Dec, 2009
2 commits
-
* git://git.infradead.org/battery-2.6:
power_supply_sysfs: Handle -ENODATA in a special way
wm831x_backup: Remove unused variables
gta02: Set pcf50633 charger_reference_current_ma
pcf50633: Query charger status directly
pcf50633: Properly reenable charging when the supply conditions change
pcf50633: Get rid of charging restart software auto-triggering
pcf50633: introduces battery charging current control
pcf50633: Add ac power supply class to the charger
wm831x: Factor out WM831x backup battery charger -
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Dec, 2009
3 commits
-
Bring the WM8350 IRQ API more in line with the generic IRQ API by
masking and unmasking interrupts as they are requested and freed.
This is mostly just a case of deleting the mask and unmask calls
from the individual drivers.The RTC driver is changed to mask the periodic IRQ after requesting
it rather than only unmasking the alarm IRQ. If the periodic IRQ
fires in the period where it is reqested then there will be a
spurious notification but there should be no serious consequences
from this.The CODEC drive is changed to explicitly disable headphone jack
detection prior to requesting the IRQs. This will avoid the IRQ
firing with no jack set up.Signed-off-by: Mark Brown
Signed-off-by: Samuel Ortiz -
This is done as simple code transformation, the semantics of the
IRQ API provided by the core are are still very different to those
of genirq (mainly with regard to masking).Signed-off-by: Mark Brown
Signed-off-by: Samuel Ortiz -
Since platform_device_add_data copies the passed data, the allocated
subdev_pdata is never freed. A simple fix would be to either free subdev_pdata
or put it onto the stack. But since the pcf50633 child devices can rely on
beeing children of the pcf50633 core device it's much more elegant to get access
to pcf50633 core structure through that link. This allows to get completly rid
of pcf5033_subdev_pdata.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Paul Fertser
Signed-off-by: Samuel Ortiz
03 Dec, 2009
1 commit
-
There are cases when some device can not report any meaningful value,
e.g. TWL4030 charger can report voltage only when charging is
active.In these cases drivers will return -ENODATA, and we shouldn't flood
kernel log with error messages.Signed-off-by: Anton Vorontsov
28 Nov, 2009
1 commit
-
This driver is based on tosa_battery.c.
18 Nov, 2009
1 commit
-
Signed-off-by: Alan Cox
Acked-by: Mark Brown
Signed-off-by: Anton Vorontsov
16 Nov, 2009
6 commits
-
Current scheme is fragile and is likely to go off sync, especially on
batfull->adapter charging automatic MBC transition.Query the status bit every time we need it instead.
We need to export another function to query for USB presence because
we can't read anything from PCF50633 (via I2C) inside irq context and
that is needed by usb gadgets.Signed-off-by: Paul Fertser
Signed-off-by: Anton Vorontsov -
If chgmod == BATFULL, setting chgena has no effect. Datasheet says we
need to set resume instead but when autoresume is used resume doesn't
work. Clear and set chgena instead.This enables a user to force charging by re-plugging USB even when the
charger entered Battery Full mode, might be handy before a long trip.Signed-off-by: Paul Fertser
Signed-off-by: Anton Vorontsov -
After reaching Battery Full condition MBC state machine switches back
into charging mode when the battery voltage falls below 96% of a
battery float voltage. The voltage drop in Li-Ion batteries is
marginal (1-2%) till about 80% of its capacity - which means, after a
BATFULL, charging won't be restarted until 75-80%.That is a desired behaviour recommended by battery manufacturers,
don't mess with it.Signed-off-by: Paul Fertser
Signed-off-by: Anton Vorontsov -
Implement a new sysfs attribute to allow changing MBC charging limit on
the fly independently of usb current limit. It also gets set
automatically every time usb current limit is changed.Limiting charging current also prevents violating USB specification in
the case when the whole device is shut down and usb current limit is
reset to the factory default by the pcf50633 state transition.Signed-off-by: Balaji Rao
Signed-off-by: Paul Fertser
Signed-off-by: Anton Vorontsov -
This adds an appropriate ac power_supply class and shows usb only when
at the appropriate current limit.Signed-off-by: Sean McNeil
Signed-off-by: Paul Fertser
Signed-off-by: Anton Vorontsov -
The backup battery on WM831x is a separate IP block to the main PMU
and is largely unrelated to the main supply functionality. Factor it
out into a separate driver in order to reflect this and better support
future hardware versions.Signed-off-by: Mark Brown
Acked-by: Samuel Ortiz
Signed-off-by: Anton Vorontsov
23 Sep, 2009
1 commit
-
Conflicts:
drivers/power/wm97xx_battery.c
05 Sep, 2009
5 commits
-
The WM831x PMICs provide power path management from three sources:
a wall supply, USB and a battery with integrated charger. They also
provide an additional backup supply with integrated for maintaining
always on functionality such as the RTC and monitoring of power
switches.After some initial configuration at startup the device operates
autonomously, the driver simply provides reporting of the current
state.Signed-off-by: Mark Brown
Signed-off-by: Anton Vorontsov -
On the device we're currently developing, battery sizes of ~2.8Ah and
current flow of ~600mA are typical.With that values, the life_sec computation overflows due to the
multiplication by 3600.Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Cc: Matt Reimer
Signed-off-by: Anton Vorontsov -
Signed-off-by: Marek Vasut
Signed-off-by: Anton Vorontsov -
Signed-off-by: Marek Vasut
Signed-off-by: Anton Vorontsov -
This patch converts the wm97xx-battery driver to use platform_data
supplied by ac97 bus.Signed-off-by: Marek Vasut
Signed-off-by: Anton Vorontsov
31 Jul, 2009
1 commit
-
* git://git.infradead.org/users/cbou/battery-2.6.31:
Add ds2782 battery gas gauge driver
olpc_battery: Ensure that the TRICKLE bit is checked
olpc_battery: Fix up eeprom read function
30 Jul, 2009
8 commits
-
The ds2760's internal current meter is not reliable enough as it has an
inacurracy of around ~15%. Without any correction for that error, the
current accumulator is couting up all the time, even though the battery
is already fully charged and hence destroys the static information. The
longer it is connected, the worse is the aberration.Fortunately, this can be corrected by the DS2760_CURRENT_OFFSET_BIAS
register. Using the external power_supply_set_battery_charged()
function, this register is now gauging the measurement.A delayed work is used to debounce flaky GPIO signals and to let the
current value settle. Also see Maxim's application note AN4188.Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Cc: Matt Reimer
Cc: Anton Vorontsov
Signed-off-by: Anton Vorontsov -
This adds a function that indicates that a battery is fully charged.
It also includes functions to get a power_supply device from the class
of registered devices by name reference. These can be used to find a
specific battery to call power_supply_set_battery_charged() on.Some battery drivers might need this information to calibrate
themselves.Signed-off-by: Daniel Mack
Cc: Ian Molton
Cc: Anton Vorontsov
Cc: Matt Reimer
Signed-off-by: Anton Vorontsov -
While I'm at it, cleanup the power supply code so that EXPORT_SYMBOL_GPL
appears directly after the symbole declaration. checkpatch.pl wants it
that way.Signed-off-by: Daniel Mack
Cc: Ian Molton
Cc: Matt Reimer
Signed-off-by: Anton Vorontsov -
When connecting a ds2760 to a partly loaded battery the first time,
there must be a way to bootstrap the current_accum value. Without that,
the current capactity value is bogus until the battery is fully charged
for the first time.Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Cc: Matt Reimer
Signed-off-by: Anton Vorontsov -
In systems where the battery monitor is not part of the battery pack and
is hence not bootstrapped with sane values, the full_active_uAh is
likely to be zero.Handle that case by defaulting to the rated_capacity information which
can be passed to the driver using the new module parameter.Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Acked-by: Matt Reimer
Signed-off-by: Anton Vorontsov -
For systems where the ds2760 is soldered directly on the PCB, the 'rated
capacity' register is not set to anything useful.In order to allow users to bootstrap this value, introduce a new module
parameter 'rated_capacity' and use it to write the internal EEPROM in
case the value differes from what's been given.Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Acked-by: Matt Reimer
Signed-off-by: Anton Vorontsov -
Export POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW and POWER_SUPPLY_PROP_CAPACITY
features to the power supply core.Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Acked-by: Matt Reimer
Signed-off-by: Anton Vorontsov -
This fixes a race condition I recently introduced with the PMOD feature
addition (cef437e3: "w1: ds2760_battery: add support for sleep mode
feature").Postpone the call to power_supply_register() to fix it.
Signed-off-by: Daniel Mack
Cc: Szabolcs Gyurko
Acked-by: Matt Reimer
Signed-off-by: Anton Vorontsov
14 Jul, 2009
1 commit
-
Signed-off-by: Mark Brown
Signed-off-by: Anton Vorontsov
13 Jul, 2009
1 commit
-
direct access of driver_data is going away.
Signed-off-by: Alexander Beregalov
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
5 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 -
This patch adds a driver for ds2782 battery devices.
Signed-off-by: Ryan Mallon
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
09 Jun, 2009
1 commit
-
There are cases when charging monitor and the event handler try to
change the charger state simultaneously. For instance, a charger is
connected to the system, there's the detection event and the event
handler tries to enable charging. It is possible that the periodic
charging monitor runs at the same time and it still thinks there's
no external charger. So it tries to disable the charging. As the
result, even if the conditions necessary to charge the battery hold,
there will be no actual charging.The patch changes the event handler so that instead of enabling/
disabling the charger immediately it would rather make the monitor
run. The monitor code then decides what should be the charger state.Signed-off-by: Mike Rapoport
Signed-off-by: Andrew Morton
Signed-off-by: Anton Vorontsov