Age | Commit message (Collapse) | Author |
|
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 <fercerpav@gmail.com>
|
|
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 <fercerpav@gmail.com>
|
|
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 <fercerpav@gmail.com>
|
|
Some userspace (notably Enlightment's batget) ignores "capacity"
completely if there're no other properties. Expose a fake value
(850mAh, typical for BL-5C) to make them happy.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Check if machine-specific hooks exist before calling, this allows to use
this driver with gta02 or any other device that is able to provide battery
voltage readings.
Report an estimate of capacity percentage left, based on discharge curves.
Strictly speaking, this is a violation of power_supply class specs but
since this is the only driver for dumb batteries and userspace lacks any
library to do the estimation itself, we have to stuff it here.
Please keep in mind that this estimation is by no means accurate, usually
cell phones have only 5 bars to represent charge status.
Credit goes to Joerg Reisenweber and SpeedEvil for helping with gathering
and analysing the data.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Driver data must be properly registered after allocation
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
If the battery is not present hdq_read will always return an error.
If the drivers knows that the battery is not present the correct thing to do is
to return -ENODEV instead of passing the error on.
Do this for all properties except POWER_SUPPLY_PROP_PRESENT.
The power supply sysfs expects us to do so, else it won't generate a proper
uevent file.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
|
|
This is because of commit
1f06c28eaa6e77384a366c3d2ab1ccdbb8a807e0
The BQ27000 Battery requires HDQ.
Otherwise the battery is not available at all.
Signed-off-by: Luca Capello <luca@pca.it>
|
|
Using HAL for E's battery gadget highlighted an oddity: the kernel exposed
last full charge property but didn't expose current charge property. This
resulted in the wrong computation of current battery capacity by E's gadget
(and probably other programs as well).
This patch exposes a corresponding bq27000 register to make E battery
gadget happy (it is still not showing correct values because of bugs in HAL
resulting in 3 batteries (apm emulation and usb supply being bogus here)
instead of one).
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
This patch adds a call to cancel_delayed_work before a call
to schedule_delayed_work.
Signed-off-by: Michael Trimarchi <michael@panicking.kicks-ass.org>
Signed-off-by: Daniel Willmann <daniel@totalueberwachung.de>
|
|
Avoid a kernel panic during an early call
to the pcf50633_mbc_get_status function.
|
|
Small patch to add /sys/class/power_supply/battery/present.
You must not run a GTA01 without battery thus it is always 1.
Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
|
|
This patch adds the call to the worker in
bq27000_battery_external_power_changed. Now (un)plugging the USB cable
effects the battery status soon. I don't know if it is possible call
the status change directly.
Signed-off-by: Michael Trimarchi <michael@panicking.kicks-ass.org>
Signed-off-by: Daniel Willmann <daniel@totalueberwachung.de>
|
|
Changing dev_info => dev_dbg.
Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
|
|
Signed-off-by: Werner Almesberger <werner@openmoko.org>
|
|
Signed-off-by: Werner Almesberger <werner@openmoko.org>
Reported-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
|
|
[ Werner: Documentation/CodingStyle lines 166 and 448, put blank line after
local variables. ]
Signed-off-by: Tim Niemeyer <reddog@mastersword.de>
Signed-off-by: Werner Almesberger <werner@openmoko.org>
|
|
If no battery is connected, we periodically get a burst of HDQ error
messages (at least on 3D7K), interrupting whatever we're doing on
the console.
This patch reduces this to only one message per sequence of errors,
and one more message if communication with HDQ is successful later.
Signed-off-by: Werner Almesberger <werner@openmoko.org>
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Reported-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
X-Git-Url: http://git.openmoko.org/?p=kernel.git;a=commitdiff_plain;h=f4fd6631973dbc67a5f4708014e81ca6e610ca05
pcf50633_charger_detection_fix.patch
Fix PCF50633 charger detection code.
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
This removes the unstable operation by increasing break timing from
170us to 230us, the datasheet minimum was 190us.
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
X-Git-Url: http://git.openmoko.org/?p=kernel.git;a=commitdiff_plain;h=c94ea3d685fa6e9b24d62adb11a7ad6087b9edf5
fix_gta03_fiq_stuff.patch
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
Introduce a new generic HDQ gpio based bitbang driver
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
Hi.
The recent patch to fix a USB current limit violation when turning the
device off triggered a bug in setting the battery charge current limit. We
now get a charge current limit of 0 mA on the GTA02 when plugging in the
wall charger (just as when setting 1000 mA in /sys/class/[...]/chg_curlim).
This patch fixes it (and a comment typo). Tested on a GTA02 with a wall
charger.
Signed-off-by: Rask Ingemann Lambertsen <rask@sygehus.dk>
|
|
hes-tracking-MERGE-via-master-MERGE-via-master-hist-1232625318-1233879011-1233879414-1233879505
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-MERGE-via-master-MERGE-via-master-hist-1232625318-1233879011-1233879414-1233879505 / 1c405b6ccee468298e7ccbfd9a3a3f4d123207b0 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-MERGE-via-master-MERGE-via-master-hist-1232625318-1233879011-1233879414
stable-tracking-hist top was MERGE-via-mokopatches-tracking-MERGE-via-master-MERGE-via-master-hist-1232625318-1233879011-1233879414 / 71be0a45396066b1f8f27f8f4f87937247a129e1 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-mokopatches-tracking-hist-MERGE-via-master-MERGE-via-master-hist-1232625318-1233879011
mokopatches-tracking-hist top was MERGE-via-master-MERGE-via-master-hist-1232625318-1233879011 / 1be1b01373f572a02c6f1f99863c8c11ed2f9f5b ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-master-MERGE-via-master-hist-1232625318
master top was MERGE-via-master-hist-1232625318 / dd4b117123ae66451695810017eb72fbdfc05df5 ... parent commitmessage:
From: merge <null@invalid>
MERGE-master-patchset-edits
|
|
Cedric noticed that when he turned his GTA02 OFF while hooked to
a "dumb" USB charger that should only be asked for 100mA, suddenly
much more current was demanded.
When PMU enters PMU standmy when we go OFF, its USB current limit
is reset to the variant default of 500mA. Since we previously had
the charging current limit fixed at 1A, it meant we immediately
charge at 500mA.
This patch makes the charging limit follow the USB current limit,
so that even when we go off, no more than the last authorized amount
of current will be taken, even if the USB current limit is later
broken by the variant default.
Reported-by: Cedric Berger <cedric.berger74@gmail.com>
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Introduces battery charging current control.
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
X-Git-Url: http://git.openmoko.org/?p=kernel.git;a=commitdiff_plain;h=1bb6adaa6a59f52d616b5260cb776eafd40ef05e
pcf50633_introduce_charging_restart_interval.patch
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
X-Git-Url: http://git.openmoko.org/?p=kernel.git;a=commitdiff_plain;h=94808ce02deeb78bb3728db416fd4b7544b6d232
pcf50633_remove_set_charger_status.patch
|
|
X-Git-Url: http://git.openmoko.org/?p=kernel.git;a=commitdiff_plain;h=938eddf17625cce0307f7612a3ea2560384e2384
pcf50606_rebase_changes,patch
This patch brings into andy-tracking all changes related to pcf50606 from old
balaji-tracking.
|
|
fix-ac-redefinition.patch
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
hes-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040
stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch
mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
fix-stray-endmenu.patch
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
When irq_handler is called from core, the irqs might not have been yet
registered - which means, the initial charger state was not being set
properly.
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
This avoids excessive discharges seen in case of Li-ion batteries even
when charger is connected.
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
This makes sure that charging status remains correct when currrent
limit is altered from userspace.
Signed-off-by: Balaji Rao <balajirrao@openmoko.org>
|
|
Whoops this is just reverting a couple of patches that
were not ready to be committed yet.
|
|
o-allocation-1228776491
pending-tracking-hist top was MERGE-via-stable-tracking-fix-s3c2410_ts-fifo-allocation-1228776491 / a85a8a282939b4f6800081f67e1d568e0b97bd7a ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-fix-s3c2410_ts-fifo-allocation
stable-tracking-hist top was fix-s3c2410_ts-fifo-allocation / 56a57ba0d4c1d60869250d5f89fae61544f01012 ... parent commitmessage:
From: Nelson Castillo <nelsoneci@gmail.com>
Fix s3c2410_ts FIFO allocation
When I added the FIFO improving the interrupts handlers I introduced a bug.
The FIFO is allocated after the interrupts are requested. This makes the kernel
crash if the touchscreen generates activity before the allocation takes place.
This patch fixes the bug. I reproduced it and tested the fix in a GTA02.
- Fix bug
- Fix a typo
Reported-by: Andy Green <andy@openmoko.com>
Signed-off-by: Nelson Castillo <nelsoneci@gmail.com>
|
|
This adds an appropriate ac power_supply class and shows usb only when
at the appropriate current limit.
Signed-off-by: Sean McNeil <sean@mcneil.com>
|
|
patches-tracking-via-master-s3c-hsmmc-clean
balaji-tracking-hist top was efb2d57c0e0ed62324d79d6c5793fe797c157266
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Changes related to pcf50633_mfd.patch
|
|
Try to make sure about no compiler malarky by volatile. Change hdq busy
detect. Change error handling path in hdq interface to fiq.
Signed-off-by: Sean McNeil <sean@mcneil.com>
|
|
Along the same lines as FIQ, HDQ can have children in device tree terms too.
Allow the same kind of callback in machine-specific code
Signed-off-by: Andy Green <andy@openmoko.com>
|