Commit 8649efb2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:
 "Core:
   - Add over-current health state
   - Add standard, adaptive and custom charge types
   - Add new properties for start/end charge threshold

  New Drivers / Hardware:
   - UCS1002 Programmable USB Port Power Controller
   - Ingenic JZ47xx Battery Fuel Gauge
   - AXP20x USB Power: Add AXP813 support
   - AT91 poweroff: Add SAM9X60 support
   - OLPC battery: Add XO-1.5 and XO-1.75 support

  Misc Changes:
   - syscon-reboot: support mask property
   - AXP288 fuel gauge: Blacklist ACEPC T8/T11. Looks like some vendor
     thought it's a good idea to build a desktop system with a fuel
     gauge, that slowly "discharges"...
   - cpcap-battery: Fix calculation errors
   - misc fixes"

* tag 'for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (54 commits)
  power: supply: olpc_battery: force the le/be casts
  power: supply: ucs1002: Fix build error without CONFIG_REGULATOR
  power: supply: ucs1002: Fix wrong return value checking
  power: supply: Add driver for Microchip UCS1002
  dt-bindings: power: supply: Add bindings for Microchip UCS1002
  power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant
  power: supply: core: fix clang -Wunsequenced
  power: supply: core: Add missing documentation for CHARGE_CONTROL_* properties
  power: supply: core: Add CHARGE_CONTROL_{START_THRESHOLD,END_THRESHOLD} properties
  power: supply: core: Add Standard, Adaptive, and Custom charge types
  power: supply: axp288_fuel_gauge: Add ACEPC T8 and T11 mini PCs to the blacklist
  power: supply: bq27xxx_battery: Notify also about status changes
  power: supply: olpc_battery: Have the framework register sysfs files for us
  power: supply: olpc_battery: Add OLPC XO 1.75 support
  power: supply: olpc_battery: Avoid using platform_info
  power: supply: olpc_battery: Use devm_power_supply_register()
  power: supply: olpc_battery: Move priv data to a struct
  power: supply: olpc_battery: Use DT to get battery version
  x86/platform/olpc: Use a correct version when making up a battery node
  x86/platform/olpc: Trivial code move in DT fixup
  ...
parents 5fd09ba6 baf5964e
Loading
Loading
Loading
Loading
+48 −3
Original line number Diff line number Diff line
@@ -114,15 +114,60 @@ Description:
		Access: Read
		Valid values: Represented in microamps

What:		/sys/class/power_supply/<supply_name>/charge_control_limit
Date:		Oct 2012
Contact:	linux-pm@vger.kernel.org
Description:
		Maximum allowable charging current. Used for charge rate
		throttling for thermal cooling or improving battery health.

		Access: Read, Write
		Valid values: Represented in microamps

What:		/sys/class/power_supply/<supply_name>/charge_control_limit_max
Date:		Oct 2012
Contact:	linux-pm@vger.kernel.org
Description:
		Maximum legal value for the charge_control_limit property.

		Access: Read
		Valid values: Represented in microamps

What:		/sys/class/power_supply/<supply_name>/charge_control_start_threshold
Date:		April 2019
Contact:	linux-pm@vger.kernel.org
Description:
		Represents a battery percentage level, below which charging will
		begin.

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

What:		/sys/class/power_supply/<supply_name>/charge_control_end_threshold
Date:		April 2019
Contact:	linux-pm@vger.kernel.org
Description:
		Represents a battery percentage level, above which charging will
		stop.

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

What:		/sys/class/power_supply/<supply_name>/charge_type
Date:		July 2009
Contact:	linux-pm@vger.kernel.org
Description:
		Represents the type of charging currently being applied to the
		battery.
		battery. "Trickle", "Fast", and "Standard" all mean different
		charging speeds. "Adaptive" means that the charger uses some
		algorithm to adjust the charge rate dynamically, without
		any user configuration required. "Custom" means that the charger
		uses the charge_control_* properties as configuration for some
		different algorithm.

		Access: Read
		Valid values: "Unknown", "N/A", "Trickle", "Fast"
		Access: Read, Write
		Valid values: "Unknown", "N/A", "Trickle", "Fast", "Standard",
			      "Adaptive", "Custom"

What:		/sys/class/power_supply/<supply_name>/charge_term_current
Date:		July 2014
+4 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ SHDWC SAMA5D2-Compatible Shutdown Controller
1) shdwc node

required properties:
- compatible: should be "atmel,sama5d2-shdwc".
- compatible: should be "atmel,sama5d2-shdwc" or "microchip,sam9x60-shdwc".
- reg: should contain registers location and length
- clocks: phandle to input clock.
- #address-cells: should be one. The cell is the wake-up input index.
@@ -96,6 +96,9 @@ optional properties:
  microseconds. It's usually a board-related property.
- atmel,wakeup-rtc-timer: boolean to enable Real-Time Clock wake-up.

optional microchip,sam9x60-shdwc properties:
- atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up.

The node contains child nodes for each wake-up input that the platform uses.

2) input nodes
+9 −2
Original line number Diff line number Diff line
@@ -3,13 +3,20 @@ Generic SYSCON mapped register reset driver
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 mask defined in the reboot node.
with the value and mask defined in the reboot node.

Required properties:
- compatible: should contain "syscon-reboot"
- regmap: this is phandle to the register map node
- offset: offset in the register map for the reboot register (in bytes)
- mask: the reset value written to the reboot register (32 bit access)
- value: the reset value written to the reboot register (32 bit access)

Optional properties:
- mask: update only the register bits defined by the mask (32 bit)

Legacy usage:
If a node doesn't contain a value property but contains a mask property, the
mask property is used as the value.

Default will be little endian mode, 32 bit access only.

+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ 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
+6 −2
Original line number Diff line number Diff line
@@ -14,13 +14,17 @@ Required properties :
     usb-cdp (USB charging downstream port)
     usb-aca (USB accessory charger adapter)

Optional properties:
 - charge-status-gpios: GPIO indicating whether a battery is charging.

Example:

	usb_charger: charger {
		compatible = "gpio-charger";
		charger-type = "usb-sdp";
		gpios = <&gpf0 2 0 0 0>;
	}
		gpios = <&gpd 28 GPIO_ACTIVE_LOW>;
		charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>;
	};

	battery {
		power-supplies = <&usb_charger>;
Loading