18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/power/supply/rohm,bd99954.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: ROHM BD99954 Battery charger
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
118c2ecf20Sopenharmony_ci  - Markus Laine <markus.laine@fi.rohmeurope.com>
128c2ecf20Sopenharmony_ci  - Mikko Mutanen <mikko.mutanen@fi.rohmeurope.com>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cidescription: |
158c2ecf20Sopenharmony_ci  The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion
168c2ecf20Sopenharmony_ci  secondary battery intended to be used in space-constraint equipment such
178c2ecf20Sopenharmony_ci  as Low profile Notebook PC, Tablets and other applications. BD99954
188c2ecf20Sopenharmony_ci  provides a Dual-source Battery Charger, two port BC1.2 detection and a
198c2ecf20Sopenharmony_ci  Battery Monitor.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciproperties:
238c2ecf20Sopenharmony_ci  compatible:
248c2ecf20Sopenharmony_ci    const: rohm,bd99954
258c2ecf20Sopenharmony_ci#
268c2ecf20Sopenharmony_ci#    The battery charging profile of BD99954.
278c2ecf20Sopenharmony_ci#
288c2ecf20Sopenharmony_ci#    Curve (1) represents charging current.
298c2ecf20Sopenharmony_ci#    Curve (2) represents battery voltage.
308c2ecf20Sopenharmony_ci#
318c2ecf20Sopenharmony_ci#    The BD99954 data sheet divides charging to three phases.
328c2ecf20Sopenharmony_ci#    a) Trickle-charge with constant current (8).
338c2ecf20Sopenharmony_ci#    b) pre-charge with constant current (6)
348c2ecf20Sopenharmony_ci#    c) fast-charge with:
358c2ecf20Sopenharmony_ci#       First a constant current (5) phase (CC)
368c2ecf20Sopenharmony_ci#       Then constant voltage (CV) phase (after the battery voltage has reached
378c2ecf20Sopenharmony_ci#       target level - until charging current has dropped to termination
388c2ecf20Sopenharmony_ci#       level (7)
398c2ecf20Sopenharmony_ci#
408c2ecf20Sopenharmony_ci#     V ^                                                        ^ I
418c2ecf20Sopenharmony_ci#       .                                                        .
428c2ecf20Sopenharmony_ci#       .                                                        .
438c2ecf20Sopenharmony_ci# (4)- -.- - - - - - - - - - - - - -  +++++++++++++++++++++++++++.
448c2ecf20Sopenharmony_ci#       .                            /                           .
458c2ecf20Sopenharmony_ci#       .                     ++++++/++ - - - - - - - - - - - - -.- - (5)
468c2ecf20Sopenharmony_ci#       .                     +    /  +                          .
478c2ecf20Sopenharmony_ci#       .                     +   -   --                         .
488c2ecf20Sopenharmony_ci#       .                     +  -     +                         .
498c2ecf20Sopenharmony_ci#       .                     +.-      -:                        .
508c2ecf20Sopenharmony_ci#       .                    .+         +`                       .
518c2ecf20Sopenharmony_ci#       .                  .- +       | `/                       .
528c2ecf20Sopenharmony_ci#       .               .."   +          .:                      .
538c2ecf20Sopenharmony_ci#       .             -"      +           --                     .
548c2ecf20Sopenharmony_ci#       .    (2)  ..."        +       |    :-                    .
558c2ecf20Sopenharmony_ci#       .    ...""            +             -:                   .
568c2ecf20Sopenharmony_ci# (3)- -.-.""- - - - -+++++++++ - - - - - - -.:- - - - - - - - - .- - (6)
578c2ecf20Sopenharmony_ci#       .             +                       `:.                .
588c2ecf20Sopenharmony_ci#       .             +               |         -:               .
598c2ecf20Sopenharmony_ci#       .             +                           -:             .
608c2ecf20Sopenharmony_ci#       .             +                             ..           .
618c2ecf20Sopenharmony_ci#       .   (1)       +               |               "+++- - - -.- - (7)
628c2ecf20Sopenharmony_ci#       -++++++++++++++- - - - - - - - - - - - - - - - - + - - - .- - (8)
638c2ecf20Sopenharmony_ci#       .                                                +       -
648c2ecf20Sopenharmony_ci#       -------------------------------------------------+++++++++-->
658c2ecf20Sopenharmony_ci#       |             |       |   CC   |      CV         |
668c2ecf20Sopenharmony_ci#       | --trickle-- | -pre- | ---------fast----------- |
678c2ecf20Sopenharmony_ci#
688c2ecf20Sopenharmony_ci#   The charger uses the following battery properties
698c2ecf20Sopenharmony_ci# - trickle-charge-current-microamp:
708c2ecf20Sopenharmony_ci#     Current used at trickle-charge phase (8 in above chart)
718c2ecf20Sopenharmony_ci#     minimum: 64000
728c2ecf20Sopenharmony_ci#     maximum: 1024000
738c2ecf20Sopenharmony_ci#     multipleOf: 64000
748c2ecf20Sopenharmony_ci# - precharge-current-microamp:
758c2ecf20Sopenharmony_ci#     Current used at pre-charge phase (6 in above chart)
768c2ecf20Sopenharmony_ci#     minimum: 64000
778c2ecf20Sopenharmony_ci#     maximum: 1024000
788c2ecf20Sopenharmony_ci#     multipleOf: 64000
798c2ecf20Sopenharmony_ci# - constant-charge-current-max-microamp
808c2ecf20Sopenharmony_ci#     Current used at fast charge constant current phase (5 in above chart)
818c2ecf20Sopenharmony_ci#     minimum: 64000
828c2ecf20Sopenharmony_ci#     maximum: 1024000
838c2ecf20Sopenharmony_ci#     multipleOf: 64000
848c2ecf20Sopenharmony_ci# - constant-charge-voltage-max-microvolt
858c2ecf20Sopenharmony_ci#     The constant voltage used in fast charging phase (4 in above chart)
868c2ecf20Sopenharmony_ci#     minimum: 2560000
878c2ecf20Sopenharmony_ci#     maximum: 19200000
888c2ecf20Sopenharmony_ci#     multipleOf: 16000
898c2ecf20Sopenharmony_ci# - precharge-upper-limit-microvolt
908c2ecf20Sopenharmony_ci#     charging mode is changed from trickle charging to pre-charging
918c2ecf20Sopenharmony_ci#     when battery voltage exceeds this limit voltage (3 in above chart)
928c2ecf20Sopenharmony_ci#     minimum: 2048000
938c2ecf20Sopenharmony_ci#     maximum: 19200000
948c2ecf20Sopenharmony_ci#     multipleOf: 64000
958c2ecf20Sopenharmony_ci# - re-charge-voltage-microvolt
968c2ecf20Sopenharmony_ci#     minimum: 2560000
978c2ecf20Sopenharmony_ci#     maximum: 19200000
988c2ecf20Sopenharmony_ci#     multipleOf: 16000
998c2ecf20Sopenharmony_ci#     re-charging is automatically started when battry has been discharging
1008c2ecf20Sopenharmony_ci#     to the point where the battery voltage drops below this limit
1018c2ecf20Sopenharmony_ci# - over-voltage-threshold-microvolt
1028c2ecf20Sopenharmony_ci#     battery is expected to be faulty if battery voltage exceeds this limit.
1038c2ecf20Sopenharmony_ci#     Charger will then enter to a "battery faulty" -state
1048c2ecf20Sopenharmony_ci#     minimum: 2560000
1058c2ecf20Sopenharmony_ci#     maximum: 19200000
1068c2ecf20Sopenharmony_ci#     multipleOf: 16000
1078c2ecf20Sopenharmony_ci# - charge-term-current-microamp
1088c2ecf20Sopenharmony_ci#     minimum: 0
1098c2ecf20Sopenharmony_ci#     maximum: 1024000
1108c2ecf20Sopenharmony_ci#     multipleOf: 64000
1118c2ecf20Sopenharmony_ci#     a charge cycle terminates when the battery voltage is above recharge
1128c2ecf20Sopenharmony_ci#     threshold, and the current is below this setting (7 in above chart)
1138c2ecf20Sopenharmony_ci#   See also Documentation/devicetree/bindings/power/supply/battery.txt
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci  reg:
1168c2ecf20Sopenharmony_ci    maxItems: 1
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci  interrupts:
1198c2ecf20Sopenharmony_ci    maxItems: 1
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci  monitored-battery:
1228c2ecf20Sopenharmony_ci    description:
1238c2ecf20Sopenharmony_ci      phandle of battery characteristics devicetree node
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci  rohm,vsys-regulation-microvolt:
1268c2ecf20Sopenharmony_ci    description: system specific lower limit for system voltage.
1278c2ecf20Sopenharmony_ci    minimum: 2560000
1288c2ecf20Sopenharmony_ci    maximum: 19200000
1298c2ecf20Sopenharmony_ci    multipleOf: 64000
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci  rohm,vbus-input-current-limit-microamp:
1328c2ecf20Sopenharmony_ci    description: system specific VBUS input current limit (in microamps).
1338c2ecf20Sopenharmony_ci    minimum: 32000
1348c2ecf20Sopenharmony_ci    maximum: 16352000
1358c2ecf20Sopenharmony_ci    multipleOf: 32000
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci  rohm,vcc-input-current-limit-microamp:
1388c2ecf20Sopenharmony_ci    description: system specific VCC/VACP input current limit (in microamps).
1398c2ecf20Sopenharmony_ci    minimum: 32000
1408c2ecf20Sopenharmony_ci    maximum: 16352000
1418c2ecf20Sopenharmony_ci    multipleOf: 32000
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_cirequired:
1448c2ecf20Sopenharmony_ci  - compatible
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ciadditionalProperties: false
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ciexamples:
1498c2ecf20Sopenharmony_ci  - |
1508c2ecf20Sopenharmony_ci    i2c {
1518c2ecf20Sopenharmony_ci        #address-cells = <1>;
1528c2ecf20Sopenharmony_ci        #size-cells = <0>;
1538c2ecf20Sopenharmony_ci        charger@9 {
1548c2ecf20Sopenharmony_ci            compatible = "rohm,bd99954";
1558c2ecf20Sopenharmony_ci            monitored-battery = <&battery>;
1568c2ecf20Sopenharmony_ci            reg = <0x9>;
1578c2ecf20Sopenharmony_ci            interrupt-parent = <&gpio1>;
1588c2ecf20Sopenharmony_ci            interrupts = <29 8>;
1598c2ecf20Sopenharmony_ci            rohm,vsys-regulation-microvolt = <8960000>;
1608c2ecf20Sopenharmony_ci            rohm,vbus-input-current-limit-microamp = <1472000>;
1618c2ecf20Sopenharmony_ci            rohm,vcc-input-current-limit-microamp = <1472000>;
1628c2ecf20Sopenharmony_ci        };
1638c2ecf20Sopenharmony_ci    };
164