You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge tag 'for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel:
"battery/charger driver changes:
- core:
- provide function stubs if CONFIG_POWER_SUPPLY=n
- reduce loglevel for probe defer info
- surface:
- new battery and charger drivers for Surface
- bq27xxx:
- add bq78z100 support
- fix current_now/power_avg for newer chips
- cw2015:
- add CHARGE_NOW support
- ab8500:
- drop pdata support
- convert most DT bindings to YAML
- lots of minor fixes and cleanups
reset drivers:
- ltc2952-poweroff:
- make trigger delay configurable from DT
- minor fixes and cleanups"
* tag 'for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (97 commits)
power: supply: cpcap-battery: fix invalid usage of list cursor
power: supply: bq256xx: add kerneldoc for structure members
power: supply: act8945a: correct kerneldoc
power: supply: max17040: remove unneeded double cast
power: supply: max17040: handle device_property_read_u8_array() failure
power: supply: max14577: remove unneeded variable initialization
power: supply: surface-charger: Make symbol 'surface_ac_pm_ops' static
power: supply: surface-battery: Make some symbols static
power: reset: restart-poweroff: Add missing MODULE_DEVICE_TABLE
power: reset: hisi-reboot: add missing MODULE_DEVICE_TABLE
power: supply: s3c_adc_battery: fix possible use-after-free in s3c_adc_bat_remove()
power: supply: generic-adc-battery: fix possible use-after-free in gab_remove()
power: supply: Add AC driver for Surface Aggregator Module
power: supply: Add battery driver for Surface Aggregator Module
power: supply: bq25980: Move props from battery node
power: supply: core: Use true and false for bool variable
power: supply: goldfish: Remove the GOLDFISH dependency
power: reset: ltc2952: make trigger delay configurable
power: supply: cpcap-charger: Simplify bool conversion
power: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce
...
This commit is contained in:
15
Documentation/ABI/testing/sysfs-class-power-surface
Normal file
15
Documentation/ABI/testing/sysfs-class-power-surface
Normal file
@@ -0,0 +1,15 @@
|
||||
What: /sys/class/power_supply/<supply_name>/alarm
|
||||
Date: April 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: Maximilian Luz <luzmaximilian@gmail.com>
|
||||
Description:
|
||||
Battery trip point. When the remaining battery capacity crosses this
|
||||
value in either direction, the system will be notified and if
|
||||
necessary woken.
|
||||
|
||||
Set to zero to clear/disable.
|
||||
|
||||
Access: Read, Write
|
||||
|
||||
Valid values: In micro-Wh or micro-Ah, depending on the power unit
|
||||
of the battery
|
||||
@@ -17,6 +17,9 @@ Optional properties:
|
||||
chip's trigger line. If this property is not set, the
|
||||
trigger function is ignored and the chip is kept alive
|
||||
until an explicit kill signal is received
|
||||
- trigger-delay-ms The number of milliseconds to wait after trigger line
|
||||
assertion before executing shut down procedure.
|
||||
The default is 2500ms.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -24,6 +27,7 @@ ltc2952 {
|
||||
compatible = "lltc,ltc2952";
|
||||
|
||||
trigger-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
|
||||
trigger-delay-ms = <2000>;
|
||||
watchdog-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
kill-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
=== AB8500 Battery Temperature Monitor Driver ===
|
||||
|
||||
The properties below describes the node for btemp driver.
|
||||
|
||||
Required Properties:
|
||||
- compatible = Shall be: "stericsson,ab8500-btemp"
|
||||
- battery = Shall be battery specific information
|
||||
|
||||
Example:
|
||||
ab8500_btemp {
|
||||
compatible = "stericsson,ab8500-btemp";
|
||||
battery = <&ab8500_battery>;
|
||||
};
|
||||
|
||||
For information on battery specific node, Ref:
|
||||
Documentation/devicetree/bindings/power/supply/ab8500/fg.txt
|
||||
@@ -1,16 +0,0 @@
|
||||
=== AB8500 Charging Algorithm Driver ===
|
||||
|
||||
The properties below describes the node for chargalg driver.
|
||||
|
||||
Required Properties:
|
||||
- compatible = Shall be: "stericsson,ab8500-chargalg"
|
||||
- battery = Shall be battery specific information
|
||||
|
||||
Example:
|
||||
ab8500_chargalg {
|
||||
compatible = "stericsson,ab8500-chargalg";
|
||||
battery = <&ab8500_battery>;
|
||||
};
|
||||
|
||||
For information on battery specific node, Ref:
|
||||
Documentation/devicetree/bindings/power/supply/ab8500/fg.txt
|
||||
@@ -1,25 +0,0 @@
|
||||
=== AB8500 Charger Driver ===
|
||||
|
||||
Required Properties:
|
||||
- compatible = Shall be "stericsson,ab8500-charger"
|
||||
- battery = Shall be battery specific information
|
||||
Example:
|
||||
ab8500_charger {
|
||||
compatible = "stericsson,ab8500-charger";
|
||||
battery = <&ab8500_battery>;
|
||||
};
|
||||
|
||||
- vddadc-supply: Supply for USB and Main charger
|
||||
Example:
|
||||
ab8500-charger {
|
||||
vddadc-supply = <&ab8500_ldo_tvout_reg>;
|
||||
}
|
||||
- autopower_cfg:
|
||||
Boolean value depicting the presence of 'automatic poweron after powerloss'
|
||||
Example:
|
||||
ab8500-charger {
|
||||
autopower_cfg;
|
||||
};
|
||||
|
||||
For information on battery specific node, Ref:
|
||||
Documentation/devicetree/bindings/power/supply/ab8500/fg.txt
|
||||
@@ -1,44 +0,0 @@
|
||||
Device-Tree bindings for charger of Active-semi ACT8945A Multi-Function Device
|
||||
|
||||
Required properties:
|
||||
- compatible: "active-semi,act8945a-charger".
|
||||
- active-semi,chglev-gpios: charge current level phandle with args
|
||||
as described in ../gpio/gpio.txt.
|
||||
- active-semi,lbo-gpios: specify the low battery voltage detect phandle
|
||||
with args as as described in ../gpio/gpio.txt.
|
||||
- interrupts: <a b> where a is the interrupt number and b is a
|
||||
field that represents an encoding of the sense and level
|
||||
information for the interrupt.
|
||||
|
||||
Optional properties:
|
||||
- active-semi,input-voltage-threshold-microvolt: unit: mV;
|
||||
Specifies the charger's input over-voltage threshold value;
|
||||
The value can be: 6600, 7000, 7500, 8000; default: 6600
|
||||
- active-semi,precondition-timeout: unit: minutes;
|
||||
Specifies the charger's PRECONDITION safety timer setting value;
|
||||
The value can be: 40, 60, 80, 0; If 0, it means to disable this timer;
|
||||
default: 40.
|
||||
- active-semi,total-timeout: unit: hours;
|
||||
Specifies the charger's total safety timer setting value;
|
||||
The value can be: 3, 4, 5, 0; If 0, it means to disable this timer;
|
||||
default: 3.
|
||||
|
||||
Example:
|
||||
pmic@5b {
|
||||
compatible = "active-semi,act8945a";
|
||||
reg = <0x5b>;
|
||||
|
||||
charger {
|
||||
compatible = "active-semi,act8945a-charger";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_charger_chglev &pinctrl_charger_lbo &pinctrl_charger_irq>;
|
||||
interrupt-parent = <&pioA>;
|
||||
interrupts = <45 IRQ_TYPE_LEVEL_LOW>;
|
||||
|
||||
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
|
||||
active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
|
||||
active-semi,input-voltage-threshold-microvolt = <6600>;
|
||||
active-semi,precondition-timeout = <40>;
|
||||
active-semi,total-timeout = <3>;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: "http://devicetree.org/schemas/power/supply/active-semi,act8945a-charger.yaml#"
|
||||
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||
|
||||
title: Active-semi ACT8945A Charger Function
|
||||
|
||||
maintainers:
|
||||
- Sebastian Reichel <sre@kernel.org>
|
||||
|
||||
allOf:
|
||||
- $ref: power-supply.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: active-semi,act8945a-charger
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
active-semi,chglev-gpios:
|
||||
maxItems: 1
|
||||
description: charge current level GPIO
|
||||
|
||||
active-semi,lbo-gpios:
|
||||
maxItems: 1
|
||||
description: low battery voltage detect GPIO
|
||||
|
||||
active-semi,input-voltage-threshold-microvolt:
|
||||
description: |
|
||||
Specifies the charger's input over-voltage threshold value.
|
||||
Despite the name, specified values are in millivolt (mV).
|
||||
Defaults to 6.6 V
|
||||
enum: [ 6600, 7000, 7500, 8000 ]
|
||||
|
||||
active-semi,precondition-timeout:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description: |
|
||||
Specifies the charger's PRECONDITION safety timer setting value in minutes.
|
||||
If 0, it means to disable this timer.
|
||||
Defaults to 40 minutes.
|
||||
enum: [ 0, 40, 60, 80 ]
|
||||
|
||||
active-semi,total-timeout:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description: |
|
||||
Specifies the charger's total safety timer setting value in hours;
|
||||
If 0, it means to disable this timer;
|
||||
Defaults to 3 hours.
|
||||
enum: [ 0, 3, 4, 5 ]
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- interrupts
|
||||
- active-semi,chglev-gpios
|
||||
- active-semi,lbo-gpios
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
pmic {
|
||||
charger {
|
||||
compatible = "active-semi,act8945a-charger";
|
||||
interrupt-parent = <&pioA>;
|
||||
interrupts = <45 IRQ_TYPE_LEVEL_LOW>;
|
||||
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
|
||||
active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
|
||||
active-semi,input-voltage-threshold-microvolt = <6600>;
|
||||
active-semi,precondition-timeout = <40>;
|
||||
active-semi,total-timeout = <3>;
|
||||
};
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
AXP20X and AXP22X PMICs' AC power supply
|
||||
|
||||
Required Properties:
|
||||
- compatible: One of:
|
||||
"x-powers,axp202-ac-power-supply"
|
||||
"x-powers,axp221-ac-power-supply"
|
||||
"x-powers,axp813-ac-power-supply"
|
||||
|
||||
This node is a subnode of the axp20x PMIC.
|
||||
|
||||
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
|
||||
|
||||
Example:
|
||||
|
||||
&axp209 {
|
||||
ac_power_supply: ac-power-supply {
|
||||
compatible = "x-powers,axp202-ac-power-supply";
|
||||
};
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
AXP20x and AXP22x battery power supply
|
||||
|
||||
Required Properties:
|
||||
- compatible, one of:
|
||||
"x-powers,axp209-battery-power-supply"
|
||||
"x-powers,axp221-battery-power-supply"
|
||||
"x-powers,axp813-battery-power-supply"
|
||||
|
||||
This node is a subnode of its respective PMIC DT node.
|
||||
|
||||
The supported devices can read the battery voltage, charge and discharge
|
||||
currents of the battery by reading ADC channels from the ADC.
|
||||
|
||||
Example:
|
||||
|
||||
&axp209 {
|
||||
battery_power_supply: battery-power-supply {
|
||||
compatible = "x-powers,axp209-battery-power-supply";
|
||||
}
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
AXP20x USB power supply
|
||||
|
||||
Required Properties:
|
||||
-compatible: One of: "x-powers,axp202-usb-power-supply"
|
||||
"x-powers,axp221-usb-power-supply"
|
||||
"x-powers,axp223-usb-power-supply"
|
||||
"x-powers,axp813-usb-power-supply"
|
||||
|
||||
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.
|
||||
|
||||
This node is a subnode of the axp20x PMIC.
|
||||
|
||||
Example:
|
||||
|
||||
axp209: pmic@34 {
|
||||
compatible = "x-powers,axp209";
|
||||
reg = <0x34>;
|
||||
interrupt-parent = <&nmi_intc>;
|
||||
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
|
||||
regulators {
|
||||
x-powers,dcdc-freq = <1500>;
|
||||
|
||||
vdd_cpu: dcdc2 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1450000>;
|
||||
regulator-name = "vdd-cpu";
|
||||
};
|
||||
|
||||
...
|
||||
};
|
||||
|
||||
usb-power-supply: usb-power-supply {
|
||||
compatible = "x-powers,axp202-usb-power-supply";
|
||||
};
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
The contents of this file has been moved to battery.yaml
|
||||
|
||||
Please note that not all charger drivers respect all of the properties.
|
||||
@@ -1,47 +0,0 @@
|
||||
Binding for TI bq2415x Li-Ion Charger
|
||||
|
||||
Required properties:
|
||||
- compatible: Should contain one of the following:
|
||||
* "ti,bq24150"
|
||||
* "ti,bq24150"
|
||||
* "ti,bq24150a"
|
||||
* "ti,bq24151"
|
||||
* "ti,bq24151a"
|
||||
* "ti,bq24152"
|
||||
* "ti,bq24153"
|
||||
* "ti,bq24153a"
|
||||
* "ti,bq24155"
|
||||
* "ti,bq24156"
|
||||
* "ti,bq24156a"
|
||||
* "ti,bq24158"
|
||||
- reg: integer, i2c address of the device.
|
||||
- ti,current-limit: integer, initial maximum current charger can pull
|
||||
from power supply in mA.
|
||||
- ti,weak-battery-voltage: integer, weak battery voltage threshold in mV.
|
||||
The chip will use slow precharge if battery voltage
|
||||
is below this value.
|
||||
- ti,battery-regulation-voltage: integer, maximum charging voltage in mV.
|
||||
- ti,charge-current: integer, maximum charging current in mA.
|
||||
- ti,termination-current: integer, charge will be terminated when current in
|
||||
constant-voltage phase drops below this value (in mA).
|
||||
- ti,resistor-sense: integer, value of sensing resistor in milliohm.
|
||||
|
||||
Optional properties:
|
||||
- ti,usb-charger-detection: phandle to usb charger detection device.
|
||||
(required for auto mode)
|
||||
|
||||
Example from Nokia N900:
|
||||
|
||||
bq24150a {
|
||||
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>;
|
||||
};
|
||||
98
Documentation/devicetree/bindings/power/supply/bq2415x.yaml
Normal file
98
Documentation/devicetree/bindings/power/supply/bq2415x.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
# 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: Binding for TI bq2415x Li-Ion Charger
|
||||
|
||||
maintainers:
|
||||
- Sebastian Reichel <sre@kernel.org>
|
||||
|
||||
allOf:
|
||||
- $ref: power-supply.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- ti,bq24150
|
||||
- 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:
|
||||
- |
|
||||
i2c0 {
|
||||
#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>;
|
||||
};
|
||||
};
|
||||
@@ -1,61 +0,0 @@
|
||||
TI BQ24190 Li-Ion Battery Charger
|
||||
|
||||
Required properties:
|
||||
- compatible: contains one of the following:
|
||||
* "ti,bq24190"
|
||||
* "ti,bq24192"
|
||||
* "ti,bq24192i"
|
||||
* "ti,bq24196"
|
||||
- reg: integer, I2C address of the charger.
|
||||
- interrupts[-extended]: configuration for charger INT pin.
|
||||
|
||||
Optional properties:
|
||||
- monitored-battery: phandle of battery characteristics devicetree node
|
||||
The charger uses the following battery properties:
|
||||
+ 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).
|
||||
See also Documentation/devicetree/bindings/power/supply/battery.txt
|
||||
- ti,system-minimum-microvolt: when power is connected and the battery is below
|
||||
minimum system voltage, the system will be regulated above this setting.
|
||||
|
||||
child nodes:
|
||||
- usb-otg-vbus:
|
||||
Usage: optional
|
||||
Description: Regulator that is used to control the VBUS voltage direction for
|
||||
either USB host mode or for charging on the OTG port.
|
||||
|
||||
Notes:
|
||||
- Some circuit boards wire the chip's "OTG" pin high (enabling 500mA default
|
||||
charge current on USB SDP ports, among other features). To simulate this on
|
||||
boards that wire the pin to a GPIO, set a gpio-hog.
|
||||
|
||||
Example:
|
||||
|
||||
bat: battery {
|
||||
compatible = "simple-battery";
|
||||
precharge-current-microamp = <256000>;
|
||||
charge-term-current-microamp = <128000>;
|
||||
// etc.
|
||||
};
|
||||
|
||||
bq24190: charger@6a {
|
||||
compatible = "ti,bq24190";
|
||||
reg = <0x6a>;
|
||||
interrupts-extended = <&gpiochip 10 IRQ_TYPE_EDGE_FALLING>;
|
||||
monitored-battery = <&bat>;
|
||||
ti,system-minimum-microvolt = <3200000>;
|
||||
|
||||
usb_otg_vbus: usb-otg-vbus { };
|
||||
};
|
||||
|
||||
&twl_gpio {
|
||||
otg {
|
||||
gpio-hog;
|
||||
gpios = <6 0>;
|
||||
output-high;
|
||||
line-name = "otg-gpio";
|
||||
};
|
||||
};
|
||||
92
Documentation/devicetree/bindings/power/supply/bq24190.yaml
Normal file
92
Documentation/devicetree/bindings/power/supply/bq24190.yaml
Normal file
@@ -0,0 +1,92 @@
|
||||
# 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: Binding for 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,bq24196
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
usb-otg-vbus:
|
||||
type: object
|
||||
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:
|
||||
$ref: /schemas/types.yaml#/definitions/phandle
|
||||
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>;
|
||||
};
|
||||
|
||||
i2c0 {
|
||||
#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 { };
|
||||
};
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
Binding for TI bq24250/bq24251/bq24257 Li-Ion Charger
|
||||
|
||||
Required properties:
|
||||
- compatible: Should contain one of the following:
|
||||
* "ti,bq24250"
|
||||
* "ti,bq24251"
|
||||
* "ti,bq24257"
|
||||
- reg: integer, i2c address of the device.
|
||||
- interrupts: Interrupt mapping for GPIO IRQ (configure for both edges). Use in
|
||||
conjunction with "interrupt-parent".
|
||||
- ti,battery-regulation-voltage: integer, maximum charging voltage in uV.
|
||||
- ti,charge-current: integer, maximum charging current in uA.
|
||||
- ti,termination-current: integer, charge will be terminated when current in
|
||||
constant-voltage phase drops below this value (in uA).
|
||||
|
||||
Optional properties:
|
||||
- pg-gpios: 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.
|
||||
- ti,current-limit: 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: 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: 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.
|
||||
|
||||
Example:
|
||||
|
||||
bq24257 {
|
||||
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>;
|
||||
};
|
||||
|
||||
Example:
|
||||
|
||||
bq24250 {
|
||||
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>;
|
||||
};
|
||||
124
Documentation/devicetree/bindings/power/supply/bq24257.yaml
Normal file
124
Documentation/devicetree/bindings/power/supply/bq24257.yaml
Normal file
@@ -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: Binding for 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>
|
||||
i2c0 {
|
||||
#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>
|
||||
i2c0 {
|
||||
#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>;
|
||||
};
|
||||
};
|
||||
89
Documentation/devicetree/bindings/power/supply/bq24735.yaml
Normal file
89
Documentation/devicetree/bindings/power/supply/bq24735.yaml
Normal file
@@ -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: Binding for 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>
|
||||
|
||||
i2c0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
charger@9 {
|
||||
compatible = "ti,bq24735";
|
||||
reg = <0x9>;
|
||||
ti,ac-detect-gpios = <&gpio 72 0x1>;
|
||||
};
|
||||
};
|
||||
@@ -1,60 +0,0 @@
|
||||
Binding for TI bq25890 Li-Ion Charger
|
||||
|
||||
This driver will support the bq25892, the bq25896 and the bq25890. There are
|
||||
other ICs in the same family but those have not been tested.
|
||||
|
||||
Required properties:
|
||||
- compatible: Should contain one of the following:
|
||||
* "ti,bq25890"
|
||||
* "ti,bq25892"
|
||||
* "ti,bq25895"
|
||||
* "ti,bq25896"
|
||||
- reg: integer, i2c address of the device.
|
||||
- interrupts: interrupt line;
|
||||
- ti,battery-regulation-voltage: integer, maximum charging voltage (in uV);
|
||||
- ti,charge-current: integer, maximum charging current (in uA);
|
||||
- ti,termination-current: integer, charge will be terminated when current in
|
||||
constant-voltage phase drops below this value (in uA);
|
||||
- ti,precharge-current: integer, maximum charge current during precharge
|
||||
phase (in uA);
|
||||
- ti,minimum-sys-voltage: integer, 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: integer, VBUS voltage level in boost mode (in uV);
|
||||
- ti,boost-max-current: integer, maximum allowed current draw in boost mode
|
||||
(in uA).
|
||||
|
||||
Optional properties:
|
||||
- ti,boost-low-freq: boolean, if present boost mode frequency will be 500kHz,
|
||||
otherwise 1.5MHz;
|
||||
- ti,use-ilim-pin: boolean, if present the ILIM resistor will be used and the
|
||||
input current will be the lower between the resistor setting and the IINLIM
|
||||
register setting;
|
||||
- ti,thermal-regulation-threshold: integer, 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: integer, value of a resistor in series with
|
||||
the battery;
|
||||
- ti,ibatcomp-clamp-microvolt: integer, maximum charging voltage adjustment due
|
||||
to expected voltage drop on in-series resistor;
|
||||
|
||||
Example:
|
||||
|
||||
bq25890 {
|
||||
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>;
|
||||
};
|
||||
123
Documentation/devicetree/bindings/power/supply/bq25890.yaml
Normal file
123
Documentation/devicetree/bindings/power/supply/bq25890.yaml
Normal file
@@ -0,0 +1,123 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2021 Sebastian Reichel
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: "http://devicetree.org/schemas/power/supply/bq25890.yaml#"
|
||||
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||
|
||||
title: Binding for bq25890, bq25892, bq25895 and bq25896 Li-Ion Charger
|
||||
|
||||
maintainers:
|
||||
- Sebastian Reichel <sre@kernel.org>
|
||||
|
||||
allOf:
|
||||
- $ref: power-supply.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- ti,bq25890
|
||||
- ti,bq25892
|
||||
- ti,bq25895
|
||||
- ti,bq25896
|
||||
|
||||
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
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
i2c0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
charger@6a {
|
||||
compatible = "ti,bq25890";
|
||||
reg = <0x6a>;
|
||||
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
|
||||
|
||||
ti,battery-regulation-voltage = <4200000>;
|
||||
ti,charge-current = <1000000>;
|
||||
ti,termination-current = <50000>;
|
||||
ti,precharge-current = <128000>;
|
||||
ti,minimum-sys-voltage = <3600000>;
|
||||
ti,boost-voltage = <5000000>;
|
||||
ti,boost-max-current = <1000000>;
|
||||
|
||||
ti,use-ilim-pin;
|
||||
ti,thermal-regulation-threshold = <120>;
|
||||
};
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user