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