1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/supply/ti,lp8727.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: TI/National Semiconductor LP8727 Charger
8
9maintainers:
10  - Sebastian Reichel <sre@kernel.org>
11
12allOf:
13  - $ref: power-supply.yaml#
14
15properties:
16  compatible:
17    const: ti,lp8727
18
19  reg:
20    const: 0x27
21
22  interrupts:
23    maxItems: 1
24
25  debounce-ms:
26    description: interrupt debounce time in ms
27
28patternProperties:
29  '^(ac|usb)$':
30    type: object
31    additionalProperties: false
32    description: USB/AC charging parameters
33    properties:
34      charger-type:
35        enum:
36          - ac
37          - usb
38
39      eoc-level:
40        $ref: /schemas/types.yaml#/definitions/uint8
41        minimum: 0
42        maximum: 6
43        description: |
44          End of Charge Percentage with the following mapping:
45          0 = 5%, 1 = 10%, 2 = 16%, 3 = 20%, 4 = 25%, 5 = 33%, 6 = 50%
46
47      charging-current:
48        $ref: /schemas/types.yaml#/definitions/uint8
49        minimum: 0
50        maximum: 9
51        description: |
52          Charging current with the following mapping:
53          0 = 90mA, 1 = 100mA, 2 = 400mA, 3 = 450mA, 4 = 500mA, 5 = 600mA,
54          6 = 700mA, 7 = 800mA, 8 = 900mA, 9 = 1000mA
55
56required:
57  - compatible
58  - reg
59
60additionalProperties: false
61
62examples:
63  - |
64    #include <dt-bindings/interrupt-controller/irq.h>
65    i2c {
66      #address-cells = <1>;
67      #size-cells = <0>;
68
69      lp8727: charger@27 {
70        compatible = "ti,lp8727";
71        reg = <0x27>;
72        interrupt-parent = <&gpio5>;
73        interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
74        debounce-ms = <300>;
75
76        /* AC charger: 5% EOC and 500mA charging current */
77        ac {
78          charger-type = "ac";
79          eoc-level = /bits/ 8 <0>;
80          charging-current = /bits/ 8 <4>;
81        };
82
83        /* USB charger: 10% EOC and 400mA charging current */
84        usb {
85          charger-type = "usb";
86          eoc-level = /bits/ 8 <1>;
87          charging-current = /bits/ 8 <2>;
88        };
89      };
90    };
91