Commit Graph

10 Commits

Author SHA1 Message Date
Ramakrishna Pallala ea2ce92e44 power_supply: Add support for CHARGE_CONTROL_* attributes
Add support for power supply attributes CHARGE_CONTROL_LIMIT
and CHARGE_CONTROL_LIMIT_MAX.

These new attributes will enable the user space to implement
custom charging algorithms based on platform state.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-17 20:21:43 -08:00
Ramakrishna Pallala 2815b786c3 power_supply: Add new power supply properties CHARGE_CURRENT/VOLTAGE_MAX
There are different types of chargers avalibale like AC, Solar, USB,
etc..  Even in USB we have different types SDP/DCP/CDP/ACA and all these
chargers have different o/p ratings. For example SDP supports only 500mA
of charge current whereas AC charger can support upto 8A or more.

Similarly batteries also come with charge current and voltage ratings
and these ratings vary depending on its capacity and the technology
used.

This patch adds two new power supply properties
CONSTANT_CHARGE_CURRENT_MAX and CONSTANT_CHARGE_CURRENT_MAX.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-08-22 21:59:15 -07:00
Ramakrishna Pallala b1b56872be power_supply: Add new power supply AUTHENTIC property
It is possible that users can use non-standard chargers or use invalid
batteries especially with mobile devices.

This patch adds a new power supply property called 'AUTHENTIC' to
indicate this to the user(user space).

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-08-22 19:56:37 -07:00
Ramakrishna Pallala e908c41806 power_supply: Add min/max alert properties for CAPACITY, TEMP, TEMP_AMBIENT
Minimum and maximum alerts on power supply properties will help or allow
the user space to "proactively" create policies like connect/disconnect
charger or stop/start the user apps based on capacity or temperature
parameters.

These parameters can be used to avoid unnecessary polling from user space
and even from kernel space if the underlying HW can support INT triggers
(ex: max17042/47).

This patch adds the following power supply alert type properties:

 CAPACITY_ALERT_MIN
 CAPACITY_ALERT_MAX
 TEMP_ALERT_MIN
 TEMP_ALERT_MAX
 TEMP_AMBIENT_ALERT_MIN
 TEMP_AMBIENT_ALERT_MAX

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-07-13 20:41:58 -07:00
Ramakrishna Pallala 3824c47714 power_supply: Add constant charge_current and charge_voltage properties
Constant Charge Current(CC) is charging parameter which limit the
maximum current which can be pumped into the battery during charge cycle.

Constant Charge Voltage(CV) is also charging parameter which limit the
maximum voltage that battery can reach during charge cycle.

It is very common practice that at low or high temperatures we
do not charge the batteries upto it's fullest charge voltage
to avoid battery and user safety issues.

These sysfs properties will be useful for debug and to implement
certain user space policies like "Charging limited due to OverTemp".

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-06-19 16:46:58 -07:00
Ramakrishna Pallala a2ebfe2fc6 power_supply: Add voltage_ocv property and use it for max17042 driver
This adds a new sysfs file called 'voltage_ocv' which gives the
Open Circuit Voltage of the battery.

This property can be used for platform shutdown policies and
can be useful for initial capacity estimations.

Note: This patch is generated against linux-next branch.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-04 20:44:29 -07:00
Andres Salomon ee8076ed3e power_supply: Add a charge_type property, and use it for olpc driver
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 <dilinger@collabora.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2009-07-02 18:14:37 +04:00
Andres Salomon b294a290d2 Revert "power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL"
This reverts commit 8efe444038 and
4cbc76eadf.

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 <dilinger@collabora.co.uk>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2009-07-01 02:44:03 +04:00
Andres Salomon 8e552c36d9 power_supply: add CHARGE_COUNTER property and olpc_battery support for it
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 <dilinger@debian.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2008-05-13 12:27:11 +04:00
Randy Dunlap 53471121a8 documentation: Move power-related files to Documentation/power/
Move 00-INDEX entries to power/00-INDEX (and add entry for
pm_qos_interface.txt).

Update references to moved filenames.

Fix some trailing whitespace.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-12 18:10:51 -04:00