From: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
To: linux-kernel@vger.kernel.org
Cc: Anton Vorontsov <cbouatmailru@gmail.com>,
Anton Vorontsov <anton.vorontsov@linaro.org>,
Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Subject: [PATCH] power_supply: Add charge_rate_limit power supply attribute
Date: Wed, 20 Jun 2012 13:38:03 +0530 [thread overview]
Message-ID: <1340179683-6548-1-git-send-email-ramakrishna.pallala@intel.com> (raw)
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
next reply other threads:[~2012-06-20 9:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 8:08 Ramakrishna Pallala [this message]
2012-06-20 9:59 ` Pallala, Ramakrishna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340179683-6548-1-git-send-email-ramakrishna.pallala@intel.com \
--to=ramakrishna.pallala@intel.com \
--cc=anton.vorontsov@linaro.org \
--cc=cbouatmailru@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®