1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/supply/sbs,sbs-manager.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: SBS compliant manger
8
9maintainers:
10  - Sebastian Reichel <sre@kernel.org>
11
12allOf:
13  - $ref: power-supply.yaml#
14
15properties:
16  compatible:
17    oneOf:
18      - items:
19          - enum:
20              - lltc,ltc1760
21          - enum:
22              - sbs,sbs-manager
23      - items:
24          - const: sbs,sbs-manager
25
26  reg:
27    const: 0xa
28
29  "#address-cells":
30    const: 1
31
32  "#size-cells":
33    const: 0
34
35  gpio-controller: true
36
37  "#gpio-cells":
38    const: 2
39
40required:
41  - compatible
42  - reg
43
44additionalProperties: false
45
46patternProperties:
47  "^i2c@[1-4]$":
48    type: object
49
50    allOf:
51      - $ref: /schemas/i2c/i2c-controller.yaml#
52
53examples:
54  - |
55    #include <dt-bindings/interrupt-controller/irq.h>
56    #include <dt-bindings/gpio/gpio.h>
57
58    i2c {
59      #address-cells = <1>;
60      #size-cells = <0>;
61
62      batman: battery-manager@a {
63        compatible = "lltc,ltc1760", "sbs,sbs-manager";
64        reg = <0x0a>;
65        #address-cells = <1>;
66        #size-cells = <0>;
67
68        gpio-controller;
69        #gpio-cells = <2>;
70
71        i2c@1 {
72          #address-cells = <1>;
73          #size-cells = <0>;
74          reg = <1>;
75
76          battery@b {
77            compatible = "ti,bq20z65", "sbs,sbs-battery";
78            reg = <0x0b>;
79            sbs,battery-detect-gpios = <&batman 1 1>;
80          };
81        };
82
83        i2c@2 {
84          #address-cells = <1>;
85          #size-cells = <0>;
86          reg = <2>;
87
88          battery@b {
89            compatible = "ti,bq20z65", "sbs,sbs-battery";
90            reg = <0x0b>;
91            sbs,battery-detect-gpios = <&batman 2 1>;
92          };
93        };
94
95        i2c@3 {
96          #address-cells = <1>;
97          #size-cells = <0>;
98          reg = <3>;
99
100          battery@b {
101            compatible = "ti,bq20z65", "sbs,sbs-battery";
102            reg = <0x0b>;
103            sbs,battery-detect-gpios = <&batman 3 1>;
104          };
105        };
106      };
107    };
108