Commit 3a2a8751 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents c90e7945 152204db
Loading
Loading
Loading
Loading
+44 −1
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -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
+0 −35
Original line number Diff line number Diff line
SYSCON reboot mode driver

This driver gets reboot mode magic value form 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.

This DT node should be represented as a sub-node of a "syscon", "simple-mfd"
node.

Required properties:
- compatible: should be "syscon-reboot-mode"
- offset: offset in the register map for the storage register (in bytes)

Optional property:
- mask: bits mask of the bits in the register to store the reboot mode magic value,
  default set to 0xffffffff if missing.

The rest of the properties should follow the generic reboot-mode description
found in reboot-mode.txt

Example:
	pmu: pmu@20004000 {
		compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd";
		reg = <0x20004000 0x100>;

		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>;
		};
	};
+55 −0
Original line number Diff line number Diff line
# 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>;
    };
...
+10 −5
Original line number Diff line number Diff line
@@ -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:
@@ -30,7 +33,10 @@ 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
@@ -38,7 +44,6 @@ properties:

required:
  - compatible
  - regmap
  - offset

additionalProperties: false
+6 −0
Original line number Diff line number Diff line
@@ -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
Loading