Skip to content

Commit 69a3761

Browse files
hardevsinh-1sre
authored andcommitted
dt-bindings: power: supply: Add STC3117 Fuel Gauge
The STC3117 provides a simple fuel gauge via I2C. Add a DT schema to describe how to set it up in the device tree. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Hardevsinh Palaniya <[email protected]> Signed-off-by: Bhavin Sharma <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent db9d8ec commit 69a3761

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/st,stc3117.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: STMicroelectronics STC3117 Fuel Gauge Unit Power Supply
8+
9+
maintainers:
10+
- Hardevsinh Palaniya <[email protected]>
11+
- Bhavin Sharma <[email protected]>
12+
13+
description: |
14+
The STC3117 includes the STMicroelectronics OptimGauge algorithm.
15+
It provides accurate battery state-of-charge (SOC) monitoring, tracks
16+
battery parameter changes with operation conditions, temperature,
17+
and aging, and allows the application to get a battery state-of-health
18+
(SOH) indication.
19+
20+
An alarm output signals low SOC or low voltage conditions and also
21+
indicates fault conditions like a missing or swapped battery.
22+
23+
Datasheet is available at
24+
https://www.st.com/resource/en/datasheet/stc3117.pdf
25+
26+
allOf:
27+
- $ref: power-supply.yaml#
28+
29+
properties:
30+
compatible:
31+
enum:
32+
- st,stc3117
33+
34+
reg:
35+
maxItems: 1
36+
37+
monitored-battery:
38+
description: |
39+
The fuel gauge uses the following battery properties:
40+
- charge-full-design-microamp-hours
41+
- voltage-min-design-microvolt
42+
- voltage-max-design-microvolt
43+
44+
shunt-resistor-micro-ohms:
45+
description: Current sense resistor
46+
47+
interrupts:
48+
maxItems: 1
49+
50+
required:
51+
- compatible
52+
- reg
53+
- monitored-battery
54+
- shunt-resistor-micro-ohms
55+
56+
unevaluatedProperties: false
57+
58+
examples:
59+
- |
60+
#include <dt-bindings/interrupt-controller/irq.h>
61+
62+
i2c {
63+
#address-cells = <1>;
64+
#size-cells = <0>;
65+
66+
battery@70 {
67+
compatible = "st,stc3117";
68+
reg = <0x70>;
69+
interrupt-parent = <&gpio0>;
70+
interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
71+
monitored-battery = <&bat>;
72+
shunt-resistor-micro-ohms = <10000>;
73+
};
74+
};

0 commit comments

Comments
 (0)