162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci# Copyright (C) 2021 Sebastian Reichel
362306a36Sopenharmony_ci%YAML 1.2
462306a36Sopenharmony_ci---
562306a36Sopenharmony_ci$id: http://devicetree.org/schemas/power/supply/bq24257.yaml#
662306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
762306a36Sopenharmony_ci
862306a36Sopenharmony_cititle: Bq24250, bq24251 and bq24257 Li-Ion Charger
962306a36Sopenharmony_ci
1062306a36Sopenharmony_cimaintainers:
1162306a36Sopenharmony_ci  - Sebastian Reichel <sre@kernel.org>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciallOf:
1462306a36Sopenharmony_ci  - $ref: power-supply.yaml#
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciproperties:
1762306a36Sopenharmony_ci  compatible:
1862306a36Sopenharmony_ci    enum:
1962306a36Sopenharmony_ci      - ti,bq24250
2062306a36Sopenharmony_ci      - ti,bq24251
2162306a36Sopenharmony_ci      - ti,bq24257
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci  reg:
2462306a36Sopenharmony_ci    maxItems: 1
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci  interrupts:
2762306a36Sopenharmony_ci    maxItems: 1
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci  ti,battery-regulation-voltage:
3062306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3162306a36Sopenharmony_ci    description: maximum charging voltage in uV
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci  ti,charge-current:
3462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3562306a36Sopenharmony_ci    description: maximum charging current in uA
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci  ti,termination-current:
3862306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3962306a36Sopenharmony_ci    description: |
4062306a36Sopenharmony_ci      charge will be terminated when current in constant-voltage phase
4162306a36Sopenharmony_ci      drops below this value (in uA)
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci  pg-gpios:
4462306a36Sopenharmony_ci    description: |
4562306a36Sopenharmony_ci      GPIO used for connecting the bq2425x device PG (Power Good) pin.
4662306a36Sopenharmony_ci      This pin is not available on all devices however it should be used if
4762306a36Sopenharmony_ci      possible as this is the recommended way to obtain the charger's input PG
4862306a36Sopenharmony_ci      state. If this pin is not specified a software-based approach for PG
4962306a36Sopenharmony_ci      detection is used.
5062306a36Sopenharmony_ci    maxItems: 1
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci  ti,current-limit:
5362306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
5462306a36Sopenharmony_ci    description: |
5562306a36Sopenharmony_ci      The maximum current to be drawn from the charger's input (in uA).
5662306a36Sopenharmony_ci      If this property is not specified, the input limit current is set
5762306a36Sopenharmony_ci      automatically using USB D+/D- signal based charger type detection.
5862306a36Sopenharmony_ci      If the hardware does not support the D+/D- based detection, a default
5962306a36Sopenharmony_ci      of 500,000 is used (=500mA) instead.
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci  ti,ovp-voltage:
6262306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
6362306a36Sopenharmony_ci    description: |
6462306a36Sopenharmony_ci      Configures the over voltage protection voltage (in uV).
6562306a36Sopenharmony_ci      If not specified a default of 6,5000,000 (=6.5V) is used.
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci  ti,in-dpm-voltage:
6862306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
6962306a36Sopenharmony_ci    description: |
7062306a36Sopenharmony_ci      Configures the threshold input voltage for the dynamic power path management (in uV).
7162306a36Sopenharmony_ci      If not specified a default of 4,360,000 (=4.36V) is used.
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_cirequired:
7462306a36Sopenharmony_ci  - compatible
7562306a36Sopenharmony_ci  - reg
7662306a36Sopenharmony_ci  - interrupts
7762306a36Sopenharmony_ci  - ti,battery-regulation-voltage
7862306a36Sopenharmony_ci  - ti,charge-current
7962306a36Sopenharmony_ci  - ti,termination-current
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ciadditionalProperties: false
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ciexamples:
8462306a36Sopenharmony_ci  - |
8562306a36Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
8662306a36Sopenharmony_ci    #include <dt-bindings/interrupt-controller/irq.h>
8762306a36Sopenharmony_ci    i2c {
8862306a36Sopenharmony_ci      #address-cells = <1>;
8962306a36Sopenharmony_ci      #size-cells = <0>;
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci      charger@6a {
9262306a36Sopenharmony_ci        compatible = "ti,bq24257";
9362306a36Sopenharmony_ci        reg = <0x6a>;
9462306a36Sopenharmony_ci        interrupt-parent = <&gpio1>;
9562306a36Sopenharmony_ci        interrupts = <16 IRQ_TYPE_EDGE_BOTH>;
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci        pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci        ti,battery-regulation-voltage = <4200000>;
10062306a36Sopenharmony_ci        ti,charge-current = <1000000>;
10162306a36Sopenharmony_ci        ti,termination-current = <50000>;
10262306a36Sopenharmony_ci      };
10362306a36Sopenharmony_ci    };
10462306a36Sopenharmony_ci  - |
10562306a36Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
10662306a36Sopenharmony_ci    #include <dt-bindings/interrupt-controller/irq.h>
10762306a36Sopenharmony_ci    i2c {
10862306a36Sopenharmony_ci      #address-cells = <1>;
10962306a36Sopenharmony_ci      #size-cells = <0>;
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci      charger@6a {
11262306a36Sopenharmony_ci        compatible = "ti,bq24250";
11362306a36Sopenharmony_ci        reg = <0x6a>;
11462306a36Sopenharmony_ci        interrupt-parent = <&gpio1>;
11562306a36Sopenharmony_ci        interrupts = <16 IRQ_TYPE_EDGE_BOTH>;
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci        ti,battery-regulation-voltage = <4200000>;
11862306a36Sopenharmony_ci        ti,charge-current = <500000>;
11962306a36Sopenharmony_ci        ti,termination-current = <50000>;
12062306a36Sopenharmony_ci        ti,current-limit = <900000>;
12162306a36Sopenharmony_ci        ti,ovp-voltage = <9500000>;
12262306a36Sopenharmony_ci        ti,in-dpm-voltage = <4440000>;
12362306a36Sopenharmony_ci      };
12462306a36Sopenharmony_ci    };
125