Commit graph android_kernel_sony_sdm845/drivers/power/pda_power.c
Message SHA1
pda_power: add init and exit function callbacks
This adds init/exit function callbacks to pda_power, to
provide a place where the platform code can request/free
GPIOs that it wants to use in the is_ac_online, is_usb_online
and set_charge functions.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>

Philipp Zabel   authored and   Anton Vorontsov   commited 2008-05-03 03:39:55 +04:00
f6b6b180b4
pda_power: implement polling
Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Anton Vorontsov   commited 2008-02-02 02:44:34 +03:00
c3caebad74
pda_power: various cleanups
- handle spurious interrupts correctly;
- get rid of pda_power_supplies array, use two variables instead;
- factor out psy_changed() function, it will be used for polling.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Anton Vorontsov   commited 2008-02-02 02:44:34 +03:00
bfde2662ae
pda_power: add suspend/resume support
Add suspend/resume/wakeup support for pda_power.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Dmitry Baryshkov   authored and   Anton Vorontsov   commited 2008-02-02 02:43:00 +03:00
8f8e9b387e
pda_power: only register available psu
Currently pda-power adds both ac and usb power supply units.
This patch fixes it so that psu are added only if they are enabled.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Dmitry Baryshkov   authored and   Anton Vorontsov   commited 2008-02-02 02:42:59 +03:00
9ef4510626
Power supply class and drivers: remove non obligatory return statements
Per Jeff Garzik request.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Anton Vorontsov   commited 2007-07-15 22:32:38 +04:00
7b3d54a8c3
pda_power: clean up irq, timer
Clean up pda_power interrupt handling:

Prior to this patch, the driver would pass information it needed
to the interrupt handler dev_id pointer, and then prompt forget it
ever did so, recreating that same information after a couple passes
through the timer-based state machine.

This patch removes the redundant checks by passing the
pda_power_supply[] pointer through the state machine.  The current
code passed 'irq' through the state machine, as an index to recreate
the pointer, when we could more simply pass around the pointer itself.

This patch makes it easier to remove the 'irq' argument in the future,
in addition to cleaning up the driver today.

Signed-off-by: Jeff Garzik <jeff@garzik.org>

Jeff Garzik   authored and   Anton Vorontsov   commited 2007-07-15 22:32:03 +04:00
5ebf6e6a96
[BATTERY] pda_power platform driver
Common power driver for PDAs and phones with one or two external
power supplies (AC/USB) connected to main and backup batteries,
and optional builtin charger.

It's used to stop logic duplication through different embedded
devices. So, power supply *logic* is here. pda_power register
power supplies, and will take care about notifying batteries
about power changes through external power interface.

Currently, power consumption legal limits (including USB power
consumption) should be handled by platform code, inside set_charge
function.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: Roman Moravcik <roman.moravcik@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

Anton Vorontsov   authored and   David Woodhouse   commited 2007-07-10 11:25:59 +01:00
b2998049cf