code:
# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
# Copyright (C) 2020 Texas Instruments Incorporated
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq256xx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI bq256xx Switch Mode Buck Charger

maintainers:
  - Andrew Davis <afd@ti.com>

description: |
  The bq256xx devices are a family of highly-integrated battery charge
  management and system power management ICs for single cell Li-ion and Li-
  polymer batteries.

  Datasheets:
    - https://www.ti.com/lit/ds/symlink/bq25600.pdf
    - https://www.ti.com/lit/ds/symlink/bq25601.pdf
    - https://www.ti.com/lit/ds/symlink/bq25600d.pdf
    - https://www.ti.com/lit/ds/symlink/bq25601d.pdf
    - https://www.ti.com/lit/ds/symlink/bq25611d.pdf
    - https://www.ti.com/lit/ds/symlink/bq25618.pdf
    - https://www.ti.com/lit/ds/symlink/bq25619.pdf

properties:
  compatible:
    enum:
      - ti,bq25600
      - ti,bq25601
      - ti,bq25600d
      - ti,bq25601d
      - ti,bq25611d
      - ti,bq25618
      - ti,bq25619

  reg:
    maxItems: 1

  ti,watchdog-timeout-ms:
    default: 0
    description: |
      Watchdog timer in ms. 0 (default) disables the watchdog
    minimum: 0
    maximum: 160000
    enum: [ 0, 40000, 80000, 160000]

  input-voltage-limit-microvolt:
    description: |
       Minimum input voltage limit in µV with a 100000 µV step
    minimum: 3900000
    maximum: 5400000

  input-current-limit-microamp:
    description: |
       Maximum input current limit in µA with a 100000 µA step
    minimum: 100000
    maximum: 3200000

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to the battery node being monitored

  interrupts:
    maxItems: 1
    description: |
      Interrupt sends an active low, 256 μs pulse to host to report the charger
      device status and faults.

required:
  - compatible
  - reg
  - monitored-battery

additionalProperties: false

examples:
  - |
    bat: battery {
      compatible = "simple-battery";
      constant-charge-current-max-microamp = <2040000>;
      constant-charge-voltage-max-microvolt = <4352000>;
      precharge-current-microamp = <180000>;
      charge-term-current-microamp = <180000>;
    };
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {

      clock-frequency = <400000>;

      #address-cells = <1>;
      #size-cells = <0>;

      charger@6b {
        compatible = "ti,bq25601";
        reg = <0x6b>;
        monitored-battery = <&bat>;

        interrupt-parent = <&gpio1>;
        interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
        ti,watchdog-timeout-ms = <40000>;

        input-voltage-limit-microvolt = <4500000>;
        input-current-limit-microamp = <2400000>;
       };
    };
...


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq25890.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for bq25890, bq25892, bq25895 and bq25896 Li-Ion Charger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    oneOf:
      - enum:
          - ti,bq25890
      - items:
          - enum:
              - ti,bq25892
              - ti,bq25895
              - ti,bq25896
          - const: ti,bq25890

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  ti,battery-regulation-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charging voltage (in uV)

  ti,charge-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charging current (in uA)

  ti,termination-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      charge will be terminated when current in constant-voltage phase
      drops below this value (in uA)

  ti,precharge-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charge current during precharge phase (in uA)

  ti,minimum-sys-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      when battery is charging and it is below minimum system voltage,
      the system will be regulated above minimum-sys-voltage setting (in uV)

  ti,boost-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: VBUS voltage level in boost mode (in uV)

  ti,boost-max-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum allowed current draw in boost mode (in uA)

  ti,boost-low-freq:
    description: boost mode frequency will be 500kHz, otherwise 1.5MHz
    type: boolean

  ti,use-ilim-pin:
    description: |
      ILIM resistor will be used and the input current will be the lower
      between the resistor setting and the IINLIM register setting
    type: boolean

  ti,thermal-regulation-threshold:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      temperature above which the charge current is lowered, to avoid overheating
      (in degrees Celsius). If omitted, the default setting will be used (120 degrees)

  ti,ibatcomp-micro-ohms:
    description: value of a resistor in series with the battery (in Micro Ohms)

  ti,ibatcomp-clamp-microvolt:
    description: max. charging voltage adjustment due to expected voltage drop on in-series resistor

required:
  - compatible
  - reg
  - interrupts
  - ti,battery-regulation-voltage
  - ti,charge-current
  - ti,termination-current
  - ti,precharge-current
  - ti,minimum-sys-voltage
  - ti,boost-voltage
  - ti,boost-max-current

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@6a {
        compatible = "ti,bq25890";
        reg = <0x6a>;

        interrupt-parent = <&gpio1>;
        interrupts = <16 IRQ_TYPE_EDGE_FALLING>;

        ti,battery-regulation-voltage = <4200000>;
        ti,charge-current = <1000000>;
        ti,termination-current = <50000>;
        ti,precharge-current = <128000>;
        ti,minimum-sys-voltage = <3600000>;
        ti,boost-voltage = <5000000>;
        ti,boost-max-current = <1000000>;

        ti,use-ilim-pin;
        ti,thermal-regulation-threshold = <120>;
      };
    };

repo_name: angery/linux


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2020 Texas Instruments Incorporated
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq25980.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI BQ25980 Flash Charger

maintainers:
  - Andrew Davis <afd@ti.com>

description: |
  The BQ25980, BQ25975, and BQ25960 are a series of flash chargers intended
  for use in high-power density portable electronics. These inductorless
  switching chargers can provide over 97% efficiency by making use of the
  switched capacitor architecture.

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

properties:
  compatible:
    enum:
      - ti,bq25980
      - ti,bq25975
      - ti,bq25960

  reg:
    maxItems: 1

  ti,watchdog-timeout-ms:
    description: |
      Watchdog timer in milli seconds. 0 disables the watchdog.
    default: 0
    minimum: 0
    maximum: 300000
    enum: [ 0, 5000, 10000, 50000, 300000]

  ti,sc-ovp-limit-microvolt:
    description: |
      Minimum input voltage limit in micro volts with a when the charger is in
      switch cap mode. 100000 micro volt step.
    default: 17800000
    minimum: 14000000
    maximum: 22000000

  ti,sc-ocp-limit-microamp:
    description: |
      Maximum input current limit in micro amps with a 100000 micro amp step.
    minimum: 100000
    maximum: 3300000

  ti,bypass-ovp-limit-microvolt:
    description: |
      Minimum input voltage limit in micro volts with a when the charger is in
      switch cap mode. 50000 micro volt step.
    minimum: 7000000
    maximum: 12750000

  ti,bypass-ocp-limit-microamp:
    description: |
      Maximum input current limit in micro amps with a 100000 micro amp step.
    minimum: 100000
    maximum: 3300000

  ti,bypass-enable:
    type: boolean
    description: Enables bypass mode at boot time

  interrupts:
    maxItems: 1
    description: |
      Indicates that the device state has changed.

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to the battery node being monitored

required:
  - compatible
  - reg
  - monitored-battery

unevaluatedProperties: false

examples:
  - |
    bat: battery {
      compatible = "simple-battery";
      constant-charge-current-max-microamp = <4000000>;
      constant-charge-voltage-max-microvolt = <8400000>;
      precharge-current-microamp = <160000>;
      charge-term-current-microamp = <160000>;
    };
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      bq25980: charger@65 {
          compatible = "ti,bq25980";
          reg = <0x65>;
          interrupt-parent = <&gpio1>;
          interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
          ti,watchdog-timeout-ms = <0>;
          ti,sc-ocp-limit-microamp = <2000000>;
          ti,sc-ovp-limit-microvolt = <17800000>;
          monitored-battery = <&bat>;
      };
    };

...


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 Texas Instruments Incorporated
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq27xxx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI BQ27XXX fuel gauge family

maintainers:
  - Pali Rohár <pali@kernel.org>
  - Andrew F. Davis <afd@ti.com>
  - Sebastian Reichel <sre@kernel.org>

description: |
  Support various Texas Instruments fuel gauge devices that share similar
  register maps and power supply properties

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

properties:
  compatible:
    enum:
      - ti,bq27200
      - ti,bq27210
      - ti,bq27500 # deprecated, use revision specific property below
      - ti,bq27510 # deprecated, use revision specific property below
      - ti,bq27520 # deprecated, use revision specific property below
      - ti,bq27500-1
      - ti,bq27510g1
      - ti,bq27510g2
      - ti,bq27510g3
      - ti,bq27520g1
      - ti,bq27520g2
      - ti,bq27520g3
      - ti,bq27520g4
      - ti,bq27521
      - ti,bq27530
      - ti,bq27531
      - ti,bq27541
      - ti,bq27542
      - ti,bq27546
      - ti,bq27742
      - ti,bq27545
      - ti,bq27411
      - ti,bq27421
      - ti,bq27425
      - ti,bq27426
      - ti,bq27441
      - ti,bq27621
      - ti,bq27z561
      - ti,bq28z610
      - ti,bq34z100
      - ti,bq78z100

  reg:
    maxItems: 1
    description: integer, I2C address of the fuel gauge.

  monitored-battery:
    description: |
       The fuel gauge uses the following battery properties:
       - energy-full-design-microwatt-hours
       - charge-full-design-microamp-hours
       - voltage-min-design-microvolt
       Both or neither of the *-full-design-*-hours properties must be set.

  power-supplies: true

required:
  - compatible
  - reg
additionalProperties: false

examples:
  - |
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;
      bat: battery {
        compatible = "simple-battery";
        voltage-min-design-microvolt = <3200000>;
        energy-full-design-microwatt-hours = <5290000>;
        charge-full-design-microamp-hours = <1430000>;
      };

      bq27510g3: fuel-gauge@55 {
        compatible = "ti,bq27510g3";
        reg = <0x55>;
        monitored-battery = <&bat>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/charger-manager.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Charger Manager

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description: |
  Binding for the legacy charger manager driver.
  Please do not use for new products.

properties:
  compatible:
    const: charger-manager

  cm-chargers:
    description: name of chargers
    $ref: /schemas/types.yaml#/definitions/string-array

  cm-num-chargers:
    $ref: /schemas/types.yaml#/definitions/uint32
    deprecated: true

  cm-fuel-gauge:
    description: name of battery fuel gauge
    $ref: /schemas/types.yaml#/definitions/string

  cm-name:
    description: name of the charger manager
    default: battery
    $ref: /schemas/types.yaml#/definitions/string

  cm-poll-mode:
    description: polling mode
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0
    enum:
      - 0 # disabled
      - 1 # always
      - 2 # when external power is connected
      - 3 # when charging

  cm-poll-interval:
    description: polling interval (in ms)
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-stat:
    description: battery status
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 0 # battery always present
      - 1 # no battery
      - 2 # check presence via fuel gauge
      - 3 # check presence via charger

  cm-fullbatt-vchkdrop-volt:
    description: voltage drop before restarting charging in uV
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-fullbatt-vchkdrop-ms:
    deprecated: true

  cm-fullbatt-voltage:
    description: voltage of full battery in uV
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-fullbatt-soc:
    description: state of charge to consider as full battery in %
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-fullbatt-capacity:
    description: capcity to consider as full battery in uAh
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-thermal-zone:
    description: name of external thermometer's thermal zone
    $ref: /schemas/types.yaml#/definitions/string

  cm-discharging-max:
    description: limits of discharging duration in ms
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-charging-max:
    description: limits of charging duration in ms
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-cold:
    description: critical cold temperature of battery for charging in deci-degree celsius
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-cold-in-minus:
    description: if set cm-battery-cold temperature is in minus degrees
    type: boolean

  cm-battery-hot:
    description: critical hot temperature of battery for charging in deci-degree celsius
    $ref: /schemas/types.yaml#/definitions/uint32

  cm-battery-temp-diff:
    description: temperature difference to allow recharging in deci-degree celsius
    $ref: /schemas/types.yaml#/definitions/uint32

patternProperties:
  "-supply$":
    description: regulator consumer, named according to cm-regulator-name
    $ref: /schemas/types.yaml#/definitions/phandle

  "^regulator[@-][0-9]$":
    type: object
    properties:
      cm-regulator-name:
        description: name of charger regulator
        $ref: /schemas/types.yaml#/definitions/string

    required:
      - cm-regulator-name

    additionalProperties: false

    patternProperties:
      "^cable[@-][0-9]$":
        type: object
        properties:
          cm-cable-name:
            description: name of charger cable
            enum:
              - USB
              - USB-HOST
              - SDP
              - DCP
              - CDP
              - ACA
              - FAST-CHARGER
              - SLOW-CHARGER
              - WPT
              - PD
              - DOCK
              - JIG
              - MECHANICAL

          cm-cable-extcon:
            description: name of extcon dev
            $ref: /schemas/types.yaml#/definitions/string

          cm-cable-min:
            description: minimum current of cable in uA
            $ref: /schemas/types.yaml#/definitions/uint32

          cm-cable-max:
            description: maximum current of cable in uA
            $ref: /schemas/types.yaml#/definitions/uint32

        required:
          - cm-cable-name
          - cm-cable-extcon

        additionalProperties: false

required:
  - compatible
  - cm-chargers
  - cm-fuel-gauge

additionalProperties: false

examples:
  - |
    charger-manager {
        compatible = "charger-manager";
        chg-reg-supply = <&charger_regulator>;

        cm-name = "battery";
        /* Always polling ON : 30s */
        cm-poll-mode = <1>;
        cm-poll-interval = <30000>;

        cm-fullbatt-vchkdrop-volt = <150000>;
        cm-fullbatt-soc = <100>;

        cm-battery-stat = <3>;

        cm-chargers = "charger0", "charger1", "charger2";

        cm-fuel-gauge = "fuelgauge0";

        cm-thermal-zone = "thermal_zone.1";
        /* in deci centigrade */
        cm-battery-cold = <50>;
        cm-battery-cold-in-minus;
        cm-battery-hot = <800>;
        cm-battery-temp-diff = <100>;

        /* Allow charging for 5hr */
        cm-charging-max = <18000000>;
        /* Allow discharging for 2hr */
        cm-discharging-max = <7200000>;

        regulator-0 {
            cm-regulator-name = "chg-reg";
            cable-0 {
                cm-cable-name = "USB";
                cm-cable-extcon = "extcon-dev.0";
                cm-cable-min = <475000>;
                cm-cable-max = <500000>;
            };
            cable-1 {
                cm-cable-name = "SDP";
                cm-cable-extcon = "extcon-dev.0";
                cm-cable-min = <650000>;
                cm-cable-max = <675000>;
            };
        };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/cpcap-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Motorola CPCAP PMIC battery

maintainers:
  - Tony Lindgren <tony@atomide.com>
  - Sebastian Reichel <sre@kernel.org>

description: |
  Motorola CPCAP is a PMIC found in some mobile phones, e.g.
  the Droid 4. This binding describes its battery fuel gauge
  sub-function.

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

properties:
  compatible:
    const: motorola,cpcap-battery

  interrupts:
    items:
      - description: eol interrupt
      - description: low battery percentage interrupt
      - description: critical battery percentage interrupt
      - description: charger detect interrupt
      - description: battery detect interrupt
      - description: coulomb counter calibration interrupt

  interrupt-names:
    items:
      - const: eol
      - const: lowbph
      - const: lowbpl
      - const: chrgcurr1
      - const: battdetb
      - const: cccal

  io-channels:
    items:
      - description: battery temperature
      - description: battery voltage
      - description: battery charge current
      - description: battery current

  io-channel-names:
    items:
      - const: battdetb
      - const: battp
      - const: chg_isense
      - const: batti

  power-supplies: true

required:
  - compatible
  - interrupts
  - interrupt-names
  - io-channels
  - io-channel-names
  - power-supplies

additionalProperties: false

examples:
  - |
    cpcap {
      battery {
        compatible = "motorola,cpcap-battery";
        interrupts-extended =
                <&cpcap 6 0>, <&cpcap 5 0>, <&cpcap 3 0>,
                <&cpcap 20 0>, <&cpcap 54 0>, <&cpcap 57 0>;
        interrupt-names =
                "eol", "lowbph", "lowbpl",
                "chrgcurr1", "battdetb", "cccal";
        io-channels = <&cpcap_adc 0>, <&cpcap_adc 1>,
                      <&cpcap_adc 5>, <&cpcap_adc 6>;
        io-channel-names = "battdetb", "battp",
                           "chg_isense", "batti";
        power-supplies = <&cpcap_charger>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/cpcap-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Motorola CPCAP PMIC charger

maintainers:
  - Tony Lindgren <tony@atomide.com>
  - Sebastian Reichel <sre@kernel.org>

description: |
  Motorola CPCAP is a PMIC found in some mobile phones, e.g.
  the Droid 4. This binding describes its battery charger
  sub-function.

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

properties:
  compatible:
    const: motorola,mapphone-cpcap-charger

  interrupts:
    items:
      - description: charger detection interrupt
      - description: reverse charge interrupt
      - description: SE1 charger detection interrupt
      - description: SE0 charger detection interrupt
      - description: reverse mode interrupt
      - description: charge current 2 interrupt
      - description: charge current 1 interrupt
      - description: VBUS valid interrupt
      - description: battery detect interrupt

  interrupt-names:
    items:
      - const: chrg_det
      - const: rvrs_chrg
      - const: chrg_se1b
      - const: se0conn
      - const: rvrs_mode
      - const: chrgcurr2
      - const: chrgcurr1
      - const: vbusvld
      - const: battdetb

  io-channels:
    items:
      - description: battery temperature
      - description: battery voltage
      - description: VBUS voltage
      - description: battery charge current
      - description: battery current

  io-channel-names:
    items:
      - const: battdetb
      - const: battp
      - const: vbus
      - const: chg_isense
      - const: batti

  mode-gpios:
    description: |
      Optionally CPCAP charger can have a companion wireless
      charge controller that is controlled with two GPIOs
      that are active low.
    minItems: 2
    maxItems: 2

required:
  - compatible
  - interrupts
  - interrupt-names
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    cpcap {
      charger {
        compatible = "motorola,mapphone-cpcap-charger";
        interrupts-extended =
                <&cpcap 13 0>, <&cpcap 12 0>, <&cpcap 29 0>, <&cpcap 28 0>,
                <&cpcap 22 0>, <&cpcap 21 0>, <&cpcap 20 0>, <&cpcap 19 0>,
                <&cpcap 54 0>;
        interrupt-names =
                "chrg_det", "rvrs_chrg", "chrg_se1b", "se0conn",
                "rvrs_mode", "chrgcurr2", "chrgcurr1", "vbusvld",
                "battdetb";
        mode-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>,
                     <&gpio3 23 GPIO_ACTIVE_LOW>;
        io-channels = <&cpcap_adc 0>, <&cpcap_adc 1>,
                      <&cpcap_adc 2>, <&cpcap_adc 5>,
                      <&cpcap_adc 6>;
        io-channel-names = "battdetb", "battp",
                           "vbus", "chg_isense",
                           "batti";
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/cw2015_battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Battery driver for CW2015 shuntless fuel gauge by CellWise.

maintainers:
  - Tobias Schramm <t.schramm@manjaro.org>

description: |
  The driver can utilize information from a simple-battery linked via a
  phandle in monitored-battery. If specified the driver uses the
  charge-full-design-microamp-hours property of the battery.

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

properties:
  compatible:
    const: cellwise,cw2015

  reg:
    maxItems: 1

  cellwise,battery-profile:
    description: |
      This property specifies characteristics of the battery used. The format
      of this binary blob is kept secret by CellWise. The only way to obtain
      it is to mail two batteries to a test facility of CellWise and receive
      back a test report with the binary blob.
    $ref: /schemas/types.yaml#/definitions/uint8-array
    minItems: 64
    maxItems: 64

  cellwise,monitor-interval-ms:
    description:
      Specifies the interval in milliseconds gauge values are polled at
    minimum: 250

  power-supplies:
    minItems: 1
    maxItems: 8 # Should be enough

  monitored-battery:
    description:
      Specifies the phandle of a simple-battery connected to this gauge
    $ref: /schemas/types.yaml#/definitions/phandle

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        cw2015@62 {
            compatible = "cellwise,cw2015";
            reg = <0x62>;
            cellwise,battery-profile = /bits/ 8 <
                0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
                0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
                0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
                0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
                0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
                0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
                0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
                0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
           >;
           cellwise,monitor-interval-ms = <5000>;
           monitored-battery = <&bat>;
           power-supplies = <&mains_charger>, <&usb_charger>;
       };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/dlg,da9150-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Dialog Semiconductor DA9150 Charger Power Supply bindings

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: dlg,da9150-charger

  io-channels:
    items:
      - description: ADC channel for current
      - description: ADC channel for bus voltage
      - description: ADC channel for junction temperature
      - description: ADC channel for battery voltage

  io-channel-names:
    items:
      - const: CHAN_IBUS
      - const: CHAN_VBUS
      - const: CHAN_TJUNC
      - const: CHAN_VBAT

required:
  - compatible

additionalProperties: false

examples:
  - |
    pmic {
      charger {
        compatible = "dlg,da9150-charger";
        io-channels = <&gpadc 0>,
                      <&gpadc 2>,
                      <&gpadc 8>,
                      <&gpadc 5>;
        io-channel-names = "CHAN_IBUS",
                           "CHAN_VBUS",
                           "CHAN_TJUNC",
                           "CHAN_VBAT";
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/dlg,da9150-fuel-gauge.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Dialog Semiconductor DA9150 Fuel-Gauge Power Supply bindings

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: dlg,da9150-fuel-gauge

  dlg,update-interval:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Interval time (milliseconds) between battery level checks.

  dlg,warn-soc-level:
    $ref: /schemas/types.yaml#/definitions/uint8
    minimum: 1
    maximum: 100
    description: Battery discharge level (%) where warning event raised.

  dlg,crit-soc-level:
    $ref: /schemas/types.yaml#/definitions/uint8
    minimum: 1
    maximum: 100
    description: |
      Battery discharge level (%) where critical event raised.
      This value should be lower than the warning level.

required:
  - compatible

additionalProperties: false

examples:
  - |
    pmic {
      battery {
        compatible = "dlg,da9150-fuel-gauge";
        dlg,update-interval = <10000>;
        dlg,warn-soc-level = /bits/ 8 <15>;
        dlg,crit-soc-level = /bits/ 8 <5>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/gpio-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: simple battery chargers only communicating through GPIOs

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description:
  This binding is for all chargers, which are working more or less
  autonomously, only providing some status GPIOs and possibly some
  GPIOs for limited control over the charging process.

properties:
  compatible:
    const: gpio-charger

  charger-type:
    enum:
      - unknown
      - battery
      - ups
      - mains
      - usb-sdp                   # USB standard downstream port
      - usb-dcp                   # USB dedicated charging port
      - usb-cdp                   # USB charging downstream port
      - usb-aca                   # USB accessory charger adapter
    description:
      Type of the charger, e.g. "mains" for a wall charger.

  gpios:
    maxItems: 1
    description: GPIO indicating the charger presence

  charge-status-gpios:
    maxItems: 1
    description: GPIO indicating the charging status

  charge-current-limit-gpios:
    minItems: 1
    maxItems: 32
    description: GPIOs used for current limiting

  charge-current-limit-mapping:
    description: List of tuples with current in uA and a GPIO bitmap (in
      this order). The tuples must be provided in descending order of the
      current limit.
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    items:
      items:
        - description:
            Current limit in uA
        - description:
            Encoded GPIO setting. Bit 0 represents last GPIO from the
            charge-current-limit-gpios property. Bit 1 second to last
            GPIO and so on.

required:
  - compatible

anyOf:
  - required:
      - gpios
  - required:
      - charge-status-gpios
  - required:
      - charge-current-limit-gpios

dependencies:
  charge-current-limit-gpios: [ charge-current-limit-mapping ]
  charge-current-limit-mapping: [ charge-current-limit-gpios ]

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    charger {
      compatible = "gpio-charger";
      charger-type = "usb-sdp";

      gpios = <&gpd 28 GPIO_ACTIVE_LOW>;
      charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>;

      charge-current-limit-gpios = <&gpioA 11 GPIO_ACTIVE_HIGH>,
                                   <&gpioA 12 GPIO_ACTIVE_HIGH>;
      charge-current-limit-mapping = <2500000 0x00>, // 2.5 A => both GPIOs low
                                     <700000 0x01>, // 700 mA => GPIO A.12 high
                                     <0 0x02>; // 0 mA => GPIO A.11 high
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2019-2020 Artur Rojek
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/ingenic,battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Ingenic JZ47xx battery bindings

maintainers:
  - Artur Rojek <contact@artur-rojek.eu>

$ref: power-supply.yaml#

properties:
  compatible:
    oneOf:
      - const: ingenic,jz4740-battery
      - items:
          - enum:
              - ingenic,jz4725b-battery
              - ingenic,jz4770-battery
          - const: ingenic,jz4740-battery

  io-channels:
    maxItems: 1

  io-channel-names:
    const: battery

  monitored-battery:
    description: >
      This property must be a phandle to a node using the format described
      in battery.yaml, with the following properties being required:
      - voltage-min-design-microvolt: drained battery voltage,
      - voltage-max-design-microvolt: fully charged battery voltage.

required:
  - compatible
  - io-channels
  - io-channel-names
  - monitored-battery

additionalProperties: false

examples:
  - |
    #include <dt-bindings/iio/adc/ingenic,adc.h>

    simple_battery: battery {
            compatible = "simple-battery";
            voltage-min-design-microvolt = <3600000>;
            voltage-max-design-microvolt = <4200000>;
    };

    ingenic-battery {
            compatible = "ingenic,jz4740-battery";
            io-channels = <&adc INGENIC_ADC_BATTERY>;
            io-channel-names = "battery";
            monitored-battery = <&simple_battery>;
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/isp1704.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for NXP ISP1704 USB Charger Detection

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: nxp,isp1704

  nxp,enable-gpio:
    maxItems: 1
    description: GPIO connected to the chip's enable pin

  usb-phy:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: USB PHY the ISP1704 is connected to

required:
  - compatible
  - nxp,enable-gpio
  - usb-phy

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    charger-detect {
      compatible = "nxp,isp1704";
      nxp,enable-gpio = <&gpio3 3 GPIO_ACTIVE_LOW>;
      usb-phy = <&usb2_phy>;
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/lego,ev3-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: LEGO MINDSTORMS EV3 Battery

maintainers:
  - David Lechner <david@lechnology.com>
  - Sebastian Reichel <sre@kernel.org>

description: |
  LEGO MINDSTORMS EV3 has some built-in capability for monitoring the battery.
  It uses 6 AA batteries or a special Li-ion rechargeable battery pack that is
  detected by a key switch in the battery compartment.

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

properties:
  compatible:
    const: lego,ev3-battery

  io-channels:
    items:
      - description: ADC channel for battery voltage
      - description: ADC channel for battery current

  io-channel-names:
    items:
      - const: voltage
      - const: current

  rechargeable-gpios:
    maxItems: 1
    description: Rechargeable battery indication gpio

required:
  - compatible
  - io-channels
  - io-channel-names
  - rechargeable-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    battery {
      compatible = "lego,ev3-battery";
      io-channels = <&adc 4>, <&adc 3>;
      io-channel-names = "voltage", "current";
      rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>;
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/lltc,lt3651-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices LT3651 Charger Power Supply bindings

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    enum:
      - lltc,lt3651-charger
      - lltc,ltc3651-charger  # deprecated, use lltc,lt3651-charger

  lltc,acpr-gpios:
    maxItems: 1

  lltc,fault-gpios:
    maxItems: 1

  lltc,chrg-gpios:
    maxItems: 1

required:
  - compatible
  - lltc,acpr-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    charger {
      compatible = "lltc,lt3651-charger";
      lltc,acpr-gpios = <&gpio0 68 GPIO_ACTIVE_LOW>;
      lltc,fault-gpios = <&gpio0 64 GPIO_ACTIVE_LOW>;
      lltc,chrg-gpios = <&gpio0 63 GPIO_ACTIVE_LOW>;
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/lltc,ltc294x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for LTC2941, LTC2942, LTC2943 and LTC2944 battery fuel gauges

description: |
  All chips measure battery capacity.
  The LTC2942 is pin compatible with the LTC2941, it adds voltage and
  temperature monitoring, and is runtime detected. LTC2943 and LTC2944
  are software compatible, uses a slightly different conversion formula
  for the charge counter and adds voltage, current and temperature monitoring.

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    enum:
      - lltc,ltc2941
      - lltc,ltc2942
      - lltc,ltc2943
      - lltc,ltc2944

  reg:
    maxItems: 1

  lltc,resistor-sense:
    $ref: /schemas/types.yaml#/definitions/int32
    description: |
      Sense resistor value in milli-ohms.
      Can be negative value when the battery has been connected to the wrong end of the resistor.

  lltc,prescaler-exponent:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      The prescaler exponent as explained in the datasheet.
      This determines the range and accuracy of the gauge.
      The value is programmed into the chip only if it differs from the current setting.
      The setting is lost when the battery is disconnected.

required:
  - compatible
  - reg
  - lltc,resistor-sense
  - lltc,prescaler-exponent

additionalProperties: false

examples:
  - |
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;
      battery@64 {
        compatible = "lltc,ltc2943";
        reg = <0x64>;
        lltc,resistor-sense = <15>;
        lltc,prescaler-exponent = <5>; /* 2^(2*5) = 1024 */
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright (C) 2020 Topic Embedded Products
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/ltc4162-l.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Linear Technology (Analog Devices) LTC4162-L Charger

maintainers:
  - Mike Looijmans <mike.looijmans@topic.nl>

description: |
  The LTC ® 4162-L is an advanced monolithic synchronous step-down switching
  battery charger and PowerPath (TM) manager that seamlessly manages power
  distribution between input sources such as wall adapters, backplanes, solar
  panels, etc., and a rechargeable Lithium-Ion/Polymer battery.

  Specifications about the charger can be found at:
    https://www.analog.com/en/products/ltc4162-s.html

properties:
  compatible:
    enum:
      - lltc,ltc4162-l

  reg:
    maxItems: 1
    description: I2C address of the charger.

  lltc,rsnsb-micro-ohms:
    description: Battery sense resistor in microohm.
    minimum: 1000

  lltc,rsnsi-micro-ohms:
    description: Input current sense resistor in microohm.
    minimum: 1000

  lltc,cell-count:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Number of battery cells. If not provided, will be obtained from the chip
      once the external power is applied. Omit this when the number of cells
      is somewhat dynamic. Without it, several measurements will return 0 until
      the charger is connected to an external supply.

required:
  - compatible
  - reg
  - lltc,rsnsb-micro-ohms
  - lltc,rsnsi-micro-ohms

additionalProperties: false

examples:
  - |
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;
      charger: battery-charger@68 {
              compatible = "lltc,ltc4162-l";
              reg = <0x68>;
              lltc,rsnsb-micro-ohms = <10000>;
              lltc,rsnsi-micro-ohms = <16000>;
              lltc,cell-count = <2>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/max77650-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Battery charger driver for MAX77650 PMIC from Maxim Integrated.

maintainers:
  - Bartosz Golaszewski <bgolaszewski@baylibre.com>

description: |
  This module is part of the MAX77650 MFD device. For more details
  see Documentation/devicetree/bindings/mfd/max77650.yaml.

  The charger is represented as a sub-node of the PMIC node on the device tree.

properties:
  compatible:
    const: maxim,max77650-charger

  input-voltage-min-microvolt:
    description:
      Minimum CHGIN regulation voltage.
    enum: [ 4000000, 4100000, 4200000, 4300000,
            4400000, 4500000, 4600000, 4700000 ]

  input-current-limit-microamp:
    description:
      CHGIN input current limit (in microamps).
    enum: [ 95000, 190000, 285000, 380000, 475000 ]

required:
  - compatible
additionalProperties: false

...


code:
max8925-battery bindings
~~~~~~~~~~~~~~~~

Optional properties :
 - batt-detect: whether support battery detect
 - topoff-threshold: set charging current in topoff mode
 - fast-charge: set charging current in fast mode
 - no-temp-support: whether support temperature protection detect
 - no-insert-detect: whether support insert detect

Example:
	charger {
		batt-detect = <0>;
		topoff-threshold = <1>;
		fast-charge = <7>;
		no-temp-support = <0>;
		no-insert-detect = <0>;
	};


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,ds2760.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim DS2760 DT bindings

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description: |
  The ds2760 is a w1 slave device and must hence have its sub-node in
  DT under a w1 bus master node.

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

properties:
  compatible:
    const: maxim,ds2760

  maxim,pmod-enabled:
    description: |
      Allow the DS2760 to enter sleep mode when the DQ line goes low for more than 2 seconds
      and leave sleep Mode when the DQ line goes high.
    type: boolean

  maxim,cache-time-ms:
    description: |
      Time im milliseconds to cache the data for.
      When this time expires, the values are read again from the hardware.
      Defaults to 1000.

  rated-capacity-microamp-hours:
    description: |
      The rated capacity of the battery, in mAh.
      If not specified, the value stored in the non-volatile chip memory is used.

required:
  - compatible

unevaluatedProperties: false


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max14577.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim MAX14577/MAX77836 MicroUSB and Companion Power Management IC Charger

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

description: |
  This is a part of device tree bindings for Maxim MAX14577/MAX77836 MicroUSB
  Integrated Circuit (MUIC).

  See also Documentation/devicetree/bindings/mfd/maxim,max14577.yaml for
  additional information and example.

properties:
  compatible:
    enum:
      - maxim,max14577-charger
      - maxim,max77836-charger

  maxim,constant-uvolt:
    description:
      Battery Constant Voltage in uV
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 4000000
    maximum: 4350000

  maxim,eoc-uamp:
    description: |
      Current in uA for End-Of-Charge mode.
      MAX14577: 50000-20000
      MAX77836: 5000-100000
    $ref: /schemas/types.yaml#/definitions/uint32

  maxim,fast-charge-uamp:
    description: |
      Current in uA for Fast Charge
      MAX14577: 90000-950000
      MAX77836: 45000-475000
    $ref: /schemas/types.yaml#/definitions/uint32

  maxim,ovp-uvolt:
    description:
      OverVoltage Protection Threshold in uV; In an overvoltage condition, INT
      asserts and charging stops.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [6000000, 6500000, 7000000, 7500000]

required:
  - compatible
  - maxim,constant-uvolt
  - maxim,eoc-uamp
  - maxim,fast-charge-uamp
  - maxim,ovp-uvolt

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: maxim,max14577-charger
    then:
      properties:
        maxim,eoc-uamp:
          minimum: 50000
          maximum: 200000
        maxim,fast-charge-uamp:
          minimum: 90000
          maximum: 950000
    else:
      # max77836
      properties:
        maxim,eoc-uamp:
          minimum: 5000
          maximum: 100000
        maxim,fast-charge-uamp:
          minimum: 45000
          maximum: 475000

additionalProperties: false


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max14656.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim MAX14656 DT bindings

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: maxim,max14656

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      charger-detector@35 {
        compatible = "maxim,max14656";
        reg = <0x35>;
        interrupt-parent = <&gpio6>;
        interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max17040.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim 17040 fuel gauge series

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    enum:
      - maxim,max17040
      - maxim,max17041
      - maxim,max17043
      - maxim,max17044
      - maxim,max17048
      - maxim,max17049
      - maxim,max17058
      - maxim,max17059
      - maxim,max77836-battery

  reg:
    maxItems: 1

  maxim,alert-low-soc-level:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 32
    description: |
      The alert threshold that sets the state of charge level (%) where an interrupt is generated.
      If skipped the power up default value of 4 (%) will be used.

  maxim,double-soc:
    type: boolean
    description: |
      Certain devices return double the capacity.
      Specify this to divide the reported value in 2 and thus normalize it.
      SoC == State of Charge == Capacity.

  maxim,rcomp:
    $ref: /schemas/types.yaml#/definitions/uint8-array
    minItems: 1
    maxItems: 2
    description: |
      A value to compensate readings for various battery chemistries and operating temperatures.
      max17040,41 have 2 byte rcomp, default to 0x97 0x00.
      All other devices have one byte rcomp, default to 0x97.

  interrupts:
    maxItems: 1

  wakeup-source:
    type: boolean
    description: |
      Use this property to use alert low SoC level interrupt as wake up source.

required:
  - compatible
  - reg

unevaluatedProperties: false

examples:
  - |
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@36 {
        compatible = "maxim,max17048";
        reg = <0x36>;
        maxim,rcomp = /bits/ 8 <0x56>;
        maxim,alert-low-soc-level = <10>;
        maxim,double-soc;
      };
    };
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@36 {
        compatible = "maxim,max77836-battery";
        reg = <0x36>;
        maxim,alert-low-soc-level = <10>;
        interrupt-parent = <&gpio7>;
        interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
        wakeup-source;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max17042.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim 17042 fuel gauge series

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    enum:
      - maxim,max17042
      - maxim,max17047
      - maxim,max17050
      - maxim,max17055
      - maxim,max77849-battery

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: |
      The ALRT pin, an open-drain interrupt.

  maxim,rsns-microohm:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Resistance of rsns resistor in micro Ohms (datasheet-recommended value is 10000).
      Defining this property enables current-sense functionality.

  maxim,cold-temp:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Temperature threshold to report battery as cold (in tenths of degree Celsius).
      Default is not to report cold events.

  maxim,over-heat-temp:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Temperature threshold to report battery as over heated (in tenths of degree Celsius).
      Default is not to report over heating events.

  maxim,dead-volt:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Voltage threshold to report battery as dead (in mV).
      Default is not to report dead battery events.

  maxim,over-volt:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Voltage threshold to report battery as over voltage (in mV).
      Default is not to report over-voltage events.

  power-supplies: true

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@36 {
        compatible = "maxim,max17042";
        reg = <0x36>;
        maxim,rsns-microohm = <10000>;
        maxim,over-heat-temp = <600>;
        maxim,over-volt = <4300>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max77693.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim MAX77693 MicroUSB and Companion Power Management IC Charger

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

description: |
  This is a part of device tree bindings for Maxim MAX77693 MicroUSB Integrated
  Circuit (MUIC).

  See also Documentation/devicetree/bindings/mfd/maxim,max77693.yaml for
  additional information and example.

properties:
  compatible:
    const: maxim,max77693-charger

  maxim,constant-microvolt:
    description: |
      Battery constant voltage in uV. The charger will operate in fast
      charge constant current mode till battery voltage reaches this level.
      Then the charger will switch to fast charge constant voltage mode.
      Also vsys (system voltage) will be set to this value when DC power is
      supplied but charger is not enabled.
      Valid values: 3650000 - 4400000, step by 25000 (rounded down)
    minimum: 3650000
    maximum: 4400000
    default: 4200000

  maxim,min-system-microvolt:
    description: |
      Minimal system voltage in uV.
    enum: [3000000, 3100000, 3200000, 3300000, 3400000, 3500000,
           3600000, 3700000]
    default: 3600000

  maxim,thermal-regulation-celsius:
    description: |
      Temperature in Celsius for entering high temperature charging mode.
      If die temperature exceeds this value the charging current will be
      reduced by 105 mA/Celsius.
    enum: [70, 85, 100, 115]
    default: 100

  maxim,battery-overcurrent-microamp:
    description: |
      Overcurrent protection threshold in uA (current from battery to
      system).
      Valid values: 2000000 - 3500000, step by 250000 (rounded down)
    minimum: 2000000
    maximum: 3500000
    default: 3500000

  maxim,charge-input-threshold-microvolt:
    description: |
      Threshold voltage in uV for triggering input voltage regulation loop.
      If input voltage decreases below this value, the input current will
      be reduced to reach the threshold voltage.
    enum: [4300000, 4700000, 4800000, 4900000]
    default: 4300000

required:
  - compatible

additionalProperties: false


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max77976.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim Integrated MAX77976 Battery charger

maintainers:
  - Luca Ceresoli <luca.ceresoli@bootlin.com>

description: |
  The Maxim MAX77976 is a 19Vin / 5.5A, 1-Cell Li+ battery charger
  configured via I2C.

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

properties:
  compatible:
    const: maxim,max77976

  reg:
    maxItems: 1

required:
  - compatible
  - reg

unevaluatedProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@6b {
        compatible = "maxim,max77976";
        reg = <0x6b>;
      };
    };

...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max8903.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim Semiconductor MAX8903 Battery Charger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: maxim,max8903

  dok-gpios:
    maxItems: 1
    description: Valid DC power has been detected (active low, input)

  uok-gpios:
    maxItems: 1
    description: Valid USB power has been detected (active low, input)

  cen-gpios:
    maxItems: 1
    description: Charge enable pin (active low, output)

  chg-gpios:
    maxItems: 1
    description: Charger status pin (active low, input)

  flt-gpios:
    maxItems: 1
    description: Fault pin (active low, output)

  dcm-gpios:
    maxItems: 1
    description: Current limit mode setting (DC=1 or USB=0, output)

  usus-gpios:
    maxItems: 1
    description: USB suspend pin (active high, output)

required:
  - compatible

anyOf:
  - required:
      - dok-gpios
  - required:
      - uok-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    charger {
      compatible = "maxim,max8903";
      dok-gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
      flt-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
      chg-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>;
      cen-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/mediatek,mt6370-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT6370 Battery Charger

maintainers:
  - ChiaEn Wu <chiaen_wu@richtek.com>

description: |
  This module is part of the MT6370 MFD device.
  Provides Battery Charger, Boost for OTG devices and BC1.2 detection.

properties:
  compatible:
    const: mediatek,mt6370-charger

  interrupts:
    description: |
      Specify what irqs are needed to be handled by MT6370 Charger driver.
      We need to use the IRQ "MT6370_IRQ_OVPCTRL_UVP_D" to know when USB
      is plugged in, and then the driver will enable BC1.2 detection.
      After the hardware of MT6370 completes the BC1.2 detection,
      IRQ "MT6370_IRQ_ATTACH" will be triggered, and the driver will know
      the result of BC1.2 detection.
      When the IRQ "MT6370_IRQ_CHG_MIVR" is triggered, it means that the
      hardware enters the "Minimum Input Voltage Regulation loop" and
      a workaround needs to be applied at this time.
      In summary, "MT6370_IRQ_OVPCTRL_UVP_D", "MT6370_IRQ_ATTACH" and
      "MT6370_IRQ_CHG_MIVR" are required in this charger driver.
    items:
      - description: irq of "USB is plugged in"
      - description: irq of "BC1.2 is done"
      - description: irq of "Minimum Input Voltage Regulation loop is active"

  interrupt-names:
    items:
      - const: uvp_d_evt
      - const: attach_i
      - const: mivr

  io-channels:
    description: |
      Use ADC channel to read VBUS, IBUS, IBAT, etc., info.
    minItems: 1
    items:
      - description: |
          VBUS voltage with lower accuracy (+-75mV) but higher measure
          range (1~22V)
      - description: |
          VBUS voltage with higher accuracy (+-30mV) but lower measure
          range (1~9.76V)
      - description: the main system input voltage
      - description: battery voltage
      - description: battery temperature-sense input voltage
      - description: IBUS current (required)
      - description: battery current
      - description: |
          regulated output voltage to supply for the PWM low-side gate driver
          and the bootstrap capacitor
      - description: IC junction temperature

  io-channel-names:
    minItems: 1
    items:
      - const: vbusdiv5
      - const: vbusdiv2
      - const: vsys
      - const: vbat
      - const: ts_bat
      - const: ibus
      - const: ibat
      - const: chg_vddp
      - const: temp_jc

  usb-otg-vbus-regulator:
    type: object
    description: OTG boost regulator.
    unevaluatedProperties: false
    $ref: /schemas/regulator/regulator.yaml#

    properties:
      enable-gpios:
        maxItems: 1

required:
  - compatible
  - interrupts
  - interrupt-names
  - io-channels

additionalProperties: false

...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/microchip,ucs1002.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip UCS1002 USB Port Power Controller

maintainers:
  - Sebastian Reichel <sre@kernel.org>

properties:
  compatible:
    const: microchip,ucs1002

  reg:
    maxItems: 1

  interrupts:
    maxItems: 2

  interrupt-names:
    oneOf:
      - items:
          - const: a_det
          - const: alert
      - const: a_det
      - const: alert

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        charger@32 {
            compatible = "microchip,ucs1002";
            reg = <0x32>;
            interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
                                  <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
            interrupt-names = "a_det", "alert";
       };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/mt6360_charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Battery charger driver for MT6360 PMIC from MediaTek Integrated.

maintainers:
  - Gene Chen <gene_chen@richtek.com>

description: |
  This module is part of the MT6360 MFD device.
  Provides Battery Charger, Boost for OTG devices and BC1.2 detection.

properties:
  compatible:
    const: mediatek,mt6360-chg

  richtek,vinovp-microvolt:
    description: Maximum CHGIN regulation voltage in uV.
    enum: [ 5500000, 6500000, 11000000, 14500000 ]

  usb-otg-vbus-regulator:
    type: object
    description: OTG boost regulator.
    $ref: /schemas/regulator/regulator.yaml#
    unevaluatedProperties: false

required:
  - compatible

additionalProperties: false

examples:
  - |
    mt6360_charger: charger {
      compatible = "mediatek,mt6360-chg";
      richtek,vinovp-microvolt = <14500000>;

      otg_vbus_regulator: usb-otg-vbus-regulator {
        regulator-name = "usb-otg-vbus";
        regulator-min-microvolt = <4425000>;
        regulator-max-microvolt = <5825000>;
      };
    };
...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/nokia,n900-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nokia N900 battery

maintainers:
  - Pali Rohár <pali@kernel.org>
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: nokia,n900-battery

  io-channels:
    items:
      - description: ADC channel for temperature reading
      - description: ADC channel for battery size identification
      - description: ADC channel to measure the battery voltage

  io-channel-names:
    items:
      - const: temp
      - const: bsi
      - const: vbat

required:
  - compatible
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    battery {
      compatible = "nokia,n900-battery";
      io-channels = <&twl4030_madc 0>,
                    <&twl4030_madc 4>,
                    <&twl4030_madc 12>;
      io-channel-names = "temp",
                         "bsi",
                         "vbat";
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/olpc-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: OLPC Battery

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    oneOf:
      - items:
          - const: olpc,xo1.5-battery
          - const: olpc,xo1-battery
      - items:
          - const: olpc,xo1-battery

required:
  - compatible

additionalProperties: false


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/power-supply.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Power Supply Core Support

maintainers:
  - Sebastian Reichel <sre@kernel.org>

properties:
  power-supplies:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1
    description:
      This property is added to a supply in order to list the devices which
      supply it power, referenced by their phandles.

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      The battery (with "simple-battery" compatible) being monitored by this
      power supply.

additionalProperties: true


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Switch-Mode Battery Charger and Boost

maintainers:
  - Sebastian Reichel <sre@kernel.org>

properties:
  compatible:
    enum:
      - qcom,pm8226-charger
      - qcom,pm8941-charger

  reg:
    maxItems: 1

  interrupts:
    items:
      - description: charge done
      - description: charge fast mode
      - description: charge trickle mode
      - description: battery temperature ok
      - description: battery present
      - description: charger disconnected
      - description: USB-in valid
      - description: DC-in valid

  interrupt-names:
    items:
      - const: chg-done
      - const: chg-fast
      - const: chg-trkl
      - const: bat-temp-ok
      - const: bat-present
      - const: chg-gone
      - const: usb-valid
      - const: dc-valid

  qcom,fast-charge-current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 3000000
    description: Maximum charge current in uA; May be clamped to safety limits; Defaults to 1A

  qcom,fast-charge-low-threshold-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 2100000
    maximum: 3600000
    description: |
      Battery voltage limit in uV above which fast charging may operate; Defaults to 3.2V
      Below this value linear or switch-mode auto-trickle-charging will operate.

  qcom,fast-charge-high-threshold-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 3240000
    maximum: 5000000
    description: |
      Battery voltage limit in uV below which fast charging may operate; Defaults to 4.2V
      The fast charger will attempt to charge the battery to this voltage.
      May be clamped to safety limits.

  qcom,fast-charge-safe-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 3240000
    maximum: 5000000
    description: |
      Maximum safe battery voltage in uV; May be pre-set by bootloader, in which case,
      setting this will harmlessly fail. The property 'fast-charge-high-watermark' will
      be clamped by this value. Defaults to 4.2V.

  qcom,fast-charge-safe-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 3000000
    description: |
      Maximum safe battery charge current in uA; May pre-set by bootloader, in which case,
      setting this will harmlessly fail. The property 'qcom,fast-charge-current-limit'
      will be clamped by this value. Defaults to 1A.

  qcom,auto-recharge-threshold-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 3240000
    maximum: 5000000
    description: |
      Battery voltage limit in uV below which auto-recharge functionality will restart charging
      after end-of-charge; The high cutoff limit for auto-recharge is 5% above this value.
      Defaults to 4.1V.

  qcom,minimum-input-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 4200000
    maximum: 9600000
    description: |
      Input voltage level in uV above which charging may operate. Defaults to 4.3V.

  qcom,dc-current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 2500000
    description: |
      Default DC charge current limit in uA. Defaults to 100mA.

  qcom,disable-dc:
    type: boolean
    description: Disable DC charger

  qcom,jeita-extended-temp-range:
    type: boolean
    description: |
      Enable JEITA extended temperature range;  This does *not* adjust the maximum charge
      voltage or current in the extended temperature range. It only allows charging when
      the battery is in the extended temperature range. Voltage/current regulation must
      be done externally to fully comply with the JEITA safety guidelines if this flag
      is set.

  usb-charge-current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 100000
    maximum: 2500000
    description: |
      Default USB charge current limit in uA.

  usb-otg-in-supply:
    description: Reference to the regulator supplying power to the USB_OTG_IN pin.

  otg-vbus:
    $ref: /schemas/regulator/regulator.yaml#
    description: |
      This node defines a regulator used to control the direction of VBUS voltage.
      Specifically whether to supply voltage to VBUS for host mode operation of the OTG port,
      or allow input voltage from external VBUS for charging. In the hardware, the supply for
      this regulator comes from usb_otg_in-supply.

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@1000 {
        compatible = "qcom,pm8941-charger";
        reg = <0x1000>;
        interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
                     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
        interrupt-names = "chg-done",
                          "chg-fast",
                          "chg-trkl",
                          "bat-temp-ok",
                          "bat-present",
                          "chg-gone",
                          "usb-valid",
                          "dc-valid";
        qcom,fast-charge-current-limit = <1000000>;
        qcom,dc-current-limit = <1000000>;
        usb-otg-in-supply = <&pm8941_5vs1>;

        otg-vbus {};
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm8941-coincell.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Coincell Charger

description: |
  The hardware block controls charging for a coincell or capacitor that is
  used to provide power backup for certain features of the power management
  IC (PMIC)

maintainers:
  - Sebastian Reichel <sre@kernel.org>

properties:
  compatible:
    const: qcom,pm8941-coincell

  reg:
    maxItems: 1

  qcom,rset-ohms:
    description: resistance (in ohms) for current-limiting resistor
    enum: [ 800, 1200, 1700, 2100 ]

  qcom,vset-millivolts:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: voltage (in millivolts) to apply for charging
    enum: [ 2500, 3000, 3100, 3200 ]

  qcom,charger-disable:
    type: boolean
    description: defining this property disables charging

required:
  - compatible
  - reg
  - qcom,rset-ohms
  - qcom,vset-millivolts

additionalProperties: false

examples:
  - |
    pmic {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@2800 {
        compatible = "qcom,pm8941-coincell";
        reg = <0x2800>;
        qcom,rset-ohms = <2100>;
        qcom,vset-millivolts = <3000>;
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt5033-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Richtek RT5033 PMIC Fuel Gauge

maintainers:
  - Stephan Gerhold <stephan@gerhold.net>

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

properties:
  compatible:
    const: richtek,rt5033-battery

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@35 {
        compatible = "richtek,rt5033-battery";
        reg = <0x35>;
      };
    };
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@35 {
        compatible = "richtek,rt5033-battery";
        reg = <0x35>;
        interrupt-parent = <&msmgpio>;
        interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt9455.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for Richtek rt9455 battery charger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: richtek,rt9455

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  richtek,output-charge-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: output current from the charger to the battery, in uA.

  richtek,end-of-charge-percentage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      percent of the output charge current. When the current in constant-voltage phase drops
      below output_charge_current x end-of-charge-percentage, charge is terminated.

  richtek,battery-regulation-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum battery voltage in uV.

  richtek,boost-output-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      maximum voltage provided to consumer devices, when the charger is in boost mode, in uV.

  richtek,min-input-voltage-regulation:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      input voltage level in uV, used to decrease voltage level when the over current of the
      input power source occurs. This prevents input voltage drop due to insufficient
      current provided by the power source. Defaults to 4500000 uV (4.5V).

  richtek,avg-input-current-regulation:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      input current value in uA drained by the charger from the power source.
      Defaults to 500000 uA (500mA).

required:
  - compatible
  - reg
  - interrupts
  - richtek,output-charge-current
  - richtek,end-of-charge-percentage
  - richtek,battery-regulation-voltage
  - richtek,boost-output-voltage

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@22 {
        compatible = "richtek,rt9455";
        reg = <0x22>;

        interrupt-parent = <&gpio1>;
        interrupts = <0 IRQ_TYPE_LEVEL_LOW>;

        richtek,output-charge-current	    = <500000>;
        richtek,end-of-charge-percentage    = <10>;
        richtek,battery-regulation-voltage  = <4200000>;
        richtek,boost-output-voltage	    = <5050000>;

        richtek,min-input-voltage-regulation = <4500000>;
        richtek,avg-input-current-regulation = <500000>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/rohm,bd99954.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ROHM BD99954 Battery charger

maintainers:
  - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
  - Markus Laine <markus.laine@fi.rohmeurope.com>
  - Mikko Mutanen <mikko.mutanen@fi.rohmeurope.com>

description: |
  The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion
  secondary battery intended to be used in space-constraint equipment such
  as Low profile Notebook PC, Tablets and other applications. BD99954
  provides a Dual-source Battery Charger, two port BC1.2 detection and a
  Battery Monitor.

$ref: power-supply.yaml#

properties:
  compatible:
    const: rohm,bd99954
#
#    The battery charging profile of BD99954.
#
#    Curve (1) represents charging current.
#    Curve (2) represents battery voltage.
#
#    The BD99954 data sheet divides charging to three phases.
#    a) Trickle-charge with constant current (8).
#    b) pre-charge with constant current (6)
#    c) fast-charge with:
#       First a constant current (5) phase (CC)
#       Then constant voltage (CV) phase (after the battery voltage has reached
#       target level - until charging current has dropped to termination
#       level (7)
#
#     V ^                                                        ^ I
#       .                                                        .
#       .                                                        .
# (4)- -.- - - - - - - - - - - - - -  +++++++++++++++++++++++++++.
#       .                            /                           .
#       .                     ++++++/++ - - - - - - - - - - - - -.- - (5)
#       .                     +    /  +                          .
#       .                     +   -   --                         .
#       .                     +  -     +                         .
#       .                     +.-      -:                        .
#       .                    .+         +`                       .
#       .                  .- +       | `/                       .
#       .               .."   +          .:                      .
#       .             -"      +           --                     .
#       .    (2)  ..."        +       |    :-                    .
#       .    ...""            +             -:                   .
# (3)- -.-.""- - - - -+++++++++ - - - - - - -.:- - - - - - - - - .- - (6)
#       .             +                       `:.                .
#       .             +               |         -:               .
#       .             +                           -:             .
#       .             +                             ..           .
#       .   (1)       +               |               "+++- - - -.- - (7)
#       -++++++++++++++- - - - - - - - - - - - - - - - - + - - - .- - (8)
#       .                                                +       -
#       -------------------------------------------------+++++++++-->
#       |             |       |   CC   |      CV         |
#       | --trickle-- | -pre- | ---------fast----------- |
#
#   The charger uses the following battery properties
# - trickle-charge-current-microamp:
#     Current used at trickle-charge phase (8 in above chart)
#     minimum: 64000
#     maximum: 1024000
#     multipleOf: 64000
# - precharge-current-microamp:
#     Current used at pre-charge phase (6 in above chart)
#     minimum: 64000
#     maximum: 1024000
#     multipleOf: 64000
# - constant-charge-current-max-microamp
#     Current used at fast charge constant current phase (5 in above chart)
#     minimum: 64000
#     maximum: 1024000
#     multipleOf: 64000
# - constant-charge-voltage-max-microvolt
#     The constant voltage used in fast charging phase (4 in above chart)
#     minimum: 2560000
#     maximum: 19200000
#     multipleOf: 16000
# - precharge-upper-limit-microvolt
#     charging mode is changed from trickle charging to pre-charging
#     when battery voltage exceeds this limit voltage (3 in above chart)
#     minimum: 2048000
#     maximum: 19200000
#     multipleOf: 64000
# - re-charge-voltage-microvolt
#     minimum: 2560000
#     maximum: 19200000
#     multipleOf: 16000
#     re-charging is automatically started when battry has been discharging
#     to the point where the battery voltage drops below this limit
# - over-voltage-threshold-microvolt
#     battery is expected to be faulty if battery voltage exceeds this limit.
#     Charger will then enter to a "battery faulty" -state
#     minimum: 2560000
#     maximum: 19200000
#     multipleOf: 16000
# - charge-term-current-microamp
#     minimum: 0
#     maximum: 1024000
#     multipleOf: 64000
#     a charge cycle terminates when the battery voltage is above recharge
#     threshold, and the current is below this setting (7 in above chart)
#   See also Documentation/devicetree/bindings/power/supply/battery.yaml

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  monitored-battery:
    description:
      phandle of battery characteristics devicetree node

  rohm,vsys-regulation-microvolt:
    description: system specific lower limit for system voltage.
    minimum: 2560000
    maximum: 19200000
    multipleOf: 64000

  rohm,vbus-input-current-limit-microamp:
    description: system specific VBUS input current limit (in microamps).
    minimum: 32000
    maximum: 16352000
    multipleOf: 32000

  rohm,vcc-input-current-limit-microamp:
    description: system specific VCC/VACP input current limit (in microamps).
    minimum: 32000
    maximum: 16352000
    multipleOf: 32000

required:
  - compatible

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        charger@9 {
            compatible = "rohm,bd99954";
            monitored-battery = <&battery>;
            reg = <0x9>;
            interrupt-parent = <&gpio1>;
            interrupts = <29 8>;
            rohm,vsys-regulation-microvolt = <8960000>;
            rohm,vbus-input-current-limit-microamp = <1472000>;
            rohm,vcc-input-current-limit-microamp = <1472000>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/samsung,battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung SDI Batteries

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

description: |
  Samsung SDI (Samsung Digital Interface) batteries are all different versions
  of lithium ion chemistry devices used for mobile phones, laptops and other
  portable electronics. The batteries are adapted to a specific product and
  the physical restrictions make it impossible to use another battery with the
  product, so product device trees can specify these batteries. Operating
  systems should determine hardware characteristics of the batteries from the
  compatible string.

properties:
  compatible:
    oneOf:
      - const: samsung,eb-l1m7flu
        description: 3.8V 1500 mAh battery used in Samsung GT-I8190
      - const: samsung,eb425161la
        description: 3.8V 1500 mAh battery used in Samsung SGH-T599 and SGH-I407
      - const: samsung,eb425161lu
        description: 3.8V 1500 mAh battery used in Samsung GT-I8160
      - const: samsung,eb485159lu
        description: 3.8V 1700 mAh battery used in Samsung GT-S7710
      - const: samsung,eb535151vu
        description: 3.8V 1500 mAh battery used in Samsung GT-I9070
      - const: samsung,eb585157lu
        description: 3.8V 2000 mAh battery used in Samsung GT-I8530

required:
  - compatible

additionalProperties: false

examples:
  - |
    power {
      #address-cells = <1>;
      #size-cells = <0>;

      battery: battery {
        compatible = "samsung,eb425161la";
      };

      charger@11 {
        reg = <0x11>;
        monitored-battery = <&battery>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/sbs,sbs-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SBS compliant battery

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description: |
  Battery compatible with the smart battery system specifications

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

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - ti,bq20z45
              - ti,bq20z65
              - ti,bq20z75
          - enum:
              - sbs,sbs-battery
      - items:
          - const: sbs,sbs-battery

  reg:
    maxItems: 1

  sbs,i2c-retry-count:
    description:
      The number of times to retry I2C transactions on I2C IO failure.
    default: 0
    $ref: /schemas/types.yaml#/definitions/uint32

  sbs,poll-retry-count:
    description:
      The number of times to try looking for new status after an external
      change notification.
    default: 0
    $ref: /schemas/types.yaml#/definitions/uint32

  sbs,battery-detect-gpios:
    description:
      GPIO which signals battery detection. If this is not supplied, the bus
      needs to be polled to detect the battery.
    maxItems: 1

  sbs,disable-charger-broadcasts:
    description:
      SBS batteries by default send broadcast messages to SBS compliant chargers to
      configure max. charge current/voltage. If your hardware does not have an SBS
      compliant charger it should be disabled via this property to avoid blocking
      the bus. Also some SBS battery fuel gauges are known to have a buggy multi-
      master implementation.
    type: boolean

required:
  - compatible
  - reg

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        battery@b {
            compatible = "ti,bq20z75", "sbs,sbs-battery";
            reg = <0xb>;
            sbs,i2c-retry-count = <2>;
            sbs,poll-retry-count = <10>;
            sbs,battery-detect-gpios = <&gpio 122 GPIO_ACTIVE_HIGH>;
            sbs,disable-charger-broadcasts;
       };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/sbs,sbs-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SBS compliant charger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description: |
  Charger compatible with the smart battery system specifications

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

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - lltc,ltc4100
          - enum:
              - sbs,sbs-charger
      - items:
          - const: sbs,sbs-charger

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        charger@9 {
            compatible = "lltc,ltc4100", "sbs,sbs-charger";
            reg = <0x9>;
            interrupt-parent = <&gpio6>;
            interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
       };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/sbs,sbs-manager.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SBS compliant manger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - lltc,ltc1760
          - enum:
              - sbs,sbs-manager
      - items:
          - const: sbs,sbs-manager

  reg:
    const: 0xa

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  gpio-controller: true

  "#gpio-cells":
    const: 2

required:
  - compatible
  - reg

additionalProperties: false

patternProperties:
  "^i2c@[1-4]$":
    type: object
    $ref: /schemas/i2c/i2c-controller.yaml#

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/gpio/gpio.h>

    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      batman: battery-manager@a {
        compatible = "lltc,ltc1760", "sbs,sbs-manager";
        reg = <0x0a>;
        #address-cells = <1>;
        #size-cells = <0>;

        gpio-controller;
        #gpio-cells = <2>;

        i2c@1 {
          #address-cells = <1>;
          #size-cells = <0>;
          reg = <1>;

          battery@b {
            compatible = "ti,bq20z65", "sbs,sbs-battery";
            reg = <0x0b>;
            sbs,battery-detect-gpios = <&batman 1 1>;
          };
        };

        i2c@2 {
          #address-cells = <1>;
          #size-cells = <0>;
          reg = <2>;

          battery@b {
            compatible = "ti,bq20z65", "sbs,sbs-battery";
            reg = <0x0b>;
            sbs,battery-detect-gpios = <&batman 2 1>;
          };
        };

        i2c@3 {
          #address-cells = <1>;
          #size-cells = <0>;
          reg = <3>;

          battery@b {
            compatible = "ti,bq20z65", "sbs,sbs-battery";
            reg = <0x0b>;
            sbs,battery-detect-gpios = <&batman 3 1>;
          };
        };
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/sc2731-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Spreadtrum SC2731 PMICs battery charger binding

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: sprd,sc2731-charger

  reg:
    maxItems: 1

  phys:
    maxItems: 1
    description: phandle to the USB phy

  monitored-battery:
    description: |
      The charger uses the following battery properties
      - charge-term-current-microamp: current for charge termination phase.
      - constant-charge-voltage-max-microvolt: maximum constant input voltage.

additionalProperties: false

examples:
  - |
    bat: battery {
      compatible = "simple-battery";
      charge-term-current-microamp = <120000>;
      constant-charge-voltage-max-microvolt = <4350000>;
    };

    pmic {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@a00 {
        compatible = "sprd,sc2731-charger";
        reg = <0x0>;
        phys = <&ssphy>;
        monitored-battery = <&bat>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/sc27xx-fg.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Spreadtrum SC27XX PMICs Fuel Gauge Unit Power Supply Bindings

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    enum:
      - sprd,sc2720-fgu
      - sprd,sc2721-fgu
      - sprd,sc2723-fgu
      - sprd,sc2730-fgu
      - sprd,sc2731-fgu

  reg:
    maxItems: 1

  battery-detect-gpios:
    maxItems: 1

  io-channels:
    items:
      - description: Battery Temperature ADC
      - description: Battery Charge Voltage ADC

  io-channel-names:
    items:
      - const: bat-temp
      - const: charge-vol

  nvmem-cells:
    maxItems: 1
    description: Calibration cells provided by eFuse device

  nvmem-cell-names:
    const: fgu_calib

  sprd,calib-resistance-micro-ohms:
    description: real resistance of coulomb counter chip in micro Ohms

  monitored-battery: true

required:
  - compatible
  - reg
  - battery-detect-gpios
  - io-channels
  - io-channel-names
  - nvmem-cells
  - nvmem-cell-names
  - sprd,calib-resistance-micro-ohms
  - monitored-battery

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    bat: battery {
      compatible = "simple-battery";
      charge-full-design-microamp-hours = <1900000>;
      constant-charge-voltage-max-microvolt = <4350000>;
      ocv-capacity-celsius = <20>;
      ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>,
                             <4022000 85>, <3983000 80>, <3949000 75>,
                             <3917000 70>, <3889000 65>, <3864000 60>,
                             <3835000 55>, <3805000 50>, <3787000 45>,
                             <3777000 40>, <3773000 35>, <3770000 30>,
                             <3765000 25>, <3752000 20>, <3724000 15>,
                             <3680000 10>, <3605000 5>, <3400000 0>;
                             // ...
    };

    pmic {
      #address-cells = <1>;
      #size-cells = <0>;

      battery@a00 {
        compatible = "sprd,sc2731-fgu";
        reg = <0xa00>;
        battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
        io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
        io-channel-names = "bat-temp", "charge-vol";
        nvmem-cells = <&fgu_calib>;
        nvmem-cell-names = "fgu_calib";
        monitored-battery = <&bat>;
        sprd,calib-resistance-micro-ohms = <21500>;
      };
    };


code:
AB85000 PMIC contains a node, which contains shared
information about the battery connected to the PMIC.
The node has no compatible property.

Properties of this node are:

thermistor-on-batctrl:
	A boolean value indicating thermistor interface	to battery

	Note:
	'btemp' and 'batctrl' are the pins interfaced for battery temperature
	measurement, 'btemp' signal is used when NTC(negative temperature
	coefficient) resister is interfaced external to battery whereas
	'batctrl' pin is used when NTC resister is internal to battery.

	Example:
	ab8500_battery: ab8500_battery {
		thermistor-on-batctrl;
	};
	indicates: NTC resister is internal to battery, 'batctrl' is used
		for thermal measurement.

	The absence of property 'thermal-on-batctrl' indicates
	NTC resister is external to battery and  'btemp' signal is used
	for thermal measurement.

battery-type:
	This shall be the battery manufacturing technology type,
	allowed types are:
		"UNKNOWN" "NiMH" "LION" "LIPO" "LiFe" "NiCd" "LiMn"
	Example:
	ab8500_battery: ab8500_battery {
		stericsson,battery-type = "LIPO";
	}


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/stericsson,ab8500-btemp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AB8500 Battery Temperature Monitor

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: stericsson,ab8500-btemp

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to battery node

  battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true

  interrupts:
    maxItems: 5

  interrupt-names:
    items:
      - const: BAT_CTRL_INDB
      - const: BTEMP_LOW
      - const: BTEMP_HIGH
      - const: BTEMP_LOW_MEDIUM
      - const: BTEMP_MEDIUM_HIGH

  io-channels:
    maxItems: 2

  io-channel-names:
    items:
      - const: btemp_ball
      - const: bat_ctrl

required:
  - compatible
  - monitored-battery
  - interrupts
  - interrupt-names
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      battery-temperature {
        compatible = "stericsson,ab8500-btemp";
        monitored-battery = <&battery>;
        interrupts = <20 IRQ_TYPE_LEVEL_HIGH>,
                     <80 IRQ_TYPE_LEVEL_HIGH>,
                     <83 IRQ_TYPE_LEVEL_HIGH>,
                     <81 IRQ_TYPE_LEVEL_HIGH>,
                     <82 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "BAT_CTRL_INDB",
                          "BTEMP_LOW",
                          "BTEMP_HIGH",
                          "BTEMP_LOW_MEDIUM",
                          "BTEMP_MEDIUM_HIGH";
        io-channels = <&gpadc 0x02>, <&gpadc 0x01>;
        io-channel-names = "btemp_ball", "bat_ctrl";
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/stericsson,ab8500-chargalg.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AB8500 Charging Algorithm

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: stericsson,ab8500-chargalg

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to battery node

  battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true

required:
  - compatible
  - monitored-battery

additionalProperties: false

examples:
  - |
    pmic {
      charging-algorithm {
        compatible = "stericsson,ab8500-chargalg";
        monitored-battery = <&ab8500_battery>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/stericsson,ab8500-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AB8500 Charger

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: stericsson,ab8500-charger

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to battery node

  battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true

  vddadc-supply:
    description: Supply for USB and Main charger

  autopower_cfg:
    type: boolean
    description: automatic poweron after powerloss

  interrupts:
    maxItems: 14

  interrupt-names:
    items:
      - const: MAIN_CH_UNPLUG_DET
      - const: MAIN_CHARGE_PLUG_DET
      - const: MAIN_EXT_CH_NOT_OK
      - const: MAIN_CH_TH_PROT_R
      - const: MAIN_CH_TH_PROT_F
      - const: VBUS_DET_F
      - const: VBUS_DET_R
      - const: USB_LINK_STATUS
      - const: USB_CH_TH_PROT_R
      - const: USB_CH_TH_PROT_F
      - const: USB_CHARGER_NOT_OKR
      - const: VBUS_OVV
      - const: CH_WD_EXP
      - const: VBUS_CH_DROP_END

  io-channels:
    minItems: 2
    maxItems: 4

  io-channel-names:
    oneOf:
      - items:
          - const: main_charger_v
          - const: main_charger_c
          - const: vbus_v
          - const: usb_charger_c
      - items:
          - const: vbus_v
          - const: usb_charger_c

required:
  - compatible
  - monitored-battery
  - vddadc-supply
  - interrupts
  - interrupt-names
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      charger {
        compatible = "stericsson,ab8500-charger";
        monitored-battery = <&battery>;
        vddadc-supply = <&ab8500_ldo_tvout_reg>;
        interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
                     <11 IRQ_TYPE_LEVEL_HIGH>,
                     <0 IRQ_TYPE_LEVEL_HIGH>,
                     <107 IRQ_TYPE_LEVEL_HIGH>,
                     <106 IRQ_TYPE_LEVEL_HIGH>,
                     <14 IRQ_TYPE_LEVEL_HIGH>,
                     <15 IRQ_TYPE_LEVEL_HIGH>,
                     <79 IRQ_TYPE_LEVEL_HIGH>,
                     <105 IRQ_TYPE_LEVEL_HIGH>,
                     <104 IRQ_TYPE_LEVEL_HIGH>,
                     <89 IRQ_TYPE_LEVEL_HIGH>,
                     <22 IRQ_TYPE_LEVEL_HIGH>,
                     <21 IRQ_TYPE_LEVEL_HIGH>,
                     <16 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "MAIN_CH_UNPLUG_DET",
                          "MAIN_CHARGE_PLUG_DET",
                          "MAIN_EXT_CH_NOT_OK",
                          "MAIN_CH_TH_PROT_R",
                          "MAIN_CH_TH_PROT_F",
                          "VBUS_DET_F",
                          "VBUS_DET_R",
                          "USB_LINK_STATUS",
                          "USB_CH_TH_PROT_R",
                          "USB_CH_TH_PROT_F",
                          "USB_CHARGER_NOT_OKR",
                          "VBUS_OVV",
                          "CH_WD_EXP",
                          "VBUS_CH_DROP_END";
        io-channels = <&gpadc 0x03>,
                      <&gpadc 0x0a>,
                      <&gpadc 0x09>,
                      <&gpadc 0x0b>;
        io-channel-names = "main_charger_v",
                           "main_charger_c",
                           "vbus_v",
                           "usb_charger_c";
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/stericsson,ab8500-fg.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AB8500 Fuel Gauge

maintainers:
  - Sebastian Reichel <sre@kernel.org>

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

properties:
  compatible:
    const: stericsson,ab8500-fg

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to battery node

  battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true

  line-impedance-micro-ohms:
    description: The line impedance between the battery and the
      AB8500 inputs, to compensate for this when determining internal
      resistance.

  interrupts:
    maxItems: 5

  interrupt-names:
    items:
      - const: NCONV_ACCU
      - const: BATT_OVV
      - const: LOW_BAT_F
      - const: CC_INT_CALIB
      - const: CCEOC

  io-channels:
    maxItems: 1

  io-channel-names:
    items:
      - const: main_bat_v

required:
  - compatible
  - monitored-battery
  - interrupts
  - interrupt-names
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      fuel-gauge {
        compatible = "stericsson,ab8500-fg";
        monitored-battery = <&battery>;
        interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
                     <8 IRQ_TYPE_LEVEL_HIGH>,
                     <28 IRQ_TYPE_LEVEL_HIGH>,
                     <27 IRQ_TYPE_LEVEL_HIGH>,
                     <26 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "NCONV_ACCU",
                          "BATT_OVV",
                          "LOW_BAT_F",
                          "CC_INT_CALIB",
                          "CCEOC";
        io-channels = <&gpadc 0x08>;
        io-channel-names = "main_bat_v";
      };
    };