mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jenny TC <jenny.tc@intel.com>
To: linux-kernel@vger.kernel.org,
	Anton Vorontsov <cbouatmailru@gmail.com>,
	Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Jenny TC <jenny.tc@intel.com>
Subject: [PATCH 3/7] power_supply: add throttle state
Date: Mon, 23 Sep 2013 23:34:01 +0530	[thread overview]
Message-ID: <1379959445-28207-4-git-send-email-jenny.tc@intel.com> (raw)
In-Reply-To: <1379959445-28207-1-git-send-email-jenny.tc@intel.com>

The charger and battery temperature contribute to the
platform thermal. The only way to control the temperature
is to control the charging. The charging can be controlled in different
way. This could be disabling charger, disabling charging, adjusting CC,
or by adjusting the INLMT. This patch adds a structure to define the
charger throttle actions. Also this patch adds a throttle_states
field to the struct power_supply which can be used by the charger
driver to define it's throttle actions for different states

Change-Id: I390a4c7479df4a7e17f73682802e4be05ea58541
Signed-off-by: Jenny TC <jenny.tc@intel.com>
---
 include/linux/power_supply.h |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index c3ce514a..e99c78d 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -210,6 +210,18 @@ union power_supply_propval {
 
 struct device_node;
 
+enum psy_throttle_action {
+
+	PSY_THROTTLE_DISABLE_CHARGER = 0,
+	PSY_THROTTLE_DISABLE_CHARGING,
+	PSY_THROTTLE_CC_LIMIT,
+	PSY_THROTTLE_INPUT_LIMIT,
+};
+
+struct psy_throttle_state {
+	enum psy_throttle_action throttle_action;
+	unsigned throttle_val;
+};
 struct power_supply {
 	const char *name;
 	enum power_supply_type type;
@@ -224,6 +236,9 @@ struct power_supply {
 	size_t num_supplies;
 	struct device_node *of_node;
 
+	struct psy_throttle_state *throttle_states;
+	size_t num_throttle_states;
+
 	int (*get_property)(struct power_supply *psy,
 			    enum power_supply_property psp,
 			    union power_supply_propval *val);
-- 
1.7.9.5


  parent reply	other threads:[~2013-09-23 10:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 18:03 [PATCH 0/7] power_supply: Introduce Power Supply Charging Framework Jenny TC
2013-09-23 18:03 ` [PATCH 1/7] power_supply: Add charger control properties Jenny TC
2013-10-27 23:46   ` Anton Vorontsov
2013-10-28  3:36     ` Tc, Jenny
2013-10-28  6:18       ` Anton Vorontsov
2013-10-29  4:57         ` NeilBrown
2013-09-23 18:04 ` [PATCH 2/7] power_supply : add charger cable properties Jenny TC
2013-09-23 18:04 ` Jenny TC [this message]
2013-09-23 18:04 ` [PATCH 4/7] power_supply: Add power_supply notifier Jenny TC
2013-09-23 18:04 ` [PATCH 5/7] power_supply : Introduce battery identification framework Jenny TC
2013-09-23 18:04 ` [PATCH 6/7] power_supply: Introduce Power Supply charging framework Jenny TC
2013-09-23 18:04 ` [PATCH 7/7] power_supply: Introduce PSE compliant algorithm Jenny TC
2013-10-28  6:17   ` Anton Vorontsov
2013-10-25 16:49 ` [PATCH 0/7] power_supply: Introduce Power Supply Charging Framework Tc, Jenny

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=1379959445-28207-4-git-send-email-jenny.tc@intel.com \
    --to=jenny.tc@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

Powered by JetHome