162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/power/supply/richtek,rt9455.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Richtek rt9455 battery charger
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Sebastian Reichel <sre@kernel.org>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciallOf:
1362306a36Sopenharmony_ci  - $ref: power-supply.yaml#
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciproperties:
1662306a36Sopenharmony_ci  compatible:
1762306a36Sopenharmony_ci    const: richtek,rt9455
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci  reg:
2062306a36Sopenharmony_ci    maxItems: 1
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci  interrupts:
2362306a36Sopenharmony_ci    maxItems: 1
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci  richtek,output-charge-current:
2662306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
2762306a36Sopenharmony_ci    description: output current from the charger to the battery, in uA.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci  richtek,end-of-charge-percentage:
3062306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3162306a36Sopenharmony_ci    description: |
3262306a36Sopenharmony_ci      percent of the output charge current. When the current in constant-voltage phase drops
3362306a36Sopenharmony_ci      below output_charge_current x end-of-charge-percentage, charge is terminated.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci  richtek,battery-regulation-voltage:
3662306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3762306a36Sopenharmony_ci    description: maximum battery voltage in uV.
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci  richtek,boost-output-voltage:
4062306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
4162306a36Sopenharmony_ci    description: |
4262306a36Sopenharmony_ci      maximum voltage provided to consumer devices, when the charger is in boost mode, in uV.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci  richtek,min-input-voltage-regulation:
4562306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
4662306a36Sopenharmony_ci    description: |
4762306a36Sopenharmony_ci      input voltage level in uV, used to decrease voltage level when the over current of the
4862306a36Sopenharmony_ci      input power source occurs. This prevents input voltage drop due to insufficient
4962306a36Sopenharmony_ci      current provided by the power source. Defaults to 4500000 uV (4.5V).
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci  richtek,avg-input-current-regulation:
5262306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
5362306a36Sopenharmony_ci    description: |
5462306a36Sopenharmony_ci      input current value in uA drained by the charger from the power source.
5562306a36Sopenharmony_ci      Defaults to 500000 uA (500mA).
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_cirequired:
5862306a36Sopenharmony_ci  - compatible
5962306a36Sopenharmony_ci  - reg
6062306a36Sopenharmony_ci  - interrupts
6162306a36Sopenharmony_ci  - richtek,output-charge-current
6262306a36Sopenharmony_ci  - richtek,end-of-charge-percentage
6362306a36Sopenharmony_ci  - richtek,battery-regulation-voltage
6462306a36Sopenharmony_ci  - richtek,boost-output-voltage
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ciadditionalProperties: false
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ciexamples:
6962306a36Sopenharmony_ci  - |
7062306a36Sopenharmony_ci    #include <dt-bindings/interrupt-controller/irq.h>
7162306a36Sopenharmony_ci    i2c {
7262306a36Sopenharmony_ci      #address-cells = <1>;
7362306a36Sopenharmony_ci      #size-cells = <0>;
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci      charger@22 {
7662306a36Sopenharmony_ci        compatible = "richtek,rt9455";
7762306a36Sopenharmony_ci        reg = <0x22>;
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci        interrupt-parent = <&gpio1>;
8062306a36Sopenharmony_ci        interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci        richtek,output-charge-current	    = <500000>;
8362306a36Sopenharmony_ci        richtek,end-of-charge-percentage    = <10>;
8462306a36Sopenharmony_ci        richtek,battery-regulation-voltage  = <4200000>;
8562306a36Sopenharmony_ci        richtek,boost-output-voltage	    = <5050000>;
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci        richtek,min-input-voltage-regulation = <4500000>;
8862306a36Sopenharmony_ci        richtek,avg-input-current-regulation = <500000>;
8962306a36Sopenharmony_ci      };
9062306a36Sopenharmony_ci    };
91