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/bq24735.yaml#
662306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
762306a36Sopenharmony_ci
862306a36Sopenharmony_cititle: TI BQ24735 Li-Ion Battery 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    const: ti,bq24735
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci  reg:
2162306a36Sopenharmony_ci    maxItems: 1
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci  interrupts:
2462306a36Sopenharmony_ci    description: AC adapter plug event interrupt
2562306a36Sopenharmony_ci    maxItems: 1
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci  ti,ac-detect-gpios:
2862306a36Sopenharmony_ci    maxItems: 1
2962306a36Sopenharmony_ci    description: |
3062306a36Sopenharmony_ci      This GPIO is optionally used to read the AC adapter status. This is a Host GPIO
3162306a36Sopenharmony_ci      that is configured as an input and connected to the ACOK pin on the bq24735.
3262306a36Sopenharmony_ci      Note: for backwards compatibility reasons, the GPIO must be active on AC adapter
3362306a36Sopenharmony_ci      absence despite ACOK being active (high) on AC adapter presence.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci  ti,charge-current:
3662306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3762306a36Sopenharmony_ci    description: |
3862306a36Sopenharmony_ci      Used to control and set the charging current.
3962306a36Sopenharmony_ci      This value must be between 128mA and 8.128A with a 64mA step resolution.
4062306a36Sopenharmony_ci      The POR value is 0x0000h. This number is in mA (e.g. 8192).
4162306a36Sopenharmony_ci      See spec for more information about the ChargeCurrent (0x14h) register.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci  ti,charge-voltage:
4462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
4562306a36Sopenharmony_ci    description: |
4662306a36Sopenharmony_ci      Used to control and set the charging voltage.
4762306a36Sopenharmony_ci      This value must be between 1.024V and 19.2V with a 16mV step resolution.
4862306a36Sopenharmony_ci      The POR value is 0x0000h. This number is in mV (e.g. 19200).
4962306a36Sopenharmony_ci      See spec for more information about the ChargeVoltage (0x15h) register.
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci  ti,input-current:
5262306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
5362306a36Sopenharmony_ci    description: |
5462306a36Sopenharmony_ci      Used to control and set the charger input current.
5562306a36Sopenharmony_ci      This value must be between 128mA and 8.064A with a 128mA step resolution.
5662306a36Sopenharmony_ci      The POR value is 0x1000h. This number is in mA (e.g. 8064).
5762306a36Sopenharmony_ci      See the spec for more information about the InputCurrent (0x3fh) register.
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci  ti,external-control:
6062306a36Sopenharmony_ci    type: boolean
6162306a36Sopenharmony_ci    description: |
6262306a36Sopenharmony_ci      Indicates that the charger is configured externally and that the host should not
6362306a36Sopenharmony_ci      attempt to enable/disable charging or set the charge voltage/current.
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci  poll-interval:
6662306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
6762306a36Sopenharmony_ci    description: |
6862306a36Sopenharmony_ci      If 'interrupts' is not specified, poll AC adapter presence with this interval (milliseconds).
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_cirequired:
7162306a36Sopenharmony_ci  - compatible
7262306a36Sopenharmony_ci  - reg
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ciadditionalProperties: false
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ciexamples:
7762306a36Sopenharmony_ci  - |
7862306a36Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci    i2c {
8162306a36Sopenharmony_ci      #address-cells = <1>;
8262306a36Sopenharmony_ci      #size-cells = <0>;
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci      charger@9 {
8562306a36Sopenharmony_ci        compatible = "ti,bq24735";
8662306a36Sopenharmony_ci        reg = <0x9>;
8762306a36Sopenharmony_ci        ti,ac-detect-gpios = <&gpio 72 0x1>;
8862306a36Sopenharmony_ci      };
8962306a36Sopenharmony_ci    };
90