diff mbox series

[1/2] dt-bindings: power: Extend battery bindings with type

Message ID 20210627234515.3057935-1-linus.walleij@linaro.org
State Superseded
Headers show
Series [1/2] dt-bindings: power: Extend battery bindings with type | expand

Commit Message

Linus Walleij June 27, 2021, 11:45 p.m. UTC
This adds a battery-type property and bindings for the different
"technologies" that are used in Linux. More types can be added.

This is needed to convert the custom ST-Ericsson AB8500 battery
properties over to the generic battery bindings.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
I need a bunch of new bindings for switch the STE AB8500 custom
bindings out, but I need to start somewhere, this is as good as
any place to start.
---
 .../devicetree/bindings/power/supply/battery.yaml  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

-- 
2.31.1

Comments

Sebastian Reichel July 16, 2021, 2:09 p.m. UTC | #1
Hi,

On Mon, Jun 28, 2021 at 01:45:14AM +0200, Linus Walleij wrote:
> This adds a battery-type property and bindings for the different

> "technologies" that are used in Linux. More types can be added.


Makes sense to have this.

> This is needed to convert the custom ST-Ericsson AB8500 battery

> properties over to the generic battery bindings.


Great :)

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

> ---

> I need a bunch of new bindings for switch the STE AB8500 custom

> bindings out, but I need to start somewhere, this is as good as

> any place to start.

> ---

>  .../devicetree/bindings/power/supply/battery.yaml  | 14 ++++++++++++++


This should be CC'd to Rob Herring.

>  1 file changed, 14 insertions(+)

> 

> diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml

> index c3b4b7543591..3561ae2c1d58 100644

> --- a/Documentation/devicetree/bindings/power/supply/battery.yaml

> +++ b/Documentation/devicetree/bindings/power/supply/battery.yaml

> @@ -31,6 +31,20 @@ properties:

>    compatible:

>      const: simple-battery

>  

> +  battery-type:


The smart battery standard names the property storing this information
"DeviceChemistry", which (as a non-native speaker) seems like a
better fitting name. Thoughts?

> +    description: This describes the chemical technology of the battery.

> +    oneOf:

> +      - const: nickel-cadmium

> +      - const: nickel-metal-hydride

> +      - const: lithium-ion

> +        description: This is a blanket type for all lithium-ion batteries,

> +          including those below. If possible, a precise compatible string

> +          from below should be used, but sometimes it is unknown which specific

> +          lithium ion battery is employed and this wide compatible can be used.

> +      - const: lithium-ion-polymer

> +      - const: lithium-ion-iron-phosphate

> +      - const: lithium-ion-manganese-oxide


The values look good to me.

-- Sebastian

>    over-voltage-threshold-microvolt:

>      description: battery over-voltage limit

>  

> -- 

> 2.31.1

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml
index c3b4b7543591..3561ae2c1d58 100644
--- a/Documentation/devicetree/bindings/power/supply/battery.yaml
+++ b/Documentation/devicetree/bindings/power/supply/battery.yaml
@@ -31,6 +31,20 @@  properties:
   compatible:
     const: simple-battery
 
+  battery-type:
+    description: This describes the chemical technology of the battery.
+    oneOf:
+      - const: nickel-cadmium
+      - const: nickel-metal-hydride
+      - const: lithium-ion
+        description: This is a blanket type for all lithium-ion batteries,
+          including those below. If possible, a precise compatible string
+          from below should be used, but sometimes it is unknown which specific
+          lithium ion battery is employed and this wide compatible can be used.
+      - const: lithium-ion-polymer
+      - const: lithium-ion-iron-phosphate
+      - const: lithium-ion-manganese-oxide
+
   over-voltage-threshold-microvolt:
     description: battery over-voltage limit