xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/bq24257.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
22eb4d8dcSEmmanuel Vadot# Copyright (C) 2021 Sebastian Reichel
32eb4d8dcSEmmanuel Vadot%YAML 1.2
42eb4d8dcSEmmanuel Vadot---
5b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/bq24257.yaml#
6b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
72eb4d8dcSEmmanuel Vadot
88bab661aSEmmanuel Vadottitle: Bq24250, bq24251 and bq24257 Li-Ion Charger
92eb4d8dcSEmmanuel Vadot
102eb4d8dcSEmmanuel Vadotmaintainers:
112eb4d8dcSEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
122eb4d8dcSEmmanuel Vadot
132eb4d8dcSEmmanuel VadotallOf:
142eb4d8dcSEmmanuel Vadot  - $ref: power-supply.yaml#
152eb4d8dcSEmmanuel Vadot
162eb4d8dcSEmmanuel Vadotproperties:
172eb4d8dcSEmmanuel Vadot  compatible:
182eb4d8dcSEmmanuel Vadot    enum:
192eb4d8dcSEmmanuel Vadot      - ti,bq24250
202eb4d8dcSEmmanuel Vadot      - ti,bq24251
212eb4d8dcSEmmanuel Vadot      - ti,bq24257
222eb4d8dcSEmmanuel Vadot
232eb4d8dcSEmmanuel Vadot  reg:
242eb4d8dcSEmmanuel Vadot    maxItems: 1
252eb4d8dcSEmmanuel Vadot
262eb4d8dcSEmmanuel Vadot  interrupts:
272eb4d8dcSEmmanuel Vadot    maxItems: 1
282eb4d8dcSEmmanuel Vadot
292eb4d8dcSEmmanuel Vadot  ti,battery-regulation-voltage:
302eb4d8dcSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
312eb4d8dcSEmmanuel Vadot    description: maximum charging voltage in uV
322eb4d8dcSEmmanuel Vadot
332eb4d8dcSEmmanuel Vadot  ti,charge-current:
342eb4d8dcSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
352eb4d8dcSEmmanuel Vadot    description: maximum charging current in uA
362eb4d8dcSEmmanuel Vadot
372eb4d8dcSEmmanuel Vadot  ti,termination-current:
382eb4d8dcSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
392eb4d8dcSEmmanuel Vadot    description: |
402eb4d8dcSEmmanuel Vadot      charge will be terminated when current in constant-voltage phase
412eb4d8dcSEmmanuel Vadot      drops below this value (in uA)
422eb4d8dcSEmmanuel Vadot
432eb4d8dcSEmmanuel Vadot  pg-gpios:
442eb4d8dcSEmmanuel Vadot    description: |
452eb4d8dcSEmmanuel Vadot      GPIO used for connecting the bq2425x device PG (Power Good) pin.
462eb4d8dcSEmmanuel Vadot      This pin is not available on all devices however it should be used if
472eb4d8dcSEmmanuel Vadot      possible as this is the recommended way to obtain the charger's input PG
482eb4d8dcSEmmanuel Vadot      state. If this pin is not specified a software-based approach for PG
492eb4d8dcSEmmanuel Vadot      detection is used.
502eb4d8dcSEmmanuel Vadot    maxItems: 1
512eb4d8dcSEmmanuel Vadot
522eb4d8dcSEmmanuel Vadot  ti,current-limit:
532eb4d8dcSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
542eb4d8dcSEmmanuel Vadot    description: |
552eb4d8dcSEmmanuel Vadot      The maximum current to be drawn from the charger's input (in uA).
562eb4d8dcSEmmanuel Vadot      If this property is not specified, the input limit current is set
572eb4d8dcSEmmanuel Vadot      automatically using USB D+/D- signal based charger type detection.
582eb4d8dcSEmmanuel Vadot      If the hardware does not support the D+/D- based detection, a default
592eb4d8dcSEmmanuel Vadot      of 500,000 is used (=500mA) instead.
602eb4d8dcSEmmanuel Vadot
612eb4d8dcSEmmanuel Vadot  ti,ovp-voltage:
622eb4d8dcSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
632eb4d8dcSEmmanuel Vadot    description: |
642eb4d8dcSEmmanuel Vadot      Configures the over voltage protection voltage (in uV).
652eb4d8dcSEmmanuel Vadot      If not specified a default of 6,5000,000 (=6.5V) is used.
662eb4d8dcSEmmanuel Vadot
672eb4d8dcSEmmanuel Vadot  ti,in-dpm-voltage:
682eb4d8dcSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
692eb4d8dcSEmmanuel Vadot    description: |
702eb4d8dcSEmmanuel Vadot      Configures the threshold input voltage for the dynamic power path management (in uV).
712eb4d8dcSEmmanuel Vadot      If not specified a default of 4,360,000 (=4.36V) is used.
722eb4d8dcSEmmanuel Vadot
732eb4d8dcSEmmanuel Vadotrequired:
742eb4d8dcSEmmanuel Vadot  - compatible
752eb4d8dcSEmmanuel Vadot  - reg
762eb4d8dcSEmmanuel Vadot  - interrupts
772eb4d8dcSEmmanuel Vadot  - ti,battery-regulation-voltage
782eb4d8dcSEmmanuel Vadot  - ti,charge-current
792eb4d8dcSEmmanuel Vadot  - ti,termination-current
802eb4d8dcSEmmanuel Vadot
812eb4d8dcSEmmanuel VadotadditionalProperties: false
822eb4d8dcSEmmanuel Vadot
832eb4d8dcSEmmanuel Vadotexamples:
842eb4d8dcSEmmanuel Vadot  - |
852eb4d8dcSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
862eb4d8dcSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
87*fac71e4eSEmmanuel Vadot    i2c {
882eb4d8dcSEmmanuel Vadot      #address-cells = <1>;
892eb4d8dcSEmmanuel Vadot      #size-cells = <0>;
902eb4d8dcSEmmanuel Vadot
912eb4d8dcSEmmanuel Vadot      charger@6a {
922eb4d8dcSEmmanuel Vadot        compatible = "ti,bq24257";
932eb4d8dcSEmmanuel Vadot        reg = <0x6a>;
942eb4d8dcSEmmanuel Vadot        interrupt-parent = <&gpio1>;
952eb4d8dcSEmmanuel Vadot        interrupts = <16 IRQ_TYPE_EDGE_BOTH>;
962eb4d8dcSEmmanuel Vadot
972eb4d8dcSEmmanuel Vadot        pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
982eb4d8dcSEmmanuel Vadot
992eb4d8dcSEmmanuel Vadot        ti,battery-regulation-voltage = <4200000>;
1002eb4d8dcSEmmanuel Vadot        ti,charge-current = <1000000>;
1012eb4d8dcSEmmanuel Vadot        ti,termination-current = <50000>;
1022eb4d8dcSEmmanuel Vadot      };
1032eb4d8dcSEmmanuel Vadot    };
1042eb4d8dcSEmmanuel Vadot  - |
1052eb4d8dcSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1062eb4d8dcSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
107*fac71e4eSEmmanuel Vadot    i2c {
1082eb4d8dcSEmmanuel Vadot      #address-cells = <1>;
1092eb4d8dcSEmmanuel Vadot      #size-cells = <0>;
1102eb4d8dcSEmmanuel Vadot
1112eb4d8dcSEmmanuel Vadot      charger@6a {
1122eb4d8dcSEmmanuel Vadot        compatible = "ti,bq24250";
1132eb4d8dcSEmmanuel Vadot        reg = <0x6a>;
1142eb4d8dcSEmmanuel Vadot        interrupt-parent = <&gpio1>;
1152eb4d8dcSEmmanuel Vadot        interrupts = <16 IRQ_TYPE_EDGE_BOTH>;
1162eb4d8dcSEmmanuel Vadot
1172eb4d8dcSEmmanuel Vadot        ti,battery-regulation-voltage = <4200000>;
1182eb4d8dcSEmmanuel Vadot        ti,charge-current = <500000>;
1192eb4d8dcSEmmanuel Vadot        ti,termination-current = <50000>;
1202eb4d8dcSEmmanuel Vadot        ti,current-limit = <900000>;
1212eb4d8dcSEmmanuel Vadot        ti,ovp-voltage = <9500000>;
1222eb4d8dcSEmmanuel Vadot        ti,in-dpm-voltage = <4440000>;
1232eb4d8dcSEmmanuel Vadot      };
1242eb4d8dcSEmmanuel Vadot    };
125