power_supply: Add charge_rate_limit power supply attribute
Subsystems (2)
PATCH 1/1 power_supply: Add charge_rate_limit power supply attribute
During charging battery temperature and charger chip(die) temperature will go up and this intern adds upto the overall platform temperature. On mobile devices this can have huge impact on the user(user experience).
This patch adds a new power supply property charge_rate_limit which can be used by user space app/framework(Ex: Thermal Manager) to control the overall platform temperature by changing the charge rate property.
--- Documentation/power/power_supply_class.txt | 4 ++++ drivers/power/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 8 ++++++++ 3 files changed, 13 insertions(+), 0 deletions(-)
Documentation/power/power_supply_class.txt +4 -0
@@ -116,6 +116,10 @@ CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger. CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger. +CHARGE_RATE_LIMIT - interface to limit or control the charge rate from +user space, values corresponds to POWER_SUPPLY_CHARGE_RATE_* as defined +in power_supply.h + ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. CAPACITY - capacity in percents.
drivers/power/power_supply_sysfs.c +1 -0
@@ -161,6 +161,7 @@ static struct device_attribute power_supply_attrs[] = {POWER_SUPPLY_ATTR (charge_counter),POWER_SUPPLY_ATTR (constant_charge_current),POWER_SUPPLY_ATTR (constant_charge_voltage), +POWER_SUPPLY_ATTR (charge_rate_limit),POWER_SUPPLY_ATTR (energy_full_design),POWER_SUPPLY_ATTR (energy_empty_design), POWER_SUPPLY_ATTR(energy_full),
include/linux/power_supply.h +8 -0
@@ -47,6 +47,13 @@ enum { };enum { +POWER_SUPPLY_CHARGE_RATE_LOW =0 , +POWER_SUPPLY_CHARGE_RATE_MEDIUM , +POWER_SUPPLY_CHARGE_RATE_HIGH , +POWER_SUPPLY_CHARGE_RATE_FULL , +}; + +enum {POWER_SUPPLY_HEALTH_UNKNOWN =0 ,POWER_SUPPLY_HEALTH_GOOD ,POWER_SUPPLY_HEALTH_OVERHEAT ,
@@ -111,6 +118,7 @@ enum power_supply_property {POWER_SUPPLY_PROP_CHARGE_COUNTER ,POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT ,POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE , +POWER_SUPPLY_PROP_CHARGE_RATE_LIMIT ,POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN ,POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN , POWER_SUPPLY_PROP_ENERGY_FULL,
Signature · 1 line
1.7.0.4
Quoted 13 lines
Sent: Wednesday, June 20, 2012 1:38 PM
To: [email protected]
Cc: Anton Vorontsov; Anton Vorontsov; Pallala, Ramakrishna
Subject: [PATCH]power_supply: Addcharge_rate_limitpower supply attributeDuring charging battery temperature and charger chip(die) temperature will go up and this intern adds upto the overall platform temperature.
On mobile devices this can have huge impact on the user(user experience).This patch adds a new power supply property
charge_rate_limitwhich can be used by user space app/framework(Ex: Thermal Manager) to control the overall platform temperature by changing the charge rate property.
Quoted 6 lines
Signed-off-by Ramakrishna Pallala <[email protected]>--- Documentation/power/power_supply_class.txt | 4 ++++ drivers/power/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 8 ++++++++ 3 files changed, 13 insertions(+), 0 deletions(-)
Please ignore this patch.
Thanks,
Ram