summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.yaml
blob: 72e8f274c791d70463836ec79aac857c67a6b5fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/sbs,sbs-manager.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SBS compliant manger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - lltc,ltc1760
          - enum:
              - sbs,sbs-manager
      - items:
          - const: sbs,sbs-manager

  reg:
    const: 0xa

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  gpio-controller: true

  "#gpio-cells":
    const: 2

required:
  - compatible
  - reg

additionalProperties: false

patternProperties:
  "^i2c@[1-4]$":
    type: object

    allOf:
      - $ref: /schemas/i2c/i2c-controller.yaml#

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/gpio/gpio.h>

    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      batman: battery-manager@a {
        compatible = "lltc,ltc1760", "sbs,sbs-manager";
        reg = <0x0a>;
        #address-cells = <1>;
        #size-cells = <0>;

        gpio-controller;
        #gpio-cells = <2>;

        i2c@1 {
          #address-cells = <1>;
          #size-cells = <0>;
          reg = <1>;

          battery@b {
            compatible = "ti,bq20z65", "sbs,sbs-battery";
            reg = <0x0b>;
            sbs,battery-detect-gpios = <&batman 1 1>;
          };
        };

        i2c@2 {
          #address-cells = <1>;
          #size-cells = <0>;
          reg = <2>;

          battery@b {
            compatible = "ti,bq20z65", "sbs,sbs-battery";
            reg = <0x0b>;
            sbs,battery-detect-gpios = <&batman 2 1>;
          };
        };

        i2c@3 {
          #address-cells = <1>;
          #size-cells = <0>;
          reg = <3>;

          battery@b {
            compatible = "ti,bq20z65", "sbs,sbs-battery";
            reg = <0x0b>;
            sbs,battery-detect-gpios = <&batman 3 1>;
          };
        };
      };
    };