All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Breck <liam@networkimprov.net>
To: Sebastian Reichel <sre@kernel.org>,
	"Andrew F. Davis" <afd@ti.com>,
	linux-pm@vger.kernel.org
Cc: Liam Breck <kernel@networkimprov.net>
Subject: [PATCH v13 04/11] power: supply: core: Add power_supply_prop_precharge
Date: Wed,  3 May 2017 23:18:04 -0700	[thread overview]
Message-ID: <20170504061811.18107-5-liam@networkimprov.net> (raw)
In-Reply-To: <20170504061811.18107-1-liam@networkimprov.net>

From: Liam Breck <kernel@networkimprov.net>

Battery chargers use POWER_SUPPLY_PROP_PRECHARGE_CURRENT
Clarify related item POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT

Signed-off-by: Liam Breck <kernel@networkimprov.net>
---
 Documentation/power/power_supply_class.txt | 19 ++++++++++++-------
 drivers/power/supply/power_supply_sysfs.c  |  1 +
 include/linux/power_supply.h               |  3 +++
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index 01f0075..300d378 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -115,28 +115,33 @@ of charge when battery became full/empty". It also could mean "value of
 charge when battery considered full/empty at given conditions (temperature,
 age)". I.e. these attributes represents real thresholds, not design values.
 
+ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.
+
 CHARGE_COUNTER - the current charge counter (in µAh).  This could easily
 be negative; there is no empty or full value.  It is only useful for
 relative, time-based measurements.
 
+PRECHARGE_CURRENT - the maximum charge current during precharge phase
+of charge cycle (typically 20% of battery capacity).
+CHARGE_TERM_CURRENT - Charge termination current. The charge cycle
+terminates when battery voltage is above recharge threshold, and charge
+current is below this setting (typically 10% of battery capacity).
+
 CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger.
 CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the
 power supply object.
-INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates
-the current drawn from a charging source.
-CHARGE_TERM_CURRENT - Charge termination current used to detect the end of charge
-condition.
-
-CALIBRATE - battery or coulomb counter calibration status
 
 CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
 CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
 power supply object.
 
+INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates
+the current drawn from a charging source.
+
 CHARGE_CONTROL_LIMIT - current charge control limit setting
 CHARGE_CONTROL_LIMIT_MAX - maximum charge control limit setting
 
-ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.
+CALIBRATE - battery or coulomb counter calibration status
 
 CAPACITY - capacity in percents.
 CAPACITY_ALERT_MIN - minimum capacity alert value in percents.
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bcde8d1..937b03c 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -196,6 +196,7 @@ static struct device_attribute power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(time_to_full_avg),
 	POWER_SUPPLY_ATTR(type),
 	POWER_SUPPLY_ATTR(scope),
+	POWER_SUPPLY_ATTR(precharge_current),
 	POWER_SUPPLY_ATTR(charge_term_current),
 	POWER_SUPPLY_ATTR(calibrate),
 	/* Properties of type `const char *' */
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 67f363b..1a83f47 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -146,6 +146,7 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
 	POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
 	POWER_SUPPLY_PROP_SCOPE,
+	POWER_SUPPLY_PROP_PRECHARGE_CURRENT,
 	POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
 	POWER_SUPPLY_PROP_CALIBRATE,
 	/* Properties of type `const char *' */
@@ -379,6 +380,8 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_CHARGE_NOW:
 	case POWER_SUPPLY_PROP_CHARGE_AVG:
 	case POWER_SUPPLY_PROP_CHARGE_COUNTER:
+	case POWER_SUPPLY_PROP_PRECHARGE_CURRENT:
+	case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT:
 	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
 	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
 	case POWER_SUPPLY_PROP_CURRENT_MAX:
-- 
2.9.3

  parent reply	other threads:[~2017-05-04  6:19 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04  6:18 [PATCH v13 0/11] devicetree simple-battery and client in bq27xxx_battery Liam Breck
2017-05-04  6:18 ` [PATCH v13 01/11] devicetree: property-units: Add uWh and uAh units Liam Breck
2017-05-04  6:18   ` Liam Breck
2017-05-04  6:18 ` [PATCH v13 02/11] dt-bindings: power: supply: Add battery.txt with simple-battery binding Liam Breck
2017-05-04  6:18 ` [PATCH v13 03/11] power: supply: core: Add power_supply_battery_info and API Liam Breck
2017-05-04  6:18 ` Liam Breck [this message]
     [not found] ` <20170504061811.18107-1-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-05-04  6:18   ` [PATCH v13 05/11] dt-bindings: power: supply: bq27xxx: Add monitored-battery documentation Liam Breck
2017-05-04  6:18 ` [PATCH v13 06/11] power: supply: bq27xxx_battery: Add bulk transfer bus methods Liam Breck
2017-05-04  6:18 ` [PATCH v13 07/11] power: supply: bq27xxx_battery: Add chip data memory read/write support Liam Breck
2017-05-04 16:44   ` Andrew F. Davis
2017-05-04 18:07     ` Liam Breck
2017-05-05 12:45     ` Liam Breck
2017-05-05 15:40       ` Andrew F. Davis
2017-05-05 18:44         ` Liam Breck
2017-05-04  6:18 ` [PATCH v13 08/11] power: supply: bq27xxx_battery: Add power_supply_battery_info support Liam Breck
2017-05-04 16:52   ` Andrew F. Davis
2017-05-04 18:40     ` Liam Breck
2017-05-08  6:16       ` Liam Breck
2017-05-08 14:54         ` Andrew F. Davis
2017-05-08 18:39           ` Liam Breck
2017-05-08 18:42             ` Andrew F. Davis
2017-05-08 19:31               ` Liam Breck
2017-05-08 19:50                 ` Andrew F. Davis
2017-05-08 20:34                   ` Liam Breck
2017-05-09 16:06                     ` Andrew F. Davis
2017-05-04  6:18 ` [PATCH v13 09/11] power: supply: bq27xxx_battery: Enable data memory update for certain chips Liam Breck
2017-05-04 17:00   ` Andrew F. Davis
2017-05-04 19:12     ` Liam Breck
2017-05-05 19:31     ` Liam Breck
2017-05-05 19:45       ` Andrew F. Davis
2017-05-05 20:14         ` Liam Breck
2017-05-05 20:44           ` Andrew F. Davis
2017-05-05 20:55             ` Liam Breck
2017-05-05 21:04               ` Andrew F. Davis
2017-05-05 21:27                 ` Liam Breck
2017-05-05 21:29                   ` Andrew F. Davis
2017-05-05 21:38                     ` Liam Breck
2017-05-08  6:40         ` Liam Breck
2017-05-08 15:00           ` Andrew F. Davis
2017-05-08 19:02             ` Liam Breck
2017-05-08 19:09               ` Andrew F. Davis
2017-05-08 20:01                 ` Liam Breck
2017-05-09 16:20                   ` Andrew F. Davis
2017-05-10  9:16   ` Liam Breck
2017-05-04  6:18 ` [PATCH v13 10/11] power: supply: bq27xxx_battery: Flag identical register maps when in debug mode Liam Breck
2017-05-04 16:38   ` Andrew F. Davis
2017-05-08  6:18     ` Liam Breck
2017-05-08 15:01       ` Andrew F. Davis
2017-05-08 19:07         ` Liam Breck
2017-05-08 19:12           ` Andrew F. Davis
2017-05-08 20:08             ` Liam Breck
2017-05-04  6:18 ` [PATCH v13 11/11] power: supply: bq27xxx_battery: Remove duplicate register arrays Liam Breck

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=20170504061811.18107-5-liam@networkimprov.net \
    --to=liam@networkimprov.net \
    --cc=afd@ti.com \
    --cc=kernel@networkimprov.net \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.