Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -0,0 +1,70 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/adc-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ADC battery
maintainers:
- Sebastian Reichel <sre@kernel.org>
description:
Basic battery capacity meter, which only reports basic battery data
via ADC channels and optionally indicate that the battery is full by
polling a GPIO line.
The voltage is expected to be measured between the battery terminals
and mandatory. The optional current/power channel is expected to
monitor the current/power flowing out of the battery. Last but not
least the temperature channel is supposed to measure the battery
temperature.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: adc-battery
charged-gpios:
description:
GPIO which signals that the battery is fully charged. The GPIO is
often provided by charger ICs, that are not software controllable.
maxItems: 1
io-channels:
minItems: 1
maxItems: 4
io-channel-names:
minItems: 1
items:
- const: voltage
- enum: [ current, power, temperature ]
- enum: [ power, temperature ]
- const: temperature
monitored-battery: true
required:
- compatible
- io-channels
- io-channel-names
- monitored-battery
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
fuel-gauge {
compatible = "adc-battery";
charged-gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
io-channels = <&adc 13>, <&adc 37>;
io-channel-names = "voltage", "current";
power-supplies = <&charger>;
monitored-battery = <&battery>;
};
@@ -0,0 +1,215 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Battery Characteristics
maintainers:
- Sebastian Reichel <sre@kernel.org>
description: |
The devicetree battery node provides static battery characteristics.
In smart batteries, these are typically stored in non-volatile memory
on a fuel gauge chip. The battery node should be used where there is
no appropriate non-volatile memory, or it is unprogrammed/incorrect.
Upstream dts files should not include battery nodes, unless the battery
represented cannot easily be replaced in the system by one of a
different type. This prevents unpredictable, potentially harmful,
behavior should a replacement that changes the battery type occur
without a corresponding update to the dtb.
Battery properties are named, where possible, for the corresponding elements
in enum power_supply_property, defined in include/linux/power_supply.h
Batteries must be referenced by chargers and/or fuel-gauges using a phandle.
The phandle's property should be named "monitored-battery".
properties:
compatible:
const: simple-battery
device-chemistry:
description: This describes the chemical technology of the battery.
oneOf:
- const: nickel-cadmium
- const: nickel-metal-hydride
- const: lithium-ion
description: This is a blanket type for all lithium-ion batteries,
including those below. If possible, a precise compatible string
from below should be used, but sometimes it is unknown which specific
lithium ion battery is employed and this wide compatible can be used.
- const: lithium-ion-polymer
- const: lithium-ion-iron-phosphate
- const: lithium-ion-manganese-oxide
over-voltage-threshold-microvolt:
description: battery over-voltage limit
re-charge-voltage-microvolt:
description: limit to automatically start charging again
voltage-min-design-microvolt:
description: drained battery voltage
voltage-max-design-microvolt:
description: fully charged battery voltage
energy-full-design-microwatt-hours:
description: battery design energy
charge-full-design-microamp-hours:
description: battery design capacity
trickle-charge-current-microamp:
description: current for trickle-charge phase.
Please note that the trickle-charging here, refers "wake-up" or
"pre-pre" -charging, for very empty batteries. Similar term is also
used for "maintenance" or "top-off" -charging of batteries (like
NiMh bq24400) - that is different and not controlled by this
property.
tricklecharge-upper-limit-microvolt:
description: limit when to change to precharge from trickle charge
Trickle-charging here refers "wake-up" or "pre-pre" -charging.
precharge-current-microamp:
description: current for pre-charge phase
precharge-upper-limit-microvolt:
description: limit when to change to constant charging
charge-term-current-microamp:
description: current for charge termination phase
constant-charge-current-max-microamp:
description: maximum constant input current
constant-charge-voltage-max-microvolt:
description: maximum constant input voltage
factory-internal-resistance-micro-ohms:
description: battery factory internal resistance
resistance-temp-table:
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
items:
- description: the temperature in degree Celsius
- description: battery internal resistance percent
description: |
A table providing the temperature in degree Celsius
and corresponding battery internal resistance percent, which is used to
look up the resistance percent according to current temperature to get an
accurate batterty internal resistance in different temperatures.
ocv-capacity-celsius:
description: |
An array containing the temperature in degree Celsius,
for each of the battery capacity lookup table.
operating-range-celsius:
description: operating temperature range of a battery
items:
- description: minimum temperature at which battery can operate
- description: maximum temperature at which battery can operate
ambient-celsius:
description: safe range of ambient temperature
items:
- description: alert when ambient temperature is lower than this value
- description: alert when ambient temperature is higher than this value
alert-celsius:
description: safe range of battery temperature
items:
- description: alert when battery temperature is lower than this value
- description: alert when battery temperature is higher than this value
# The volt-drop* -properties describe voltage-drop for a battery, described
# as VDROP in:
# https://patentimages.storage.googleapis.com/6c/f5/17/c1d901c220f6a9/US20150032394A1.pdf
volt-drop-thresh-microvolt:
description: Threshold for starting the VDR correction
maximum: 48000000
volt-drop-soc-bp:
description: Table of capacity values matching the values in VDR tables.
The value should be given as basis points, 1/100 of a percent.
volt-drop-temperatures-millicelsius:
description: An array containing the temperature in milli celsius, for each
of the VDR lookup table.
required:
- compatible
patternProperties:
'^ocv-capacity-table-[0-9]+$':
$ref: /schemas/types.yaml#/definitions/uint32-matrix
description: |
An array providing the open circuit voltage (OCV)
of the battery and corresponding battery capacity percent, which is used
to look up battery capacity according to current OCV value. And the open
circuit voltage unit is microvolt.
maxItems: 100
items:
items:
- description: open circuit voltage (OCV) in microvolts
- description: battery capacity percent
maximum: 100
'^volt-drop-[0-9]-microvolt':
description: Table of the voltage drop rate (VDR) values. Each entry in the
table should match a capacity value in the volt-drop-soc table.
Furthermore, the values should be obtained for the temperature given in
volt-drop-temperatures-millicelsius table at index matching the
number in this table's name.
additionalProperties: false
examples:
- |
power {
#address-cells = <1>;
#size-cells = <0>;
battery: battery {
compatible = "simple-battery";
over-voltage-threshold-microvolt = <4500000>;
re-charge-voltage-microvolt = <250000>;
voltage-min-design-microvolt = <3200000>;
voltage-max-design-microvolt = <4200000>;
energy-full-design-microwatt-hours = <5290000>;
charge-full-design-microamp-hours = <1430000>;
precharge-current-microamp = <256000>;
precharge-upper-limit-microvolt = <2500000>;
charge-term-current-microamp = <128000>;
constant-charge-current-max-microamp = <900000>;
constant-charge-voltage-max-microvolt = <4200000>;
factory-internal-resistance-micro-ohms = <250000>;
ocv-capacity-celsius = <(-10) 0 10>;
/* table for -10 degree Celsius */
ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>;
/* table for 0 degree Celsius */
ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>;
/* table for 10 degree Celsius */
ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>;
resistance-temp-table = <20 100>, <10 90>, <0 80>, <(-10) 60>;
operating-range-celsius = <(-30) 50>;
ambient-celsius = <(-5) 50>;
alert-celsius = <0 40>;
};
charger@11 {
reg = <0x11>;
monitored-battery = <&battery>;
};
fuel-gauge@22 {
reg = <0x22>;
monitored-battery = <&battery>;
};
};
@@ -0,0 +1,97 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq2415x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI bq2415x Li-Ion Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
enum:
- ti,bq24150
- ti,bq24150a
- ti,bq24151
- ti,bq24151a
- ti,bq24152
- ti,bq24153
- ti,bq24153a
- ti,bq24155
- ti,bq24156
- ti,bq24156a
- ti,bq24158
reg:
maxItems: 1
ti,current-limit:
$ref: /schemas/types.yaml#/definitions/uint32
description: initial maximum current charger can pull from power supply in mA.
ti,weak-battery-voltage:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
weak battery voltage threshold in mV.
The chip will use slow precharge if battery voltage is below this value.
ti,battery-regulation-voltage:
$ref: /schemas/types.yaml#/definitions/uint32
description: maximum charging voltage in mV.
ti,charge-current:
$ref: /schemas/types.yaml#/definitions/uint32
description: maximum charging current in mA.
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 mA).
ti,resistor-sense:
$ref: /schemas/types.yaml#/definitions/uint32
description: value of sensing resistor in milliohm.
ti,usb-charger-detection:
$ref: /schemas/types.yaml#/definitions/phandle
description: phandle to usb charger detection device (required for auto mode)
required:
- compatible
- reg
- ti,current-limit
- ti,weak-battery-voltage
- ti,battery-regulation-voltage
- ti,charge-current
- ti,termination-current
- ti,resistor-sense
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@6b {
compatible = "ti,bq24150a";
reg = <0x6b>;
ti,current-limit = <100>;
ti,weak-battery-voltage = <3400>;
ti,battery-regulation-voltage = <4200>;
ti,charge-current = <650>;
ti,termination-current = <100>;
ti,resistor-sense = <68>;
ti,usb-charger-detection = <&isp1704>;
};
};
@@ -0,0 +1,100 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq24190.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI BQ2419x Li-Ion Battery Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
enum:
- ti,bq24190
- ti,bq24192
- ti,bq24192i
- ti,bq24193
- ti,bq24196
- ti,bq24296
- ti,bq24297
reg:
maxItems: 1
interrupts:
maxItems: 1
ce-gpios:
description:
Active low Charge Enable pin. Battery charging is enabled when
REG01[5:4] = 01 and CE pin is Low. CE pin must be pulled high or low.
maxItems: 1
usb-otg-vbus:
$ref: /schemas/regulator/regulator.yaml#
description: |
Regulator that is used to control the VBUS voltage direction for
either USB host mode or for charging on the OTG port
ti,system-minimum-microvolt:
description: |
when power is connected and the battery is below minimum system voltage,
the system will be regulated above this setting.
omit-battery-class:
type: boolean
description: |
If this property is set, the operating system does not try to create a
battery device.
monitored-battery:
description: |
phandle to a "simple-battery" compatible node.
This property must be a phandle to a node using the format described
in battery.yaml, with the following properties being required:
- precharge-current-microamp: maximum charge current during precharge phase
(typically 20% of battery capacity).
- charge-term-current-microamp: a charge cycle terminates when the battery voltage is
above recharge threshold, and the current is below this
setting (typically 10% of battery capacity).
required:
- compatible
- reg
- interrupts
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
bat: battery {
compatible = "simple-battery";
precharge-current-microamp = <256000>;
charge-term-current-microamp = <128000>;
};
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@6a {
compatible = "ti,bq24190";
reg = <0x6a>;
interrupt-parent = <&gpiochip>;
interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
monitored-battery = <&bat>;
ti,system-minimum-microvolt = <3200000>;
usb_otg_vbus: usb-otg-vbus { };
};
};
@@ -0,0 +1,124 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq24257.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Bq24250, bq24251 and bq24257 Li-Ion Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
enum:
- ti,bq24250
- ti,bq24251
- ti,bq24257
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)
pg-gpios:
description: |
GPIO used for connecting the bq2425x device PG (Power Good) pin.
This pin is not available on all devices however it should be used if
possible as this is the recommended way to obtain the charger's input PG
state. If this pin is not specified a software-based approach for PG
detection is used.
maxItems: 1
ti,current-limit:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
The maximum current to be drawn from the charger's input (in uA).
If this property is not specified, the input limit current is set
automatically using USB D+/D- signal based charger type detection.
If the hardware does not support the D+/D- based detection, a default
of 500,000 is used (=500mA) instead.
ti,ovp-voltage:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Configures the over voltage protection voltage (in uV).
If not specified a default of 6,5000,000 (=6.5V) is used.
ti,in-dpm-voltage:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Configures the threshold input voltage for the dynamic power path management (in uV).
If not specified a default of 4,360,000 (=4.36V) is used.
required:
- compatible
- reg
- interrupts
- ti,battery-regulation-voltage
- ti,charge-current
- ti,termination-current
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@6a {
compatible = "ti,bq24257";
reg = <0x6a>;
interrupt-parent = <&gpio1>;
interrupts = <16 IRQ_TYPE_EDGE_BOTH>;
pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
ti,battery-regulation-voltage = <4200000>;
ti,charge-current = <1000000>;
ti,termination-current = <50000>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@6a {
compatible = "ti,bq24250";
reg = <0x6a>;
interrupt-parent = <&gpio1>;
interrupts = <16 IRQ_TYPE_EDGE_BOTH>;
ti,battery-regulation-voltage = <4200000>;
ti,charge-current = <500000>;
ti,termination-current = <50000>;
ti,current-limit = <900000>;
ti,ovp-voltage = <9500000>;
ti,in-dpm-voltage = <4440000>;
};
};
@@ -0,0 +1,89 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq24735.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI BQ24735 Li-Ion Battery Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: ti,bq24735
reg:
maxItems: 1
interrupts:
description: AC adapter plug event interrupt
maxItems: 1
ti,ac-detect-gpios:
maxItems: 1
description: |
This GPIO is optionally used to read the AC adapter status. This is a Host GPIO
that is configured as an input and connected to the ACOK pin on the bq24735.
Note: for backwards compatibility reasons, the GPIO must be active on AC adapter
absence despite ACOK being active (high) on AC adapter presence.
ti,charge-current:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Used to control and set the charging current.
This value must be between 128mA and 8.128A with a 64mA step resolution.
The POR value is 0x0000h. This number is in mA (e.g. 8192).
See spec for more information about the ChargeCurrent (0x14h) register.
ti,charge-voltage:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Used to control and set the charging voltage.
This value must be between 1.024V and 19.2V with a 16mV step resolution.
The POR value is 0x0000h. This number is in mV (e.g. 19200).
See spec for more information about the ChargeVoltage (0x15h) register.
ti,input-current:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Used to control and set the charger input current.
This value must be between 128mA and 8.064A with a 128mA step resolution.
The POR value is 0x1000h. This number is in mA (e.g. 8064).
See the spec for more information about the InputCurrent (0x3fh) register.
ti,external-control:
type: boolean
description: |
Indicates that the charger is configured externally and that the host should not
attempt to enable/disable charging or set the charge voltage/current.
poll-interval:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
If 'interrupts' is not specified, poll AC adapter presence with this interval (milliseconds).
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@9 {
compatible = "ti,bq24735";
reg = <0x9>;
ti,ac-detect-gpios = <&gpio 72 0x1>;
};
};
@@ -0,0 +1,92 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright (C) 2020 Texas Instruments Incorporated
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq2515x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI bq2515x 500-mA Linear charger family
maintainers:
- Andrew Davis <afd@ti.com>
description: |
The BQ2515x family is a highly integrated battery charge management IC that
integrates the most common functions for wearable devices, namely a charger,
an output voltage rail, ADC for battery and system monitoring, and
push-button controller.
Specifications about the charger can be found at:
http://www.ti.com/lit/ds/symlink/bq25150.pdf
http://www.ti.com/lit/ds/symlink/bq25155.pdf
properties:
compatible:
enum:
- ti,bq25150
- ti,bq25155
reg:
maxItems: 1
description: I2C address of the charger.
ac-detect-gpios:
description: |
GPIO used for connecting the bq2515x device PG (AC Detect)
pin.
maxItems: 1
reset-gpios:
description: GPIO used for hardware reset.
maxItems: 1
powerdown-gpios:
description: GPIO used for low power mode of IC.
maxItems: 1
charge-enable-gpios:
description: GPIO used to turn on and off charging.
maxItems: 1
input-current-limit-microamp:
description: Maximum input current in micro Amps.
minimum: 50000
maximum: 500000
monitored-battery: true
required:
- compatible
- reg
- monitored-battery
allOf:
- $ref: power-supply.yaml#
additionalProperties: false
examples:
- |
bat: battery {
compatible = "simple-battery";
constant-charge-current-max-microamp = <50000>;
precharge-current-microamp = <2500>;
constant-charge-voltage-max-microvolt = <4000000>;
};
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
bq25150: charger@6b {
compatible = "ti,bq25150";
reg = <0x6b>;
monitored-battery = <&bat>;
input-current-limit-microamp = <100000>;
ac-detect-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
powerdown-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
charge-enable-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
};
@@ -0,0 +1,126 @@
# 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: true
interrupts:
maxItems: 1
description: |
Interrupt sends an active low, 256 μs pulse to host to report the charger
device status and faults.
ti,no-thermistor:
type: boolean
description: Indicates that no thermistor is connected to the TS pin
required:
- compatible
- reg
- monitored-battery
allOf:
- $ref: power-supply.yaml#
- if:
properties:
compatible:
contains:
enum:
- ti,bq25600
- ti,bq25601
- ti,bq25600d
- ti,bq25601d
then:
properties:
ti,no-thermistor: false
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>;
};
};
...
@@ -0,0 +1,127 @@
# 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: 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>
i2c {
#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>;
};
};
@@ -0,0 +1,112 @@
# 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: true
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>
i2c {
#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>;
};
};
...
@@ -0,0 +1,125 @@
# 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
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.
interrupts:
maxItems: 1
description: the SOC_INT or GPOUT pin
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
allOf:
- $ref: power-supply.yaml#
- if:
properties:
compatible:
contains:
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,bq27521
- ti,bq27541
- ti,bq27542
- ti,bq27546
- ti,bq27742
- ti,bq27545
- ti,bq27411
- ti,bq27z561
- ti,bq28z610
- ti,bq34z100
- ti,bq78z100
then:
properties:
interrupts: false
required:
- compatible
- reg
additionalProperties: false
examples:
- |
bat: battery {
compatible = "simple-battery";
voltage-min-design-microvolt = <3200000>;
energy-full-design-microwatt-hours = <5290000>;
charge-full-design-microamp-hours = <1430000>;
};
i2c {
#address-cells = <1>;
#size-cells = <0>;
bq27510g3: fuel-gauge@55 {
compatible = "ti,bq27510g3";
reg = <0x55>;
monitored-battery = <&bat>;
};
};
@@ -0,0 +1,217 @@
# 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>;
};
};
};
@@ -0,0 +1,88 @@
# 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
monitored-battery: true
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>;
};
};
@@ -0,0 +1,106 @@
# 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";
};
};
@@ -0,0 +1,77 @@
# 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: true
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>;
};
};
@@ -0,0 +1,52 @@
# 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
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";
};
};
@@ -0,0 +1,51 @@
# 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
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>;
};
};
@@ -0,0 +1,41 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/google,goldfish-battery.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Android Goldfish Battery
maintainers:
- Kuan-Wei Chiu <visitorckw@gmail.com>
allOf:
- $ref: power-supply.yaml#
description:
Android goldfish battery device generated by Android emulator.
properties:
compatible:
const: google,goldfish-battery
reg:
maxItems: 1
interrupts:
maxItems: 1
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
battery@9020000 {
compatible = "google,goldfish-battery";
reg = <0x9020000 0x1000>;
interrupts = <3>;
};
@@ -0,0 +1,100 @@
# 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.
charge-current-limit-default-microamp:
description: Default charge current limit. Must be listed in
charge-current-limit-mapping.
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 ]
charge-current-limit-default-microamp: [charge-current-limit-mapping]
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
charge-current-limit-default-microamp = <700000>;
};
@@ -0,0 +1,61 @@
# 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
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>;
};
@@ -0,0 +1,42 @@
# 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: 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>;
};
@@ -0,0 +1,55 @@
# 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>;
};
@@ -0,0 +1,44 @@
# 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
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>;
};
@@ -0,0 +1,66 @@
# 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: 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:
- |
i2c {
#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 */
};
};
@@ -0,0 +1,73 @@
# 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-l.html
https://www.analog.com/en/products/ltc4162-f.html
https://www.analog.com/en/products/ltc4162-s.html
https://www.analog.com/en/products/ltc4015.html
properties:
compatible:
enum:
- lltc,ltc4015
- lltc,ltc4162-f
- lltc,ltc4162-l
- lltc,ltc4162-s
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:
- |
i2c {
#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>;
};
};
@@ -0,0 +1,37 @@
# 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
...
@@ -0,0 +1,43 @@
# 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
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
@@ -0,0 +1,84 @@
# 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
@@ -0,0 +1,45 @@
# 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
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>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger-detector@35 {
compatible = "maxim,max14656";
reg = <0x35>;
interrupt-parent = <&gpio6>;
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
};
};
@@ -0,0 +1,128 @@
# 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
io-channels:
items:
- description: battery temperature
io-channel-names:
items:
- const: temp
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:
- |
i2c {
#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>
i2c {
#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;
};
};
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
fuel-gauge@36 {
compatible = "maxim,max17043";
reg = <0x36>;
interrupt-parent = <&gpio>;
interrupts = <144 IRQ_TYPE_EDGE_FALLING>;
monitored-battery = <&battery>;
power-supplies = <&charger>;
io-channels = <&adc 8>;
io-channel-names = "temp";
maxim,alert-low-soc-level = <10>;
wakeup-source;
};
};
@@ -0,0 +1,91 @@
# 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,max77705-battery
- maxim,max77759-fg
- maxim,max77849-battery
reg:
maxItems: 1
interrupts:
maxItems: 1
description:
The ALRT pin (or FG_INTB pin on MAX77759), an open-drain interrupt.
shunt-resistor-micro-ohms:
description:
Resistance of rsns resistor in micro Ohms (datasheet-recommended value is 10000).
Defining this property enables current-sense functionality.
maxim,rsns-microohm:
deprecated: true
$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:
- |
i2c {
#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>;
};
};
@@ -0,0 +1,58 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max17201.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX17201 fuel gauge
maintainers:
- Dimitri Fedrau <dima.fedrau@gmail.com>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
oneOf:
- const: maxim,max17201
- items:
- enum:
- maxim,max17205
- const: maxim,max17201
reg:
items:
- description: ModelGauge m5 registers
- description: Nonvolatile registers
reg-names:
items:
- const: m5
- const: nvmem
interrupts:
maxItems: 1
required:
- compatible
- reg
- reg-names
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
fuel-gauge@36 {
compatible = "maxim,max17201";
reg = <0x36>, <0xb>;
reg-names = "m5", "nvmem";
interrupt-parent = <&gpio0>;
interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
};
};
@@ -0,0 +1,70 @@
# 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
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max77705.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX777705 charger
maintainers:
- Dzmitry Sankouski <dsankouski@gmail.com>
description: |
This is a device tree bindings for charger found in Maxim MAX77705 chip.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: maxim,max77705-charger
interrupts:
maxItems: 1
reg:
maxItems: 1
required:
- compatible
- reg
- monitored-battery
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@69 {
compatible = "maxim,max77705-charger";
reg = <0x69>;
monitored-battery = <&battery>;
interrupt-parent = <&pm8998_gpios>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
};
};
@@ -0,0 +1,44 @@
# 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>;
};
};
...
@@ -0,0 +1,67 @@
# 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, input)
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>;
};
@@ -0,0 +1,68 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/maxim,max8971.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX8971 IC charger
maintainers:
- Svyatoslav Ryhel <clamor95@gmail.com>
description:
The MAX8971 is a compact, high-frequency, high-efficiency switch-mode charger
for a one-cell lithium-ion (Li+) battery.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: maxim,max8971
reg:
maxItems: 1
interrupts:
maxItems: 1
monitored-battery: true
port:
description:
An optional port node to link the extcon device to detect type of plug.
$ref: /schemas/graph.yaml#/properties/port
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@35 {
compatible = "maxim,max8971";
reg = <0x35>;
interrupt-parent = <&gpio>;
interrupts = <74 IRQ_TYPE_LEVEL_LOW>;
monitored-battery = <&battery>;
port {
charger_input: endpoint {
remote-endpoint = <&extcon_output>;
};
};
};
};
...
@@ -0,0 +1,96 @@
# 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
...
@@ -0,0 +1,51 @@
# 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";
};
};
@@ -0,0 +1,38 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/mitsumi,mm8013.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mitsumi MM8013 fuel gauge
maintainers:
- Konrad Dybcio <konradybcio@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: mitsumi,mm8013
reg:
maxItems: 1
required:
- compatible
- reg
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
fuel-gauge@55 {
compatible = "mitsumi,mm8013";
reg = <0x55>;
};
};
@@ -0,0 +1,47 @@
# 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>;
};
};
...
@@ -0,0 +1,49 @@
# 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";
};
@@ -0,0 +1,27 @@
# 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
@@ -0,0 +1,49 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/pegatron,chagall-ec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Pegatron Chagall EC
maintainers:
- Svyatoslav Ryhel <clamor95@gmail.com>
description:
Pegatron Chagall EC is based on an 8-bit programmable microcontroller from
Infineon/Cypress Semiconductor, it communicates over I2C and is used in the
Pegatron Chagall tablet for fuel gauge and battery control functions.
$ref: /schemas/power/supply/power-supply.yaml
properties:
compatible:
const: pegatron,chagall-ec
reg:
maxItems: 1
monitored-battery: true
power-supplies: true
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
embedded-controller@10 {
compatible = "pegatron,chagall-ec";
reg = <0x10>;
monitored-battery = <&battery>;
power-supplies = <&mains>;
};
};
...
@@ -0,0 +1,27 @@
# 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
@@ -0,0 +1,83 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm8916-bms-vm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Voltage Mode BMS
maintainers:
- Nikita Travkin <nikita@trvn.ru>
description:
Voltage Mode BMS is a hardware block found in some Qualcomm PMICs
such as pm8916. This block performs battery voltage monitoring.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: qcom,pm8916-bms-vm
reg:
maxItems: 1
interrupts:
items:
- description: BMS FSM left S3 mode
- description: BMS FSM entered S2 mode
- description: OCV measured in S3 mode
- description: OCV below threshold
- description: FIFO update done
- description: BMS FSM switched state
interrupt-names:
items:
- const: cv_leave
- const: cv_enter
- const: ocv_good
- const: ocv_thr
- const: fifo
- const: state_chg
monitored-battery: true
power-supplies: true
required:
- compatible
- reg
- interrupts
- interrupt-names
- monitored-battery
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
pmic {
#address-cells = <1>;
#size-cells = <0>;
battery@4000 {
compatible = "qcom,pm8916-bms-vm";
reg = <0x4000>;
interrupts = <0x0 0x40 0 IRQ_TYPE_EDGE_RISING>,
<0x0 0x40 1 IRQ_TYPE_EDGE_RISING>,
<0x0 0x40 2 IRQ_TYPE_EDGE_RISING>,
<0x0 0x40 3 IRQ_TYPE_EDGE_RISING>,
<0x0 0x40 4 IRQ_TYPE_EDGE_RISING>,
<0x0 0x40 5 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "cv_leave",
"cv_enter",
"ocv_good",
"ocv_thr",
"fifo",
"state_chg";
monitored-battery = <&battery>;
power-supplies = <&pm8916_charger>;
};
};
@@ -0,0 +1,128 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm8916-lbc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Linear Battery Charger
maintainers:
- Nikita Travkin <nikita@trvn.ru>
description:
Linear Battery Charger hardware block, found in some Qualcomm PMICs
such as pm8916. Implements a simple, autonomous CC/CV charger.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: qcom,pm8916-lbc
reg:
items:
- description: Charger
- description: Battery
- description: USB
- description: MISC
reg-names:
items:
- const: chgr
- const: bat_if
- const: usb
- const: misc
interrupts:
items:
- description: Battery detection
- description: Fast charging
- description: Charging failed
- description: Charging done
- description: Battery present
- description: Battery temperature OK
- description: USB coarse detection
- description: USB IN valid
- description: Charger gone
- description: Overtemperature
interrupt-names:
items:
- const: vbat_det
- const: fast_chg
- const: chg_fail
- const: chg_done
- const: bat_pres
- const: temp_ok
- const: coarse_det
- const: usb_vbus
- const: chg_gone
- const: overtemp
qcom,fast-charge-safe-voltage:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 4000000
maximum: 4775000
description:
Maximum safe battery voltage in uV; May be pre-set by bootloader,
in which case, setting this will harmlessly fail.
qcom,fast-charge-safe-current:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 90000
maximum: 1440000
description:
Maximum safe battery charge current in uA; May be pre-set by
bootloader, in which case setting this will harmlessly fail.
monitored-battery: true
required:
- compatible
- reg
- interrupts
- interrupt-names
- qcom,fast-charge-safe-voltage
- qcom,fast-charge-safe-current
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
pmic {
#address-cells = <1>;
#size-cells = <0>;
charger@1000 {
compatible = "qcom,pm8916-lbc";
reg = <0x1000>, <0x1200>, <0x1300>, <0x1600>;
reg-names = "chgr", "bat_if", "usb", "misc";
interrupts = <0x0 0x10 0 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x10 6 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x13 0 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x13 4 IRQ_TYPE_EDGE_BOTH>;
interrupt-names = "vbat_det",
"fast_chg",
"chg_fail",
"chg_done",
"bat_pres",
"temp_ok",
"coarse_det",
"usb_vbus",
"chg_gone",
"overtemp";
monitored-battery = <&battery>;
qcom,fast-charge-safe-current = <900000>;
qcom,fast-charge-safe-voltage = <4300000>;
};
};
@@ -0,0 +1,178 @@
# 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 {};
};
};
@@ -0,0 +1,67 @@
# 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:
oneOf:
- items:
- enum:
- qcom,pm8998-coincell
- const: qcom,pm8941-coincell
- const: qcom,pm8941-coincell
reg:
maxItems: 1
qcom,rset-ohms:
description: |
Resistance (in ohms) for current-limiting resistor. If unspecified,
inherit the previous configuration (e.g. from bootloader or hardware
default value).
enum: [ 800, 1200, 1700, 2100 ]
qcom,vset-millivolts:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Voltage (in millivolts) to apply for charging. If unspecified, inherit
the previous configuration (e.g. from bootloader or hardware default
value).
enum: [ 2500, 3000, 3100, 3200 ]
qcom,charger-disable:
type: boolean
description: defining this property disables charging
required:
- compatible
- reg
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>;
};
};
@@ -0,0 +1,82 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pmi8998-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm PMI8998/PM660 Switch-Mode Battery Charger "2"
maintainers:
- Casey Connolly <casey.connolly@linaro.org>
properties:
compatible:
enum:
- qcom,pmi8998-charger
- qcom,pm660-charger
reg:
maxItems: 1
interrupts:
maxItems: 4
interrupt-names:
items:
- const: usb-plugin
- const: bat-ov
- const: wdog-bark
- const: usbin-icl-change
io-channels:
items:
- description: USB in current in uA
- description: USB in voltage in uV
io-channel-names:
items:
- const: usbin_i
- const: usbin_v
monitored-battery: true
required:
- compatible
- reg
- interrupts
- interrupt-names
- io-channels
- io-channel-names
- monitored-battery
allOf:
- $ref: power-supply.yaml#
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
pmic {
#address-cells = <1>;
#size-cells = <0>;
charger@1000 {
compatible = "qcom,pmi8998-charger";
reg = <0x1000>;
interrupts = <0x2 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x13 0x6 IRQ_TYPE_EDGE_RISING>,
<0x2 0x16 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change";
io-channels = <&pmi8998_rradc 3>,
<&pmi8998_rradc 4>;
io-channel-names = "usbin_i",
"usbin_v";
monitored-battery = <&battery>;
};
};
@@ -0,0 +1,54 @@
# 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
unevaluatedProperties: 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>;
};
};
@@ -0,0 +1,67 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt5033-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT5033 PMIC Battery Charger
maintainers:
- Jakob Hauser <jahau@rocketmail.com>
description:
The battery charger of the multifunction device RT5033 has to be instantiated
under sub-node named "charger" using the following format.
properties:
compatible:
const: richtek,rt5033-charger
monitored-battery:
description: |
Phandle to the monitored battery according to battery.yaml. The battery
node needs to contain five parameters.
precharge-current-microamp:
Current of pre-charge mode. The pre-charge current levels are 350 mA
to 650 mA programmed by I2C per 100 mA.
constant-charge-current-max-microamp:
Current of fast-charge mode. The fast-charge current levels are 700 mA
to 2000 mA programmed by I2C per 100 mA.
charge-term-current-microamp:
This property is end of charge current. Its level ranges from 150 mA
to 600 mA. Between 150 mA and 300 mA in 50 mA steps, between 300 mA and
600 mA in 100 mA steps.
precharge-upper-limit-microvolt:
Voltage of pre-charge mode. If the battery voltage is below the pre-charge
threshold voltage, the charger is in pre-charge mode with pre-charge
current. Its levels are 2.3 V to 3.8 V programmed by I2C per 0.1 V.
constant-charge-voltage-max-microvolt:
Battery regulation voltage of constant voltage mode. This voltage levels
from 3.65 V to 4.4 V by I2C per 0.025 V.
richtek,usb-connector:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Phandle to a USB connector according to usb-connector.yaml. The connector
should be a child of the extcon device.
required:
- monitored-battery
allOf:
- $ref: power-supply.yaml#
additionalProperties: false
examples:
- |
charger {
compatible = "richtek,rt5033-charger";
monitored-battery = <&battery>;
richtek,usb-connector = <&usb_con>;
};
@@ -0,0 +1,90 @@
# 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: 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>
i2c {
#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>;
};
};
@@ -0,0 +1,82 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt9467.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT9467 Switching Battery Charger with Power Path Management
maintainers:
- ChiYuan Huang <cy_huang@richtek.com>
- ChiaEn Wu <chiaen_wu@richtek.com>
description: |
RT9467 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for
portable applications. It integrates a synchronous PWM controller, power
MOSFETs, input current sensing and regulation, high-accuracy voltage
regulation, and charge termination. The charge current is regulated through
integrated sensing resistors.
The RT9467 also features USB On-The-Go (OTG) support. It also integrates
D+/D- pin for USB host/charging port detection.
Datasheet is available at
https://www.richtek.com/assets/product_file/RT9467/DS9467-01.pdf
properties:
compatible:
const: richtek,rt9467
reg:
maxItems: 1
wakeup-source: true
interrupts:
maxItems: 1
charge-enable-gpios:
description: GPIO is used to turn on and off charging.
maxItems: 1
usb-otg-vbus-regulator:
type: object
description: OTG boost regulator.
unevaluatedProperties: false
$ref: /schemas/regulator/regulator.yaml#
properties:
enable-gpios: true
required:
- compatible
- reg
- wakeup-source
- interrupts
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@5b {
compatible = "richtek,rt9467";
reg = <0x5b>;
wakeup-source;
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>;
charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>;
rt9467_otg_vbus: usb-otg-vbus-regulator {
regulator-name = "rt9467-usb-otg-vbus";
regulator-min-microvolt = <4425000>;
regulator-max-microvolt = <5825000>;
regulator-min-microamp = <500000>;
regulator-max-microamp = <3000000>;
};
};
};
@@ -0,0 +1,73 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt9471.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT9471 3A Single Cell Switching Battery charger
maintainers:
- Alina Yu <alina_yu@richtek.com>
- ChiYuan Huang <cy_huang@richtek.com>
description: |
RT9471 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for
portable applications. It supports USB BC1.2 port detection, current and
voltage regulations in both charging and boost mode.
Datasheet is available at
https://www.richtek.com/assets/product_file/RT9471=RT9471D/DS9471D-02.pdf
properties:
compatible:
const: richtek,rt9471
reg:
maxItems: 1
charge-enable-gpios:
description: GPIO used to turn on and off charging.
maxItems: 1
wakeup-source: true
interrupts:
maxItems: 1
usb-otg-vbus-regulator:
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
required:
- compatible
- reg
- wakeup-source
- interrupts
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@53 {
compatible = "richtek,rt9471";
reg = <0x53>;
charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>;
wakeup-source;
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>;
usb-otg-vbus-regulator {
regulator-name = "usb-otg-vbus";
regulator-min-microvolt = <4850000>;
regulator-max-microvolt = <5300000>;
regulator-min-microamp = <500000>;
regulator-max-microamp = <1200000>;
};
};
};
@@ -0,0 +1,72 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt9756.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Richtek RT9756 Smart Cap Divider Charger
maintainers:
- ChiYuan Huang <cy_huang@richtek.com>
description: |
The RT9756/RT9757 is a high efficiency and high charge current charger.
The efficiency is up to 98.2% when VBAT = 4V, IBAT = 2A in DIV2 mode and 99.1%
when VBAT=4V, IBAT=1A in bypass mode. The maximum charger current is up to 8A
in DIV2 mode and 5A in bypass mode. The device integrates smart cap divider
topology, direct charging mode, external over-voltage protection control, an
input reverse blocking NFET and 2-way regulation, a dual phase charge pump
core, 8-Channel high speed ADCs and USB BC 1.2 detection.
RT9770 is almost the same with RT9756/57, only BC 1.2 detection function is
removed to shrink the die size.
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
oneOf:
- enum:
- richtek,rt9756
- richtek,rt9770
- items:
- enum:
- richtek,rt9757
- const: richtek,rt9756
reg:
maxItems: 1
wakeup-source: true
interrupts:
maxItems: 1
shunt-resistor-micro-ohms:
description: Battery current sense resistor mounted.
default: 2000
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@6f {
compatible = "richtek,rt9756";
reg = <0x6f>;
wakeup-source;
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>;
shunt-resistor-micro-ohms = <5000>;
};
};
@@ -0,0 +1,164 @@
# 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 <mazziesaccount@gmail.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>;
};
};
@@ -0,0 +1,56 @@
# 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 <linusw@kernel.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>;
};
};
@@ -0,0 +1,49 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/samsung,s2mu005-fuel-gauge.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Battery Fuel Gauge for Samsung S2M series PMICs
maintainers:
- Kaustabh Chakraborty <kauschluss@disroot.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
enum:
- samsung,s2mu005-fuel-gauge
reg:
maxItems: 1
interrupts:
maxItems: 1
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
fuel-gauge@3b {
compatible = "samsung,s2mu005-fuel-gauge";
reg = <0x3b>;
interrupt-parent = <&gpa0>;
interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
monitored-battery = <&battery>;
};
};
@@ -0,0 +1,84 @@
# 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;
};
};
@@ -0,0 +1,55 @@
# 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>;
};
};
@@ -0,0 +1,111 @@
# 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 manager
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#
unevaluatedProperties: false
properties:
reg:
minimum: 1
maximum: 4
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>;
};
};
};
};
@@ -0,0 +1,33 @@
# 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
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
...
@@ -0,0 +1,73 @@
# 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
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
bat-detect-gpio:
maxItems: 1
deprecated: true
description: use battery-detect-gpios instead
interrupts:
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
- interrupts
- io-channels
- io-channel-names
- nvmem-cells
- nvmem-cell-names
- sprd,calib-resistance-micro-ohms
- monitored-battery
additionalProperties: false
...
@@ -0,0 +1,74 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/st,stc3117.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: STMicroelectronics STC3117 Fuel Gauge Unit Power Supply
maintainers:
- Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
- Bhavin Sharma <bhavin.sharma@siliconsignals.io>
description: |
The STC3117 includes the STMicroelectronics OptimGauge algorithm.
It provides accurate battery state-of-charge (SOC) monitoring, tracks
battery parameter changes with operation conditions, temperature,
and aging, and allows the application to get a battery state-of-health
(SOH) indication.
An alarm output signals low SOC or low voltage conditions and also
indicates fault conditions like a missing or swapped battery.
Datasheet is available at
https://www.st.com/resource/en/datasheet/stc3117.pdf
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
enum:
- st,stc3117
reg:
maxItems: 1
monitored-battery:
description: |
The fuel gauge uses the following battery properties:
- charge-full-design-microamp-hours
- voltage-min-design-microvolt
- voltage-max-design-microvolt
shunt-resistor-micro-ohms:
description: Current sense resistor
interrupts:
maxItems: 1
required:
- compatible
- reg
- monitored-battery
- shunt-resistor-micro-ohms
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
battery@70 {
compatible = "st,stc3117";
reg = <0x70>;
interrupt-parent = <&gpio0>;
interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
monitored-battery = <&bat>;
shunt-resistor-micro-ohms = <10000>;
};
};
@@ -0,0 +1,75 @@
# 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: true
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";
};
};
@@ -0,0 +1,39 @@
# 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: true
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>;
};
};
@@ -0,0 +1,124 @@
# 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: true
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";
};
};
@@ -0,0 +1,79 @@
# 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: true
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";
};
};
@@ -0,0 +1,181 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/summit,smb347-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Battery charger driver for SMB345, SMB347 and SMB358
maintainers:
- David Heidelberg <david@ixit.cz>
- Dmitry Osipenko <digetx@gmail.com>
properties:
compatible:
enum:
- summit,smb345
- summit,smb347
- summit,smb358
reg:
maxItems: 1
interrupts:
maxItems: 1
monitored-battery: true
summit,enable-usb-charging:
type: boolean
description: Enable charging through USB.
summit,enable-otg-charging:
type: boolean
description: Provide power for USB OTG
summit,enable-mains-charging:
type: boolean
description: Enable charging through mains
summit,enable-charge-control:
description: Enable charging control
$ref: /schemas/types.yaml#/definitions/uint32
enum:
- 0 # SMB3XX_CHG_ENABLE_SW SW (I2C interface)
- 1 # SMB3XX_CHG_ENABLE_PIN_ACTIVE_LOW Pin control (Active Low)
- 2 # SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH Pin control (Active High)
summit,fast-voltage-threshold-microvolt:
description: Voltage threshold to transit to fast charge mode (in uV)
minimum: 2400000
maximum: 3000000
summit,mains-current-limit-microamp:
description: Maximum input current from AC/DC input (in uA)
summit,usb-current-limit-microamp:
description: Maximum input current from USB input (in uA)
summit,charge-current-compensation-microamp:
description: Charge current compensation (in uA)
summit,chip-temperature-threshold-celsius:
description: Chip temperature for thermal regulation in °C.
enum: [100, 110, 120, 130]
summit,soft-compensation-method:
description: Soft temperature limit compensation method
$ref: /schemas/types.yaml#/definitions/uint32
enum:
- 0 # SMB3XX_SOFT_TEMP_COMPENSATE_NONE Compensation none
- 1 # SMB3XX_SOFT_TEMP_COMPENSATE_CURRENT Current compensation
- 2 # SMB3XX_SOFT_TEMP_COMPENSATE_VOLTAGE Voltage compensation
summit,inok-polarity:
description: |
Polarity of INOK signal indicating presence of external power supply.
$ref: /schemas/types.yaml#/definitions/uint32
enum:
- 0 # SMB3XX_SYSOK_INOK_ACTIVE_LOW
- 1 # SMB3XX_SYSOK_INOK_ACTIVE_HIGH
usb-vbus:
$ref: /schemas/regulator/regulator.yaml#
type: object
properties:
summit,needs-inok-toggle:
type: boolean
description: INOK signal is fixed and polarity needs to be toggled
in order to enable/disable output mode.
unevaluatedProperties: false
allOf:
- $ref: power-supply.yaml#
- if:
properties:
compatible:
enum:
- summit,smb345
- summit,smb358
then:
properties:
summit,mains-current-limit-microamp:
enum: [ 300000, 500000, 700000, 1000000,
1500000, 1800000, 2000000]
summit,usb-current-limit-microamp:
enum: [ 300000, 500000, 700000, 1000000,
1500000, 1800000, 2000000]
summit,charge-current-compensation-microamp:
enum: [200000, 450000, 600000, 900000]
else:
properties:
summit,mains-current-limit-microamp:
enum: [ 300000, 500000, 700000, 900000, 1200000,
1500000, 1800000, 2000000, 2200000, 2500000]
summit,usb-current-limit-microamp:
enum: [ 300000, 500000, 700000, 900000, 1200000,
1500000, 1800000, 2000000, 2200000, 2500000]
summit,charge-current-compensation-microamp:
enum: [250000, 700000, 900000, 1200000]
required:
- compatible
- reg
anyOf:
- required:
- summit,enable-usb-charging
- required:
- summit,enable-otg-charging
- required:
- summit,enable-mains-charging
additionalProperties: false
examples:
- |
#include <dt-bindings/power/summit,smb347-charger.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@7f {
compatible = "summit,smb347";
reg = <0x7f>;
summit,enable-charge-control = <SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH>;
summit,inok-polarity = <SMB3XX_SYSOK_INOK_ACTIVE_LOW>;
summit,chip-temperature-threshold-celsius = <110>;
summit,mains-current-limit-microamp = <2000000>;
summit,usb-current-limit-microamp = <500000>;
summit,enable-usb-charging;
summit,enable-mains-charging;
monitored-battery = <&battery>;
usb-vbus {
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-min-microamp = <750000>;
regulator-max-microamp = <750000>;
summit,needs-inok-toggle;
};
};
};
battery: battery-cell {
compatible = "simple-battery";
constant-charge-current-max-microamp = <1800000>;
operating-range-celsius = <0 45>;
alert-celsius = <3 42>;
};
@@ -0,0 +1,90 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/ti,lp8727.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI/National Semiconductor LP8727 Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: ti,lp8727
reg:
const: 0x27
interrupts:
maxItems: 1
debounce-ms:
description: interrupt debounce time in ms
patternProperties:
'^(ac|usb)$':
type: object
additionalProperties: false
description: USB/AC charging parameters
properties:
charger-type:
enum:
- ac
- usb
eoc-level:
$ref: /schemas/types.yaml#/definitions/uint8
minimum: 0
maximum: 6
description: |
End of Charge Percentage with the following mapping:
0 = 5%, 1 = 10%, 2 = 16%, 3 = 20%, 4 = 25%, 5 = 33%, 6 = 50%
charging-current:
$ref: /schemas/types.yaml#/definitions/uint8
minimum: 0
maximum: 9
description: |
Charging current with the following mapping:
0 = 90mA, 1 = 100mA, 2 = 400mA, 3 = 450mA, 4 = 500mA, 5 = 600mA,
6 = 700mA, 7 = 800mA, 8 = 900mA, 9 = 1000mA
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
lp8727: charger@27 {
compatible = "ti,lp8727";
reg = <0x27>;
interrupt-parent = <&gpio5>;
interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
debounce-ms = <300>;
/* AC charger: 5% EOC and 500mA charging current */
ac {
charger-type = "ac";
eoc-level = /bits/ 8 <0>;
charging-current = /bits/ 8 <4>;
};
/* USB charger: 10% EOC and 400mA charging current */
usb {
charger-type = "usb";
eoc-level = /bits/ 8 <1>;
charging-current = /bits/ 8 <2>;
};
};
};
@@ -0,0 +1,48 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/ti,twl6030-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TWL6030/32 BCI (Battery Charger Interface)
description:
The battery charger needs to be configured to do any charging besides of
precharging. The GPADC in the PMIC has to be used to get the related
voltages.
maintainers:
- Andreas Kemnade <andreas@kemnade.info>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
oneOf:
- const: ti,twl6030-charger
- items:
- const: ti,twl6032-charger
- const: ti,twl6030-charger
interrupts:
items:
- description: Charger Control Interrupt
- description: Charger Fault Interrupt
io-channels:
items:
- description: VBUS Voltage Channel
io-channel-names:
items:
- const: vusb
monitored-battery: true
required:
- compatible
- interrupts
- monitored-battery
additionalProperties: false
@@ -0,0 +1,36 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/tps65090-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TPS65090 Frontend PMU with Switchmode Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: ti,tps65090-charger
ti,enable-low-current-chrg:
type: boolean
description: |
Enables charging when a low current is detected while the default logic is to stop charging.
required:
- compatible
additionalProperties: false
examples:
- |
pmic {
charger {
compatible = "ti,tps65090-charger";
ti,enable-low-current-chrg;
};
};
@@ -0,0 +1,43 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/tps65217-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TPS65217 Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: ti,tps65217-charger
interrupts:
minItems: 2
maxItems: 2
interrupt-names:
items:
- const: USB
- const: AC
required:
- compatible
- interrupts
- interrupt-names
additionalProperties: false
examples:
- |
pmic {
charger {
compatible = "ti,tps65217-charger";
interrupts = <0>, <1>;
interrupt-names = "USB", "AC";
};
};
@@ -0,0 +1,68 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/twl4030-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TWL4030 BCI (Battery Charger Interface)
description: |
The battery charger needs to interact with the USB phy in order to know when
charging is permissible, and when there is a connection or disconnection.
The choice of phy cannot be configured at a hardware level, so there is no
value in explicit configuration in device-tree. Rather if there is a sibling
of the BCI node which is compatible with "ti,twl4030-usb", then that is used
to determine when and how use USB power for charging.
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: ti,twl4030-bci
interrupts:
minItems: 2
maxItems: 2
ti,bb-uvolt:
$ref: /schemas/types.yaml#/definitions/uint32
description: microvolts for charging the backup battery
ti,bb-uamp:
$ref: /schemas/types.yaml#/definitions/uint32
description: microamps for charging the backup battery
io-channels:
items:
- description: Accessory Charger Voltage Channel
io-channel-names:
items:
- const: vac
bci3v1-supply:
description: 3.1V USB regulator
required:
- compatible
- interrupts
additionalProperties: false
examples:
- |
pmic {
charger {
compatible = "ti,twl4030-bci";
interrupts = <9>, <2>;
ti,bb-uvolt = <3200000>;
ti,bb-uamp = <150>;
io-channels = <&twl_madc 11>;
io-channel-names = "vac";
};
};
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/x-powers,axp20x-ac-power-supply.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: AXP20x AC power-supply
description: |
The AXP20X can read the current current and voltage supplied by AC by
reading ADC channels from the AXP20X ADC. The AXP22X is only able to
tell if an AC power supply is present and usable. AXP813/AXP803 are
able to limit current and supply voltage
maintainers:
- Chen-Yu Tsai <wens@csie.org>
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
oneOf:
- const: x-powers,axp202-ac-power-supply
- const: x-powers,axp221-ac-power-supply
- items:
- const: x-powers,axp803-ac-power-supply
- const: x-powers,axp813-ac-power-supply
- const: x-powers,axp813-ac-power-supply
required:
- compatible
additionalProperties: false
@@ -0,0 +1,51 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/x-powers,axp20x-battery-power-supply.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: AXP20x Battery power-supply
description: |
The supported devices can read the battery voltage, charge and discharge
currents of the battery by reading ADC channels from the ADC.
maintainers:
- Chen-Yu Tsai <wens@csie.org>
- Sebastian Reichel <sre@kernel.org>
properties:
compatible:
oneOf:
- const: x-powers,axp202-battery-power-supply
- const: x-powers,axp209-battery-power-supply
- const: x-powers,axp221-battery-power-supply
- const: x-powers,axp717-battery-power-supply
- items:
- const: x-powers,axp803-battery-power-supply
- const: x-powers,axp813-battery-power-supply
- const: x-powers,axp813-battery-power-supply
monitored-battery: true
x-powers,no-thermistor:
type: boolean
description: Indicates that no thermistor is connected to the TS pin
required:
- compatible
allOf:
- $ref: power-supply.yaml#
- if:
not:
properties:
compatible:
contains:
enum:
- x-powers,axp717-battery-power-supply
then:
properties:
x-powers,no-thermistor: false
additionalProperties: false
@@ -0,0 +1,104 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/x-powers,axp20x-usb-power-supply.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: AXP20x USB power-supply
description: |
The AXP223 PMIC shares most of its behaviour with the AXP221 but has slight
variations such as the former being able to set the VBUS power supply max
current to 100mA, unlike the latter.
maintainers:
- Chen-Yu Tsai <wens@csie.org>
- Sebastian Reichel <sre@kernel.org>
properties:
compatible:
oneOf:
- enum:
- x-powers,axp192-usb-power-supply
- x-powers,axp202-usb-power-supply
- x-powers,axp221-usb-power-supply
- x-powers,axp223-usb-power-supply
- x-powers,axp717-usb-power-supply
- x-powers,axp813-usb-power-supply
- items:
- const: x-powers,axp803-usb-power-supply
- const: x-powers,axp813-usb-power-supply
input-current-limit-microamp:
description:
Optional value to clamp the maximum input current limit to for
the device. If omitted, the programmed value from the EFUSE will
be used.
minimum: 100000
maximum: 4000000
required:
- compatible
allOf:
- $ref: power-supply.yaml#
- if:
properties:
compatible:
contains:
enum:
- x-powers,axp192-usb-power-supply
then:
properties:
input-current-limit-microamp:
enum: [100000, 500000]
- if:
properties:
compatible:
contains:
enum:
- x-powers,axp202-usb-power-supply
- x-powers,axp223-usb-power-supply
then:
properties:
input-current-limit-microamp:
enum: [100000, 500000, 900000]
- if:
properties:
compatible:
contains:
enum:
- x-powers,axp221-usb-power-supply
then:
properties:
input-current-limit-microamp:
enum: [500000, 900000]
- if:
properties:
compatible:
contains:
enum:
- x-powers,axp717-usb-power-supply
then:
properties:
input-current-limit-microamp:
description: Maximum input current in increments of 50000 uA.
minimum: 100000
maximum: 3250000
- if:
properties:
compatible:
contains:
enum:
- x-powers,axp813-usb-power-supply
then:
properties:
input-current-limit-microamp:
enum: [100000, 500000, 900000, 1500000, 2000000, 2500000,
3000000, 3500000, 4000000]
additionalProperties: false