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: Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org,
	Matt Ranostay <matt@ranostay.consulting>,
	Liam Breck <kernel@networkimprov.net>
Subject: [PATCH v13 02/11] dt-bindings: power: supply: Add battery.txt with simple-battery binding
Date: Wed,  3 May 2017 23:18:02 -0700	[thread overview]
Message-ID: <20170504061811.18107-3-liam@networkimprov.net> (raw)
In-Reply-To: <20170504061811.18107-1-liam@networkimprov.net>

From: Liam Breck <kernel@networkimprov.net>

Documentation of static battery characteristics that can be defined
for batteries that do not embed this data, which are required by
fuel-gauge and charger chips for proper handling of the battery.

The following properties are defined:
  voltage-min-design-microvolt
  charge-full-design-microamp-hours
  energy-full-design-microwatt-hours
  precharge-current-microamp
  charge-term-current-microamp

Property names are derived from corresponding elements in
enum power_supply_property from include/linux/power_supply.h
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/power_supply.h

Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/power/supply/battery.txt   | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/battery.txt

diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt
new file mode 100644
index 0000000..61d9153
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/battery.txt
@@ -0,0 +1,53 @@
+Battery Characteristics
+
+The devicetree battery node provides static battery characteristics.
+In smart batteries, these are typically stored in non-volatile memory
+on a fuel gauge chip. The battery node should be used where there is
+no appropriate non-volatile memory, or it is unprogrammed/incorrect.
+
+Upstream dts files should not include battery nodes, unless the battery
+represented cannot easily be replaced in the system by one of a
+different type. This prevents unpredictable, potentially harmful,
+behavior should a replacement that changes the battery type occur
+without a corresponding update to the dtb.
+
+Required Properties:
+ - compatible: Must be "simple-battery"
+
+Optional Properties:
+ - voltage-min-design-microvolt: drained battery voltage
+ - energy-full-design-microwatt-hours: battery design energy
+ - charge-full-design-microamp-hours: battery design capacity
+ - precharge-current-microamp: current for pre-charge phase
+ - charge-term-current-microamp: current for charge termination phase
+
+Battery properties are named, where possible, for the corresponding
+elements in enum power_supply_property, defined in
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/power_supply.h
+
+Batteries must be referenced by chargers and/or fuel-gauges
+using a phandle. The phandle's property should be named
+"monitored-battery".
+
+Example:
+
+	bat: battery {
+		compatible = "simple-battery";
+		voltage-min-design-microvolt = <3200000>;
+		energy-full-design-microwatt-hours = <5290000>;
+		charge-full-design-microamp-hours = <1430000>;
+		precharge-current-microamp = <256000>;
+		charge-term-current-microamp = <128000>;
+	};
+
+	charger: charger@11 {
+		....
+		monitored-battery = <&bat>;
+		...
+	};
+
+	fuel_gauge: fuel-gauge@22 {
+		....
+		monitored-battery = <&bat>;
+		...
+	};
-- 
2.9.3

  parent reply	other threads:[~2017-05-04  6:18 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 ` Liam Breck [this message]
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 ` [PATCH v13 04/11] power: supply: core: Add power_supply_prop_precharge Liam Breck
     [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-3-liam@networkimprov.net \
    --to=liam@networkimprov.net \
    --cc=afd@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@networkimprov.net \
    --cc=linux-pm@vger.kernel.org \
    --cc=matt@ranostay.consulting \
    --cc=robh@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.