Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50fa8617 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-v3.18' of git://git.infradead.org/battery-2.6

Pull power supply and reset updates from Sebastian Reichel:
 - Initial support for the following chips
   * max77836 (charger)
   * max14577 (charger)
   * bq27742 (battery gauge)
   * ltc2952 (poweroff)
   * stih416 (restart)
   * syscon-reboot (restart)
   * gpio-restart (restart)
 - cleanup of power supply core
 - misc fixes in power supply and reset drivers

* tag 'for-v3.18' of git://git.infradead.org/battery-2.6: (48 commits)
  power: ab8500_fg: Fix build warning
  Documentation: charger: max14577: Update the date of introducing ABI
  power: reset: corrections for simple syscon reboot driver
  Documentation: power: reset: Add documentation for generic SYSCON reboot driver
  power: reset: Add generic SYSCON register mapped reset
  bq27x00_battery: Fix flag reading for bq27742
  power: reset: use restart_notifier mechanism for msm-poweroff
  power: Add simple gpio-restart driver
  power: reset: st: Provide DT bindings for ST's Power Reset driver
  power: reset: Add restart functionality for STiH41x platforms
  power: charger-manager: Fix NULL pointer exception with missing cm-fuel-gauge
  power: max14577: Fix circular config SYSFS dependency
  power: gpio-charger: do not use gpio value directly
  power: max8925: Use of_get_child_by_name
  power: max8925: Fix NULL ptr dereference on memory allocation failure
  bq27x00_battery: Add support to bq27742
  Documentation: charger: max14577: Document exported sysfs entry
  devicetree: mfd: max14577: Add device tree bindings document
  power: max17040: Add ID for MAX77836 Fuel Gauge block
  charger: max14577: Configure battery-dependent settings from DTS and sysfs
  ...

Conflicts:
	drivers/power/reset/Kconfig
	drivers/power/reset/Makefile
parents 6b049081 7881c647
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -18,3 +18,17 @@ Description:
		This file is writeable and can be used to set the assumed
		battery 'full level'. As batteries age, this value has to be
		amended over time.

What:		/sys/class/power_supply/max14577-charger/device/fast_charge_timer
Date:		October 2014
KernelVersion:	3.18.0
Contact:	Krzysztof Kozlowski <k.kozlowski@samsung.com>
Description:
		This entry shows and sets the maximum time the max14577
		charger operates in fast-charge mode. When the timer expires
		the device will terminate fast-charge mode (charging current
		will drop to 0 A) and will trigger interrupt.

		Valid values:
		- 5, 6 or 7 (hours),
		- 0: disabled.
+54 −0
Original line number Diff line number Diff line
Drive a GPIO line that can be used to restart the system from a restart
handler.

This binding supports level and edge triggered reset.  At driver load
time, the driver will request the given gpio line and install a restart
handler. If the optional properties 'open-source' is not found, the GPIO line
will be driven in the inactive state.  Otherwise its not driven until
the restart is initiated.

When the system is restarted, the restart handler will be invoked in
priority order.  The gpio is configured as an output, and driven active,
triggering a level triggered reset condition. This will also cause an
inactive->active edge condition, triggering positive edge triggered
reset. After a delay specified by active-delay, the GPIO is set to
inactive, thus causing an active->inactive edge, triggering negative edge
triggered reset. After a delay specified by inactive-delay, the GPIO
is driven active again.  After a delay specified by wait-delay, the
restart handler completes allowing other restart handlers to be attempted.

Required properties:
- compatible : should be "gpio-restart".
- gpios : The GPIO to set high/low, see "gpios property" in
  Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be
  low to reset the board set it to "Active Low", otherwise set
  gpio to "Active High".

Optional properties:
- open-source : Treat the GPIO as being open source and defer driving
  it to when the restart is initiated.  If this optional property is not
  specified, the GPIO is initialized as an output in its inactive state.
- priority : A priority ranging from 0 to 255 (default 128) according to
  the following guidelines:
	0:	Restart handler of last resort, with limited restart
		capabilities
	128:	Default restart handler; use if no other restart handler is
		expected to be available, and/or if restart functionality is
		sufficient to restart the entire system
	255:	Highest priority restart handler, will preempt all other
		restart handlers
- active-delay: Delay (default 100) to wait after driving gpio active [ms]
- inactive-delay: Delay (default 100) to wait after driving gpio inactive [ms]
- wait-delay: Delay (default 3000) to wait after completing restart
  sequence [ms]

Examples:

gpio-restart {
	compatible = "gpio-restart";
	gpios = <&gpio 4 0>;
	priority = <128>;
	active-delay = <100>;
	inactive-delay = <100>;
	wait-delay = <3000>;
};
+146 −0
Original line number Diff line number Diff line
Maxim MAX14577/77836 Multi-Function Device

MAX14577 is a Multi-Function Device with Micro-USB Interface Circuit, Li+
Battery Charger and SFOUT LDO output for powering USB devices. It is
interfaced to host controller using I2C.

MAX77836 additionally contains PMIC (with two LDO regulators) and Fuel Gauge.


Required properties:
- compatible : Must be "maxim,max14577" or "maxim,max77836".
- reg : I2C slave address for the max14577 chip (0x25 for max14577/max77836)
- interrupts : IRQ line for the chip.
- interrupt-parent :  The parent interrupt controller.


Required nodes:
 - charger :
	Node for configuring the charger driver.
	Required properties:
		- compatible : "maxim,max14577-charger"
			or "maxim,max77836-charger"
		- maxim,fast-charge-uamp : Current in uA for Fast Charge;
			Valid values:
			- for max14577: 90000 - 950000;
			- for max77836: 45000 - 475000;
		- maxim,eoc-uamp : Current in uA for End-Of-Charge mode;
			Valid values:
			- for max14577: 50000 - 200000;
			- for max77836: 5000 - 100000;
		- maxim,ovp-uvolt : OverVoltage Protection Threshold in uV;
			In an overvoltage condition, INT asserts and charging
			stops. Valid values:
			- 6000000, 6500000, 7000000, 7500000;
		- maxim,constant-uvolt : Battery Constant Voltage in uV;
			Valid values:
			- 4000000 - 4280000 (step by 20000);
			- 4350000;


Optional nodes:
- max14577-muic/max77836-muic :
	Node used only by extcon consumers.
	Required properties:
		- compatible : "maxim,max14577-muic" or "maxim,max77836-muic"

- regulators :
	Required properties:
		- compatible : "maxim,max14577-regulator"
			or "maxim,max77836-regulator"

	May contain a sub-node per regulator from the list below. Each
	sub-node should contain the constraints and initialization information
	for that regulator. See regulator.txt for a description of standard
	properties for these sub-nodes.

	List of valid regulator names:
	- for max14577: CHARGER, SAFEOUT.
	- for max77836: CHARGER, SAFEOUT, LDO1, LDO2.

	The SAFEOUT is a fixed voltage regulator so there is no need to specify
	voltages for it.


Example:

#include <dt-bindings/interrupt-controller/irq.h>

max14577@25 {
	compatible = "maxim,max14577";
	reg = <0x25>;
	interrupt-parent = <&gpx1>;
	interrupts = <5 IRQ_TYPE_NONE>;

	muic: max14577-muic {
		compatible = "maxim,max14577-muic";
	};

	regulators {
		compatible = "maxim,max14577-regulator";

		SAFEOUT {
			regulator-name = "SAFEOUT";
		};
		CHARGER {
			regulator-name = "CHARGER";
			regulator-min-microamp = <90000>;
			regulator-max-microamp = <950000>;
			regulator-boot-on;
		};
	};

	charger {
		compatible = "maxim,max14577-charger";

		maxim,constant-uvolt = <4350000>;
		maxim,fast-charge-uamp = <450000>;
		maxim,eoc-uamp = <50000>;
		maxim,ovp-uvolt = <6500000>;
	};
};


max77836@25 {
	compatible = "maxim,max77836";
	reg = <0x25>;
	interrupt-parent = <&gpx1>;
	interrupts = <5 IRQ_TYPE_NONE>;

	muic: max77836-muic {
		compatible = "maxim,max77836-muic";
	};

	regulators {
		compatible = "maxim,max77836-regulator";

		SAFEOUT {
			regulator-name = "SAFEOUT";
		};
		CHARGER {
			regulator-name = "CHARGER";
			regulator-min-microamp = <90000>;
			regulator-max-microamp = <950000>;
			regulator-boot-on;
		};
		LDO1 {
			regulator-name = "LDO1";
			regulator-min-microvolt = <2700000>;
			regulator-max-microvolt = <2700000>;
		};
		LDO2 {
			regulator-name = "LDO2";
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <3950000>;
		};
	};

	charger {
		compatible = "maxim,max77836-charger";

		maxim,constant-uvolt = <4350000>;
		maxim,fast-charge-uamp = <225000>;
		maxim,eoc-uamp = <7500>;
		maxim,ovp-uvolt = <6500000>;
	};
};
+26 −0
Original line number Diff line number Diff line
Binding for the LTC2952 PowerPath controller

This chip is used to externally trigger a system shut down. Once the trigger has
been sent, the chips' watchdog has to be reset to gracefully shut down.
If the Linux systems decides to shut down it powers off the platform via the
kill signal.

Required properties:

- compatible:		Must contain: "lltc,ltc2952"
- trigger-gpios:	phandle + gpio-specifier for the GPIO connected to the
			chip's trigger line
- watchdog-gpios:	phandle + gpio-specifier for the GPIO connected to the
			chip's watchdog line
- kill-gpios:		phandle + gpio-specifier for the GPIO connected to the
			chip's kill line

Example:

ltc2952 {
	compatible = "lltc,ltc2952";

	trigger-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
	watchdog-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
	kill-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
};
+11 −0
Original line number Diff line number Diff line
*Device-Tree bindings for ST SW reset functionality

Required properties:
- compatible: should be "st,<chip>-restart".
- st,syscfg: should be a phandle of the syscfg node.

Example node:
	restart {
		compatible = "st,stih416-restart";
		st,syscfg = <&syscfg_sbc>;
	};
Loading