Skip to content

Commit

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

Pull power supply and reset updates from Sebastian Reichel:
 "This time there are lots of changes. Quite a few changes to the core,
  lots of driver changes and one change to kobject core (with Ack from
  Greg).

  Summary:

  kobject:
   - Increase number of allowed uevent variables

  power-supply core:
   - Add power-supply type in uevent
   - Cleanup property handling in core
   - Make property and usb_type pointers const
   - Convert core power-supply DT binding to YAML
   - Cleanup HWMON code
   - Add new health status "calibration required"
   - Add new properties for manufacture date and capacity error margin

  battery drivers:
   - new cw2015 battery driver used by pine64 Pinebook Pro laptop
   - axp22: blacklist on Meegopad T02
   - sc27xx: support current/voltage reading
   - max17042: support time-to-empty reading
   - simple-battery: add more battery parameters
   - bq27xxx: convert DT binding document to YAML
   - sbs-battery: add TI BQ20Z65 support, fix technology property,
         convert DT binding to YAML, add option to disable charger
         broadcasts, add new properties: manufacture date, capacity
         error margin, average current, charge current and voltage and
         support calibration required health status
   - misc fixes

  charger drivers:
   - bq25890: cleanup, implement charge type, precharge current and
         input current limiting properties
   - bd70528: use new linear range helper library
   - bd99954: new charger driver
   - mp2629: new charger driver
   - misc fixes

  reboot drivers:
   - oxnas-restart: introduce new driver
   - syscon-reboot: convert DT binding to YAML, add parent syscon device
         support
   - misc fixes"

* tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (85 commits)
  power: supply: cw2015: Attach OF ID table to the driver
  power: reset: gpio-poweroff: add missing '\n' in dev_err()
  Revert "power: supply: sbs-battery: simplify read_read_string_data"
  Revert "power: supply: sbs-battery: add PEC support"
  dt-bindings: power: sbs-battery: Convert to yaml
  power: supply: sbs-battery: constify power-supply property array
  power: supply: sbs-battery: switch to i2c's probe_new
  power: supply: sbs-battery: switch from of_property_* to device_property_*
  power: supply: sbs-battery: add ability to disable charger broadcasts
  power: supply: sbs-battery: fix idle battery status
  power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support
  power: supply: sbs-battery: add MANUFACTURE_DATE support
  power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support
  power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support
  power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support
  power: supply: sbs-battery: add PEC support
  power: supply: sbs-battery: simplify read_read_string_data
  power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support
  power: supply: sbs-battery: Add TI BQ20Z65 support
  power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED
  ...
  • Loading branch information
torvalds committed Jun 10, 2020
2 parents c90e794 + 152204d commit 3a2a875
Show file tree
Hide file tree
Showing 53 changed files with 4,693 additions and 678 deletions.
45 changes: 44 additions & 1 deletion Documentation/ABI/testing/sysfs-class-power
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ Description:
Access: Read, Write
Valid values: 0 - 100 (percent)

What: /sys/class/power_supply/<supply_name>/capacity_error_margin
Date: April 2019
Contact: linux-pm@vger.kernel.org
Description:
Battery capacity measurement becomes unreliable without
recalibration. This values provides the maximum error
margin expected to exist by the fuel gauge in percent.
Values close to 0% will be returned after (re-)calibration
has happened. Over time the error margin will increase.
100% means, that the capacity related values are basically
completely useless.

Access: Read
Valid values: 0 - 100 (percent)

What: /sys/class/power_supply/<supply_name>/capacity_level
Date: June 2009
Contact: linux-pm@vger.kernel.org
Expand Down Expand Up @@ -190,7 +205,7 @@ Description:
Valid values: "Unknown", "Good", "Overheat", "Dead",
"Over voltage", "Unspecified failure", "Cold",
"Watchdog timer expire", "Safety timer expire",
"Over current"
"Over current", "Calibration required"

What: /sys/class/power_supply/<supply_name>/precharge_current
Date: June 2017
Expand Down Expand Up @@ -665,3 +680,31 @@ Description:
Valid values:
- 1: enabled
- 0: disabled

What: /sys/class/power_supply/<supply_name>/manufacture_year
Date: January 2020
Contact: linux-pm@vger.kernel.org
Description:
Reports the year (following Gregorian calendar) when the device has been
manufactured.

Access: Read
Valid values: Reported as integer

What: /sys/class/power_supply/<supply_name>/manufacture_month
Date: January 2020
Contact: linux-pm@vger.kernel.org
Description:
Reports the month when the device has been manufactured.

Access: Read
Valid values: 1-12

What: /sys/class/power_supply/<supply_name>/manufacture_day
Date: January 2020
Contact: linux-pm@vger.kernel.org
Description:
Reports the day of month when the device has been manufactured.

Access: Read
Valid values: 1-31

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Generic SYSCON reboot mode driver

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

description: |
This driver gets reboot mode magic value from reboot-mode driver
and stores it in a SYSCON mapped register. Then the bootloader
can read it and take different action according to the magic
value stored. The SYSCON mapped register is retrieved from the
parental dt-node plus the offset. So the SYSCON reboot-mode node
should be represented as a sub-node of a "syscon", "simple-mfd" node.
properties:
compatible:
const: syscon-reboot-mode

mask:
$ref: /schemas/types.yaml#/definitions/uint32
description: Update only the register bits defined by the mask (32 bit)

offset:
$ref: /schemas/types.yaml#/definitions/uint32
description: Offset in the register map for the mode register (in bytes)

patternProperties:
"^mode-.+":
$ref: /schemas/types.yaml#/definitions/uint32
description: Vendor-specific mode value written to the mode register

additionalProperties: false

required:
- compatible
- offset

examples:
- |
#include <dt-bindings/soc/rockchip,boot-mode.h>
reboot-mode {
compatible = "syscon-reboot-mode";
offset = <0x40>;
mode-normal = <BOOT_NORMAL>;
mode-recovery = <BOOT_RECOVERY>;
mode-bootloader = <BOOT_FASTBOOT>;
mode-loader = <BOOT_BL_DOWNLOAD>;
};
...
15 changes: 10 additions & 5 deletions Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ maintainers:
description: |+
This is a generic reset driver using syscon to map the reset register.
The reset is generally performed with a write to the reset register
defined by the register map pointed by syscon reference plus the offset
with the value and mask defined in the reboot node.
Default will be little endian mode, 32 bit access only.
defined by the SYSCON register map base plus the offset with the value and
mask defined in the reboot node. Default will be little endian mode, 32 bit
access only. The SYSCON registers map is normally retrieved from the
parental dt-node. So the SYSCON reboot node should be represented as a
sub-node of a "syscon", "simple-mfd" node. Though the regmap property
pointing to the system controller node is also supported.
properties:
compatible:
Expand All @@ -30,15 +33,17 @@ properties:

regmap:
$ref: /schemas/types.yaml#/definitions/phandle
description: Phandle to the register map node.
deprecated: true
description: |
Phandle to the register map node. This property is deprecated in favor of
the syscon-reboot node been a child of a system controller node.
value:
$ref: /schemas/types.yaml#/definitions/uint32
description: The reset value written to the reboot register (32 bit access).

required:
- compatible
- regmap
- offset

additionalProperties: false
Expand Down
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/power/supply/battery.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ different type. This prevents unpredictable, potentially harmful,
behavior should a replacement that changes the battery type occur
without a corresponding update to the dtb.

Please note that not all charger drivers respect all of the properties.

Required Properties:
- compatible: Must be "simple-battery"

Optional Properties:
- over-voltage-threshold-microvolt: battery over-voltage limit
- re-charge-voltage-microvolt: limit to automatically start charging again
- voltage-min-design-microvolt: drained battery voltage
- voltage-max-design-microvolt: fully charged battery voltage
- energy-full-design-microwatt-hours: battery design energy
- charge-full-design-microamp-hours: battery design capacity
- trickle-charge-current-microamp: current for trickle-charge phase
- precharge-current-microamp: current for pre-charge phase
- precharge-upper-limit-microvolt: limit when to change to constant charging
- charge-term-current-microamp: current for charge termination phase
- constant-charge-current-max-microamp: maximum constant input current
- constant-charge-voltage-max-microvolt: maximum constant input voltage
Expand Down
56 changes: 0 additions & 56 deletions Documentation/devicetree/bindings/power/supply/bq27xxx.txt

This file was deleted.

91 changes: 91 additions & 0 deletions Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 Texas Instruments Incorporated
%YAML 1.2
---
$id: "http://devicetree.org/schemas/power/supply/bq27xxx.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: TI BQ27XXX fuel gauge family

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

description: |
Support various Texas Instruments fuel gauge devices that share similar
register maps and power supply properties
allOf:
- $ref: power-supply.yaml#

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

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

monitored-battery:
description: |
phandle of battery characteristics node.
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.
See Documentation/devicetree/bindings/power/supply/battery.txt
power-supplies: true

required:
- compatible
- reg
additionalProperties: false

examples:
- |
i2c0 {
#address-cells = <1>;
#size-cells = <0>;
bat: battery {
compatible = "simple-battery";
voltage-min-design-microvolt = <3200000>;
energy-full-design-microwatt-hours = <5290000>;
charge-full-design-microamp-hours = <1430000>;
};
bq27510g3: fuel-gauge@55 {
compatible = "ti,bq27510g3";
reg = <0x55>;
monitored-battery = <&bat>;
};
};
Loading

0 comments on commit 3a2a875

Please sign in to comment.