1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/supply/sbs,sbs-battery.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: SBS compliant battery
8
9maintainers:
10  - Sebastian Reichel <sre@kernel.org>
11
12description: |
13  Battery compatible with the smart battery system specifications
14
15properties:
16
17  compatible:
18    oneOf:
19      - items:
20          - enum:
21              - ti,bq20z65
22              - ti,bq20z75
23          - enum:
24              - sbs,sbs-battery
25      - items:
26          - const: sbs,sbs-battery
27
28  reg:
29    maxItems: 1
30
31  sbs,i2c-retry-count:
32    description:
33      The number of times to retry I2C transactions on I2C IO failure.
34    default: 0
35    $ref: /schemas/types.yaml#/definitions/uint32
36
37  sbs,poll-retry-count:
38    description:
39      The number of times to try looking for new status after an external
40      change notification.
41    default: 0
42    $ref: /schemas/types.yaml#/definitions/uint32
43
44  sbs,battery-detect-gpios:
45    description:
46      GPIO which signals battery detection. If this is not supplied, the bus
47      needs to be polled to detect the battery.
48    maxItems: 1
49
50  sbs,disable-charger-broadcasts:
51    description:
52      SBS batteries by default send broadcast messages to SBS compliant chargers to
53      configure max. charge current/voltage. If your hardware does not have an SBS
54      compliant charger it should be disabled via this property to avoid blocking
55      the bus. Also some SBS battery fuel gauges are known to have a buggy multi-
56      master implementation.
57    type: boolean
58
59required:
60  - compatible
61  - reg
62
63additionalProperties: false
64
65examples:
66  - |
67    #include <dt-bindings/gpio/gpio.h>
68
69    i2c {
70        #address-cells = <1>;
71        #size-cells = <0>;
72
73        battery@b {
74            compatible = "ti,bq20z75", "sbs,sbs-battery";
75            reg = <0xb>;
76            sbs,i2c-retry-count = <2>;
77            sbs,poll-retry-count = <10>;
78            sbs,battery-detect-gpios = <&gpio 122 GPIO_ACTIVE_HIGH>;
79            sbs,disable-charger-broadcasts;
80       };
81    };
82