Documentation / devicetree / bindings / power / supply / qcom,pm8916-lbc.yaml


Based on kernel version 6.8. Page generated on 2024-03-11 21:26 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm8916-lbc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Linear Battery Charger

maintainers:
  - Nikita Travkin <nikita@trvn.ru>

description:
  Linear Battery Charger hardware block, found in some Qualcomm PMICs
  such as pm8916. Implements a simple, autonomous CC/CV charger.

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    const: qcom,pm8916-lbc

  reg:
    items:
      - description: Charger
      - description: Battery
      - description: USB
      - description: MISC

  reg-names:
    items:
      - const: chgr
      - const: bat_if
      - const: usb
      - const: misc

  interrupts:
    items:
      - description: Battery detection
      - description: Fast charging
      - description: Charging failed
      - description: Charging done
      - description: Battery present
      - description: Battery temperature OK
      - description: USB coarse detection
      - description: USB IN valid
      - description: Charger gone
      - description: Overtemperature

  interrupt-names:
    items:
      - const: vbat_det
      - const: fast_chg
      - const: chg_fail
      - const: chg_done
      - const: bat_pres
      - const: temp_ok
      - const: coarse_det
      - const: usb_vbus
      - const: chg_gone
      - const: overtemp

  qcom,fast-charge-safe-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 4000000
    maximum: 4775000
    description:
      Maximum safe battery voltage in uV; May be pre-set by bootloader,
      in which case, setting this will harmlessly fail.

  qcom,fast-charge-safe-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 90000
    maximum: 1440000
    description:
      Maximum safe battery charge current in uA; May be pre-set by
      bootloader, in which case setting this will harmlessly fail.

  monitored-battery: true

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names
  - qcom,fast-charge-safe-voltage
  - qcom,fast-charge-safe-current

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      #address-cells = <1>;
      #size-cells = <0>;
 
      charger@1000 {
        compatible = "qcom,pm8916-lbc";
        reg = <0x1000>, <0x1200>, <0x1300>, <0x1600>;
        reg-names = "chgr", "bat_if", "usb", "misc";
 
        interrupts = <0x0 0x10 0 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 6 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 0 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 4 IRQ_TYPE_EDGE_BOTH>;
        interrupt-names = "vbat_det",
                          "fast_chg",
                          "chg_fail",
                          "chg_done",
                          "bat_pres",
                          "temp_ok",
                          "coarse_det",
                          "usb_vbus",
                          "chg_gone",
                          "overtemp";
        monitored-battery = <&battery>;
 
        qcom,fast-charge-safe-current = <900000>;
        qcom,fast-charge-safe-voltage = <4300000>;
      };
    };