162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/power/supply/rohm,bd99954.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: ROHM BD99954 Battery charger
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Matti Vaittinen <mazziesaccount@gmail.com>
1162306a36Sopenharmony_ci  - Markus Laine <markus.laine@fi.rohmeurope.com>
1262306a36Sopenharmony_ci  - Mikko Mutanen <mikko.mutanen@fi.rohmeurope.com>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_cidescription: |
1562306a36Sopenharmony_ci  The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion
1662306a36Sopenharmony_ci  secondary battery intended to be used in space-constraint equipment such
1762306a36Sopenharmony_ci  as Low profile Notebook PC, Tablets and other applications. BD99954
1862306a36Sopenharmony_ci  provides a Dual-source Battery Charger, two port BC1.2 detection and a
1962306a36Sopenharmony_ci  Battery Monitor.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci$ref: power-supply.yaml#
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciproperties:
2462306a36Sopenharmony_ci  compatible:
2562306a36Sopenharmony_ci    const: rohm,bd99954
2662306a36Sopenharmony_ci#
2762306a36Sopenharmony_ci#    The battery charging profile of BD99954.
2862306a36Sopenharmony_ci#
2962306a36Sopenharmony_ci#    Curve (1) represents charging current.
3062306a36Sopenharmony_ci#    Curve (2) represents battery voltage.
3162306a36Sopenharmony_ci#
3262306a36Sopenharmony_ci#    The BD99954 data sheet divides charging to three phases.
3362306a36Sopenharmony_ci#    a) Trickle-charge with constant current (8).
3462306a36Sopenharmony_ci#    b) pre-charge with constant current (6)
3562306a36Sopenharmony_ci#    c) fast-charge with:
3662306a36Sopenharmony_ci#       First a constant current (5) phase (CC)
3762306a36Sopenharmony_ci#       Then constant voltage (CV) phase (after the battery voltage has reached
3862306a36Sopenharmony_ci#       target level - until charging current has dropped to termination
3962306a36Sopenharmony_ci#       level (7)
4062306a36Sopenharmony_ci#
4162306a36Sopenharmony_ci#     V ^                                                        ^ I
4262306a36Sopenharmony_ci#       .                                                        .
4362306a36Sopenharmony_ci#       .                                                        .
4462306a36Sopenharmony_ci# (4)- -.- - - - - - - - - - - - - -  +++++++++++++++++++++++++++.
4562306a36Sopenharmony_ci#       .                            /                           .
4662306a36Sopenharmony_ci#       .                     ++++++/++ - - - - - - - - - - - - -.- - (5)
4762306a36Sopenharmony_ci#       .                     +    /  +                          .
4862306a36Sopenharmony_ci#       .                     +   -   --                         .
4962306a36Sopenharmony_ci#       .                     +  -     +                         .
5062306a36Sopenharmony_ci#       .                     +.-      -:                        .
5162306a36Sopenharmony_ci#       .                    .+         +`                       .
5262306a36Sopenharmony_ci#       .                  .- +       | `/                       .
5362306a36Sopenharmony_ci#       .               .."   +          .:                      .
5462306a36Sopenharmony_ci#       .             -"      +           --                     .
5562306a36Sopenharmony_ci#       .    (2)  ..."        +       |    :-                    .
5662306a36Sopenharmony_ci#       .    ...""            +             -:                   .
5762306a36Sopenharmony_ci# (3)- -.-.""- - - - -+++++++++ - - - - - - -.:- - - - - - - - - .- - (6)
5862306a36Sopenharmony_ci#       .             +                       `:.                .
5962306a36Sopenharmony_ci#       .             +               |         -:               .
6062306a36Sopenharmony_ci#       .             +                           -:             .
6162306a36Sopenharmony_ci#       .             +                             ..           .
6262306a36Sopenharmony_ci#       .   (1)       +               |               "+++- - - -.- - (7)
6362306a36Sopenharmony_ci#       -++++++++++++++- - - - - - - - - - - - - - - - - + - - - .- - (8)
6462306a36Sopenharmony_ci#       .                                                +       -
6562306a36Sopenharmony_ci#       -------------------------------------------------+++++++++-->
6662306a36Sopenharmony_ci#       |             |       |   CC   |      CV         |
6762306a36Sopenharmony_ci#       | --trickle-- | -pre- | ---------fast----------- |
6862306a36Sopenharmony_ci#
6962306a36Sopenharmony_ci#   The charger uses the following battery properties
7062306a36Sopenharmony_ci# - trickle-charge-current-microamp:
7162306a36Sopenharmony_ci#     Current used at trickle-charge phase (8 in above chart)
7262306a36Sopenharmony_ci#     minimum: 64000
7362306a36Sopenharmony_ci#     maximum: 1024000
7462306a36Sopenharmony_ci#     multipleOf: 64000
7562306a36Sopenharmony_ci# - precharge-current-microamp:
7662306a36Sopenharmony_ci#     Current used at pre-charge phase (6 in above chart)
7762306a36Sopenharmony_ci#     minimum: 64000
7862306a36Sopenharmony_ci#     maximum: 1024000
7962306a36Sopenharmony_ci#     multipleOf: 64000
8062306a36Sopenharmony_ci# - constant-charge-current-max-microamp
8162306a36Sopenharmony_ci#     Current used at fast charge constant current phase (5 in above chart)
8262306a36Sopenharmony_ci#     minimum: 64000
8362306a36Sopenharmony_ci#     maximum: 1024000
8462306a36Sopenharmony_ci#     multipleOf: 64000
8562306a36Sopenharmony_ci# - constant-charge-voltage-max-microvolt
8662306a36Sopenharmony_ci#     The constant voltage used in fast charging phase (4 in above chart)
8762306a36Sopenharmony_ci#     minimum: 2560000
8862306a36Sopenharmony_ci#     maximum: 19200000
8962306a36Sopenharmony_ci#     multipleOf: 16000
9062306a36Sopenharmony_ci# - precharge-upper-limit-microvolt
9162306a36Sopenharmony_ci#     charging mode is changed from trickle charging to pre-charging
9262306a36Sopenharmony_ci#     when battery voltage exceeds this limit voltage (3 in above chart)
9362306a36Sopenharmony_ci#     minimum: 2048000
9462306a36Sopenharmony_ci#     maximum: 19200000
9562306a36Sopenharmony_ci#     multipleOf: 64000
9662306a36Sopenharmony_ci# - re-charge-voltage-microvolt
9762306a36Sopenharmony_ci#     minimum: 2560000
9862306a36Sopenharmony_ci#     maximum: 19200000
9962306a36Sopenharmony_ci#     multipleOf: 16000
10062306a36Sopenharmony_ci#     re-charging is automatically started when battry has been discharging
10162306a36Sopenharmony_ci#     to the point where the battery voltage drops below this limit
10262306a36Sopenharmony_ci# - over-voltage-threshold-microvolt
10362306a36Sopenharmony_ci#     battery is expected to be faulty if battery voltage exceeds this limit.
10462306a36Sopenharmony_ci#     Charger will then enter to a "battery faulty" -state
10562306a36Sopenharmony_ci#     minimum: 2560000
10662306a36Sopenharmony_ci#     maximum: 19200000
10762306a36Sopenharmony_ci#     multipleOf: 16000
10862306a36Sopenharmony_ci# - charge-term-current-microamp
10962306a36Sopenharmony_ci#     minimum: 0
11062306a36Sopenharmony_ci#     maximum: 1024000
11162306a36Sopenharmony_ci#     multipleOf: 64000
11262306a36Sopenharmony_ci#     a charge cycle terminates when the battery voltage is above recharge
11362306a36Sopenharmony_ci#     threshold, and the current is below this setting (7 in above chart)
11462306a36Sopenharmony_ci#   See also Documentation/devicetree/bindings/power/supply/battery.yaml
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci  reg:
11762306a36Sopenharmony_ci    maxItems: 1
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci  interrupts:
12062306a36Sopenharmony_ci    maxItems: 1
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci  monitored-battery:
12362306a36Sopenharmony_ci    description:
12462306a36Sopenharmony_ci      phandle of battery characteristics devicetree node
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci  rohm,vsys-regulation-microvolt:
12762306a36Sopenharmony_ci    description: system specific lower limit for system voltage.
12862306a36Sopenharmony_ci    minimum: 2560000
12962306a36Sopenharmony_ci    maximum: 19200000
13062306a36Sopenharmony_ci    multipleOf: 64000
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci  rohm,vbus-input-current-limit-microamp:
13362306a36Sopenharmony_ci    description: system specific VBUS input current limit (in microamps).
13462306a36Sopenharmony_ci    minimum: 32000
13562306a36Sopenharmony_ci    maximum: 16352000
13662306a36Sopenharmony_ci    multipleOf: 32000
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci  rohm,vcc-input-current-limit-microamp:
13962306a36Sopenharmony_ci    description: system specific VCC/VACP input current limit (in microamps).
14062306a36Sopenharmony_ci    minimum: 32000
14162306a36Sopenharmony_ci    maximum: 16352000
14262306a36Sopenharmony_ci    multipleOf: 32000
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_cirequired:
14562306a36Sopenharmony_ci  - compatible
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ciadditionalProperties: false
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ciexamples:
15062306a36Sopenharmony_ci  - |
15162306a36Sopenharmony_ci    i2c {
15262306a36Sopenharmony_ci        #address-cells = <1>;
15362306a36Sopenharmony_ci        #size-cells = <0>;
15462306a36Sopenharmony_ci        charger@9 {
15562306a36Sopenharmony_ci            compatible = "rohm,bd99954";
15662306a36Sopenharmony_ci            monitored-battery = <&battery>;
15762306a36Sopenharmony_ci            reg = <0x9>;
15862306a36Sopenharmony_ci            interrupt-parent = <&gpio1>;
15962306a36Sopenharmony_ci            interrupts = <29 8>;
16062306a36Sopenharmony_ci            rohm,vsys-regulation-microvolt = <8960000>;
16162306a36Sopenharmony_ci            rohm,vbus-input-current-limit-microamp = <1472000>;
16262306a36Sopenharmony_ci            rohm,vcc-input-current-limit-microamp = <1472000>;
16362306a36Sopenharmony_ci        };
16462306a36Sopenharmony_ci    };
165