Skip to content

Commit

Permalink
Merge tag 'for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Power-supply core:
   - add wireless type
   - properly document current direction

  Battery/charger driver changes:
   - new fuel-gauge/charger driver for RN5T618/RN5T619
   - new charger driver for BQ25980, BQ25975 and BQ25960
   - bq27xxx-battery: add support for TI bq34z100
   - gpio-charger: convert to GPIO descriptors
   - gpio-charger: add optional support for charge current limiting
   - max17040: add support for max17041, max17043, max17044
   - max17040: add support for max17048, max17049, max17058, max17059
   - smb347-charger: add DT support
   - smb247-charger: add SMB345 and SMB358 support
   - simple-battery: add temperature properties
   - lots of minor fixes, cleanups and DT binding YAML conversions

  Reset drivers:
   - ocelot: Add support for Sparx5"

* tag 'for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (81 commits)
  power: reset: POWER_RESET_OCELOT_RESET should depend on Ocelot or Sparx5
  power: supply: bq25980: Fix uninitialized wd_reg_val and overrun
  power: supply: ltc2941: Fix ptr to enum cast
  power: supply: test-power: revise parameter printing to use sprintf
  power: supply: charger-manager: fix incorrect check on charging_duration_ms
  power: supply: max17040: Fix ptr to enum cast
  power: supply: bq25980: Fix uninitialized wd_reg_val
  power: supply: bq25980: remove redundant zero check on ret
  power: reset: ocelot: Add support for Sparx5
  dt-bindings: reset: ocelot: Add Sparx5 support
  power: supply: sbs-battery: keep error code when get_property() fails
  power: supply: bq25980: Add support for the BQ259xx family
  dt-binding: bq25980: Add the bq25980 flash charger
  power: supply: fix spelling mistake "unprecise" -> "imprecise"
  power: supply: test_power: add missing newlines when printing parameters by sysfs
  power: supply: pm2301: drop duplicated i2c_device_id
  power: supply: charger-manager: drop unused charger assignment
  power: supply: rt9455: skip 'struct acpi_device_id' when !CONFIG_ACPI
  power: supply: goldfish: skip 'struct acpi_device_id' when !CONFIG_ACPI
  power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI
  ...
  • Loading branch information
torvalds committed Oct 20, 2020
2 parents f9915b9 + 7007fab commit 38525c6
Show file tree
Hide file tree
Showing 55 changed files with 3,938 additions and 1,383 deletions.
8 changes: 5 additions & 3 deletions Documentation/ABI/testing/sysfs-class-power
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Description:
Describes the main type of the supply.

Access: Read
Valid values: "Battery", "UPS", "Mains", "USB"
Valid values: "Battery", "UPS", "Mains", "USB", "Wireless"

===== Battery Properties =====

Expand Down Expand Up @@ -108,7 +108,8 @@ Description:
which they average readings to smooth out the reported value.

Access: Read
Valid values: Represented in microamps
Valid values: Represented in microamps. Negative values are used
for discharging batteries, positive values for charging batteries.

What: /sys/class/power_supply/<supply_name>/current_max
Date: October 2010
Expand All @@ -127,7 +128,8 @@ Description:
This value is not averaged/smoothed.

Access: Read
Valid values: Represented in microamps
Valid values: Represented in microamps. Negative values are used
for discharging batteries, positive values for charging batteries.

What: /sys/class/power_supply/<supply_name>/charge_control_limit
Date: Oct 2012
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Microsemi Ocelot reset controller

The DEVCPU_GCB:CHIP_REGS have a SOFT_RST register that can be used to reset the
SoC MIPS core.
SoC core.

The reset registers are both present in the MSCC vcoreiii MIPS and
microchip Sparx5 armv8 SoC's.

Required Properties:
- compatible: "mscc,ocelot-chip-reset"
- compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-reset"

Example:
reset@1070008 {
Expand Down
25 changes: 0 additions & 25 deletions Documentation/devicetree/bindings/power/reset/reboot-mode.txt

This file was deleted.

47 changes: 47 additions & 0 deletions Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/reboot-mode.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Generic reboot mode core map

maintainers:
- Andy Yan <[email protected]>

description: |
This driver get reboot mode arguments and call the write
interface to store the magic value in special register
or ram. Then the bootloader can read it and take different
action according to the argument stored.
All mode properties are vendor specific, it is a indication to tell
the bootloader what to do when the system reboots, and should be named
as mode-xxx = <magic> (xxx is mode name, magic should be a non-zero value).
For example, modes common Android platform are:
- normal: Normal reboot mode, system reboot with command "reboot".
- recovery: Android Recovery mode, it is a mode to format the device or update a new image.
- bootloader: Android fastboot mode, it's a mode to re-flash partitions on the Android based device.
- loader: A bootloader mode, it's a mode used to download image on Rockchip platform,
usually used in development.
properties:
mode-normal:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Default value to set on a reboot if no command was provided.
patternProperties:
"^mode-.*$":
$ref: /schemas/types.yaml#/definitions/uint32

examples:
- |
reboot-mode {
mode-normal = <0>;
mode-recovery = <1>;
mode-bootloader = <2>;
mode-loader = <3>;
};
...
24 changes: 24 additions & 0 deletions Documentation/devicetree/bindings/power/supply/battery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,27 @@ properties:
An array containing the temperature in degree Celsius,
for each of the battery capacity lookup table.
operating-range-celsius:
$ref: /schemas/types.yaml#/definitions/uint32-array
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:
$ref: /schemas/types.yaml#/definitions/uint32-array
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:
$ref: /schemas/types.yaml#/definitions/uint32-array
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

required:
- compatible

Expand Down Expand Up @@ -130,6 +151,9 @@ examples:
/* 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 {
Expand Down
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/power/supply/bq25890.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Optional properties:
- 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:

Expand Down
114 changes: 114 additions & 0 deletions Documentation/devicetree/bindings/power/supply/bq25980.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# 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:
- Dan Murphy <[email protected]>
- Ricardo Rivera-Matos <[email protected]>

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:
description: |
Indicates that the device state has changed.
monitored-battery:
$ref: /schemas/types.yaml#/definitions/phandle
description: phandle to the battery node being monitored

required:
- compatible
- reg
- monitored-battery

unevaluatedProperties: false

examples:
- |
bat: battery {
compatible = "simple-battery";
constant-charge-current-max-microamp = <4000000>;
constant-charge-voltage-max-microvolt = <8400000>;
precharge-current-microamp = <160000>;
charge-term-current-microamp = <160000>;
};
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c0 {
#address-cells = <1>;
#size-cells = <0>;
bq25980: charger@65 {
compatible = "ti,bq25980";
reg = <0x65>;
interrupt-parent = <&gpio1>;
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
ti,watchdog-timer = <0>;
ti,sc-ocp-limit-microamp = <2000000>;
ti,sc-ovp-limit-microvolt = <17800000>;
monitored-battery = <&bat>;
};
};
...
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ properties:
- ti,bq27621
- ti,bq27z561
- ti,bq28z610
- ti,bq34z100

reg:
maxItems: 1
Expand Down
30 changes: 20 additions & 10 deletions Documentation/devicetree/bindings/power/supply/charger-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,32 @@ charger-manager bindings

Required properties :
- compatible : "charger-manager"
- <>-supply : for regulator consumer
- cm-num-chargers : number of chargers
- <>-supply : for regulator consumer, named according to cm-regulator-name
- cm-chargers : name of chargers
- cm-fuel-gauge : name of battery fuel gauge
- subnode <regulator> :
- cm-regulator-name : name of charger regulator
- subnode <cable> :
- cm-cable-name : name of charger cable
- cm-cable-name : name of charger cable - one of USB, USB-HOST,
SDP, DCP, CDP, ACA, FAST-CHARGER, SLOW-CHARGER, WPT,
PD, DOCK, JIG, or MECHANICAL
- cm-cable-extcon : name of extcon dev
(optional) - cm-cable-min : minimum current of cable
(optional) - cm-cable-max : maximum current of cable

Optional properties :
- cm-name : charger manager's name (default : "battery")
- cm-poll-mode : polling mode (enum polling_modes)
- cm-poll-interval : polling interval
- cm-battery-stat : battery status (enum data_source)
- cm-fullbatt-* : data for full battery checking
- cm-poll-mode : polling mode - 0 for disabled, 1 for always, 2 for when
external power is connected, or 3 for when charging. If not present,
then polling is disabled
- cm-poll-interval : polling interval (in ms)
- cm-battery-stat : battery status - 0 for battery always present, 1 for no
battery, 2 to check presence via fuel gauge, or 3 to check presence
via charger
- cm-fullbatt-vchkdrop-volt : voltage drop (in uV) before restarting charging
- cm-fullbatt-voltage : voltage (in uV) of full battery
- cm-fullbatt-soc : state of charge to consider as full battery
- cm-fullbatt-capacity : capcity (in uAh) to consider as full battery
- cm-thermal-zone : name of external thermometer's thermal zone
- cm-battery-* : threshold battery temperature for charging
-cold : critical cold temperature of battery for charging
Expand All @@ -29,6 +37,10 @@ Optional properties :
-temp-diff : temperature difference to allow recharging
- cm-dis/charging-max = limits of charging duration

Deprecated properties:
- cm-num-chargers
- cm-fullbatt-vchkdrop-ms

Example :
charger-manager@0 {
compatible = "charger-manager";
Expand All @@ -39,13 +51,11 @@ Example :
cm-poll-mode = <1>;
cm-poll-interval = <30000>;

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

cm-battery-stat = <3>;

cm-num-chargers = <3>;
cm-chargers = "charger0", "charger1", "charger2";

cm-fuel-gauge = "fuelgauge0";
Expand All @@ -71,7 +81,7 @@ Example :
cm-cable-max = <500000>;
};
cable@1 {
cm-cable-name = "TA";
cm-cable-name = "SDP";
cm-cable-extcon = "extcon-dev.0";
cm-cable-min = <650000>;
cm-cable-max = <675000>;
Expand Down
Loading

0 comments on commit 38525c6

Please sign in to comment.