mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] power_supply: Add charge_rate_limit power supply attribute
@ 2012-06-20  8:08 Ramakrishna Pallala
  2012-06-20  9:59 ` Pallala, Ramakrishna
  0 siblings, 1 reply; 2+ messages in thread
From: Ramakrishna Pallala @ 2012-06-20  8:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anton Vorontsov, Anton Vorontsov, Ramakrishna Pallala

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.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
---
 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(-)

diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index c0f62ae..8345f93 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -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.
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 58846d9..7e4272a 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -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),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 53f177d..b9993d4 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -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,
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] power_supply: Add charge_rate_limit power supply attribute
  2012-06-20  8:08 [PATCH] power_supply: Add charge_rate_limit power supply attribute Ramakrishna Pallala
@ 2012-06-20  9:59 ` Pallala, Ramakrishna
  0 siblings, 0 replies; 2+ messages in thread
From: Pallala, Ramakrishna @ 2012-06-20  9:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anton Vorontsov, Anton Vorontsov

> Sent: Wednesday, June 20, 2012 1:38 PM
> To: linux-kernel@vger.kernel.org
> Cc: Anton Vorontsov; Anton Vorontsov; Pallala, Ramakrishna
> Subject: [PATCH] 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.
> 
> Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-20  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20  8:08 [PATCH] power_supply: Add charge_rate_limit power supply attribute Ramakrishna Pallala
2012-06-20  9:59 ` Pallala, Ramakrishna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®