xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/ti,lp8727.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
22eb4d8dcSEmmanuel Vadot%YAML 1.2
32eb4d8dcSEmmanuel Vadot---
42eb4d8dcSEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/ti,lp8727.yaml#
52eb4d8dcSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
62eb4d8dcSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: TI/National Semiconductor LP8727 Charger
82eb4d8dcSEmmanuel Vadot
92eb4d8dcSEmmanuel Vadotmaintainers:
102eb4d8dcSEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
112eb4d8dcSEmmanuel Vadot
122eb4d8dcSEmmanuel VadotallOf:
132eb4d8dcSEmmanuel Vadot  - $ref: power-supply.yaml#
142eb4d8dcSEmmanuel Vadot
152eb4d8dcSEmmanuel Vadotproperties:
162eb4d8dcSEmmanuel Vadot  compatible:
172eb4d8dcSEmmanuel Vadot    const: ti,lp8727
182eb4d8dcSEmmanuel Vadot
192eb4d8dcSEmmanuel Vadot  reg:
202eb4d8dcSEmmanuel Vadot    const: 0x27
212eb4d8dcSEmmanuel Vadot
222eb4d8dcSEmmanuel Vadot  interrupts:
232eb4d8dcSEmmanuel Vadot    maxItems: 1
242eb4d8dcSEmmanuel Vadot
252eb4d8dcSEmmanuel Vadot  debounce-ms:
262eb4d8dcSEmmanuel Vadot    description: interrupt debounce time in ms
272eb4d8dcSEmmanuel Vadot
282eb4d8dcSEmmanuel VadotpatternProperties:
292eb4d8dcSEmmanuel Vadot  '^(ac|usb)$':
302eb4d8dcSEmmanuel Vadot    type: object
31*fac71e4eSEmmanuel Vadot    additionalProperties: false
322eb4d8dcSEmmanuel Vadot    description: USB/AC charging parameters
332eb4d8dcSEmmanuel Vadot    properties:
342eb4d8dcSEmmanuel Vadot      charger-type:
352eb4d8dcSEmmanuel Vadot        enum:
362eb4d8dcSEmmanuel Vadot          - ac
372eb4d8dcSEmmanuel Vadot          - usb
382eb4d8dcSEmmanuel Vadot
392eb4d8dcSEmmanuel Vadot      eoc-level:
402eb4d8dcSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint8
412eb4d8dcSEmmanuel Vadot        minimum: 0
422eb4d8dcSEmmanuel Vadot        maximum: 6
432eb4d8dcSEmmanuel Vadot        description: |
442eb4d8dcSEmmanuel Vadot          End of Charge Percentage with the following mapping:
452eb4d8dcSEmmanuel Vadot          0 = 5%, 1 = 10%, 2 = 16%, 3 = 20%, 4 = 25%, 5 = 33%, 6 = 50%
462eb4d8dcSEmmanuel Vadot
472eb4d8dcSEmmanuel Vadot      charging-current:
482eb4d8dcSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint8
492eb4d8dcSEmmanuel Vadot        minimum: 0
502eb4d8dcSEmmanuel Vadot        maximum: 9
512eb4d8dcSEmmanuel Vadot        description: |
522eb4d8dcSEmmanuel Vadot          Charging current with the following mapping:
532eb4d8dcSEmmanuel Vadot          0 = 90mA, 1 = 100mA, 2 = 400mA, 3 = 450mA, 4 = 500mA, 5 = 600mA,
542eb4d8dcSEmmanuel Vadot          6 = 700mA, 7 = 800mA, 8 = 900mA, 9 = 1000mA
552eb4d8dcSEmmanuel Vadot
562eb4d8dcSEmmanuel Vadotrequired:
572eb4d8dcSEmmanuel Vadot  - compatible
582eb4d8dcSEmmanuel Vadot  - reg
592eb4d8dcSEmmanuel Vadot
602eb4d8dcSEmmanuel VadotadditionalProperties: false
612eb4d8dcSEmmanuel Vadot
622eb4d8dcSEmmanuel Vadotexamples:
632eb4d8dcSEmmanuel Vadot  - |
642eb4d8dcSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
65*fac71e4eSEmmanuel Vadot    i2c {
662eb4d8dcSEmmanuel Vadot      #address-cells = <1>;
672eb4d8dcSEmmanuel Vadot      #size-cells = <0>;
682eb4d8dcSEmmanuel Vadot
692eb4d8dcSEmmanuel Vadot      lp8727: charger@27 {
702eb4d8dcSEmmanuel Vadot        compatible = "ti,lp8727";
712eb4d8dcSEmmanuel Vadot        reg = <0x27>;
722eb4d8dcSEmmanuel Vadot        interrupt-parent = <&gpio5>;
732eb4d8dcSEmmanuel Vadot        interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
742eb4d8dcSEmmanuel Vadot        debounce-ms = <300>;
752eb4d8dcSEmmanuel Vadot
762eb4d8dcSEmmanuel Vadot        /* AC charger: 5% EOC and 500mA charging current */
772eb4d8dcSEmmanuel Vadot        ac {
782eb4d8dcSEmmanuel Vadot          charger-type = "ac";
792eb4d8dcSEmmanuel Vadot          eoc-level = /bits/ 8 <0>;
802eb4d8dcSEmmanuel Vadot          charging-current = /bits/ 8 <4>;
812eb4d8dcSEmmanuel Vadot        };
822eb4d8dcSEmmanuel Vadot
832eb4d8dcSEmmanuel Vadot        /* USB charger: 10% EOC and 400mA charging current */
842eb4d8dcSEmmanuel Vadot        usb {
852eb4d8dcSEmmanuel Vadot          charger-type = "usb";
862eb4d8dcSEmmanuel Vadot          eoc-level = /bits/ 8 <1>;
872eb4d8dcSEmmanuel Vadot          charging-current = /bits/ 8 <2>;
882eb4d8dcSEmmanuel Vadot        };
892eb4d8dcSEmmanuel Vadot      };
902eb4d8dcSEmmanuel Vadot    };
91