diff options
author | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-31 15:50:47 +0100 |
---|---|---|
committer | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-31 17:29:01 +0100 |
commit | 63fecb5d5440c096674b19e5a04112fb6756d5ee (patch) | |
tree | 96e409acb33be32355289941d54ff4937a0dcc72 /include | |
parent | 4bd285c57296e1165013c4ff43436693721e40b3 (diff) |
ccxmx51: mc13892, add capacity calculation to battery driver.
Add a basic voltage based capacity calculation to the driver. It uses
static charge and discharge lookup tables for 25 celsius, characterized
for a hopefully generic Li-Ion battery.
This simple implementation disregards temperature and age, and it also
does not include hysteresis algorithms so the capacity may vary upon
charger connection and disconnection.
User space can still implement better algorithms using the information
provided in the sysfs.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
(cherry picked from commit 35fea3d126c91a4f25d9269ad58dc8a1c52fcd1f)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pmic_battery.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/pmic_battery.h b/include/linux/pmic_battery.h index 4f719e44d074..215cfa45d0c2 100644 --- a/include/linux/pmic_battery.h +++ b/include/linux/pmic_battery.h @@ -414,6 +414,59 @@ PMIC_STATUS pmic_batt_event_subscribe(t_batt_event event, void *callback); */ PMIC_STATUS pmic_batt_event_unsubscribe(t_batt_event event, void *callback); +/* Battery characterization look up table @ 25 celsius for Li-Ion battery. */ + +/* Battery discharge voltage level (mV) */ +#define VDISCHARGE_5 3320 +#define VDISCHARGE_10 3430 +#define VDISCHARGE_15 3510 +#define VDISCHARGE_20 3580 +#define VDISCHARGE_25 3610 +#define VDISCHARGE_30 3640 +#define VDISCHARGE_35 3670 +#define VDISCHARGE_40 3690 +#define VDISCHARGE_45 3720 +#define VDISCHARGE_50 3740 +#define VDISCHARGE_55 3760 +#define VDISCHARGE_60 3780 +#define VDISCHARGE_65 3800 +#define VDISCHARGE_70 3830 +#define VDISCHARGE_75 3860 +#define VDISCHARGE_80 3890 +#define VDISCHARGE_85 3920 +#define VDISCHARGE_90 3960 +#define VDISCHARGE_95 4010 +#define VDISCHARGE_100 4070 + + +/* Battery charge voltage level (mV) */ +#define VCHARGE_5 3320 +#define VCHARGE_10 3430 +#define VCHARGE_15 3510 +#define VCHARGE_20 3580 +#define VCHARGE_25 3610 +#define VCHARGE_30 3640 +#define VCHARGE_35 3670 +#define VCHARGE_40 3690 +#define VCHARGE_45 3720 +#define VCHARGE_50 3740 +#define VCHARGE_55 3760 +#define VCHARGE_60 3780 +#define VCHARGE_65 3800 +#define VCHARGE_70 3830 +#define VCHARGE_75 3860 +#define VCHARGE_80 3890 +#define VCHARGE_85 3920 +#define VCHARGE_90 3960 +#define VCHARGE_95 4010 +#define VCHARGE_100 4070 + +#define CAPACITY_LIMIT_HIGH 85 +#define CAPACITY_LIMIT_LOW 25 +#define CAPACITY_LIMIT_FULL 100 + +#define BATTERY_TYPE POWER_SUPPLY_TECHNOLOGY_LION + #endif /* __KERNEL__ */ #endif /* __ASM_ARCH_MXC_PMIC_BATTERY_H__ */ |