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

Commit 400c5bd5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:
 - new AXP20X USB Power driver
 - new Qualcomm SMBB driver
 - new TPS65217 Charger driver
 - BQ24257: add BQ24250/BQ24251 support
 - overhaul bq27x00 battery driver, rename to bq27xxx
 - misc fixes and cleanups

* tag 'for-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (54 commits)
  power: bq27xxx_battery: Remove unneeded dependency in Kconfig
  power: bq27xxx_battery: move irq handler to i2c section
  power: bq27xxx_battery: fix platform probe
  twl4030_charger: add missing iio dependency
  power_supply: charger-manager: add missing of_node_put
  Documentation: power: bq24257: Document exported sysfs entries
  power: bq24257: Add various device-specific sysfs properties
  power: bq24257: Allow input current limit sysfs access
  power: bq24257: Add input DPM voltage threshold setting support
  power: bq24257: Add over voltage protection setting support
  power: bq24257: Add SW-based approach for Power Good determination
  power: bq24257: Allow manual setting of input current limit
  power: bq24257: Add bit definition for temp sense enable
  power: bq24257: Add basic support for bq24250/bq24251
  dt: power: bq24257-charger: Cover additional devices
  power: bq24257: Simplify bq24257_power_supply_init()
  power: bq24257: Use managed power supply register
  power: bq24257: Streamline input current limit setup
  power: bq24257: Remove IRQ config through stat-gpios
  power: bq27xxx_battery: fix signedness bug in bq27xxx_battery_read_health()
  ...
parents 9bd9fa6c 6bd03ce3
Loading
Loading
Loading
Loading
+58 −0
Original line number Original line Diff line number Diff line
@@ -74,3 +74,61 @@ Description:


		Valid values:
		Valid values:
		- 0 - 70 (minutes), step by 10 (rounded down)
		- 0 - 70 (minutes), step by 10 (rounded down)

What:		/sys/class/power_supply/bq24257-charger/ovp_voltage
Date:		October 2015
KernelVersion:	4.4.0
Contact:	Andreas Dannenberg <dannenberg@ti.com>
Description:
		This entry configures the overvoltage protection feature of bq24257-
		type charger devices. This feature protects the device and other
		components against damage from overvoltage on the input supply. See
		device datasheet for details.

		Valid values:
		- 6000000, 6500000, 7000000, 8000000, 9000000, 9500000, 10000000,
		  10500000 (all uV)

What:		/sys/class/power_supply/bq24257-charger/in_dpm_voltage
Date:		October 2015
KernelVersion:	4.4.0
Contact:	Andreas Dannenberg <dannenberg@ti.com>
Description:
		This entry configures the input dynamic power path management voltage of
		bq24257-type charger devices. Once the supply drops to the configured
		voltage, the input current limit is reduced down to prevent the further
		drop of the supply. When the IC enters this mode, the charge current is
		lower than the set value. See device datasheet for details.

		Valid values:
		- 4200000, 4280000, 4360000, 4440000, 4520000, 4600000, 4680000,
		  4760000 (all uV)

What:		/sys/class/power_supply/bq24257-charger/high_impedance_enable
Date:		October 2015
KernelVersion:	4.4.0
Contact:	Andreas Dannenberg <dannenberg@ti.com>
Description:
		This entry allows enabling the high-impedance mode of bq24257-type
		charger devices. If enabled, it places the charger IC into low power
		standby mode with the switch mode controller disabled. When disabled,
		the charger operates normally. See device datasheet for details.

		Valid values:
		- 1: enabled
		- 0: disabled

What:		/sys/class/power_supply/bq24257-charger/sysoff_enable
Date:		October 2015
KernelVersion:	4.4.0
Contact:	Andreas Dannenberg <dannenberg@ti.com>
Description:
		This entry allows enabling the sysoff mode of bq24257-type charger
		devices. If enabled and the input is removed, the internal battery FET
		is turned off in order to reduce the leakage from the BAT pin to less
		than 1uA. Note that on some devices/systems this disconnects the battery
		from the system. See device datasheet for details.

		Valid values:
		- 1: enabled
		- 0: disabled
+48 −5
Original line number Original line Diff line number Diff line
Binding for TI bq24257 Li-Ion Charger
Binding for TI bq24250/bq24251/bq24257 Li-Ion Charger


Required properties:
Required properties:
- compatible: Should contain one of the following:
- compatible: Should contain one of the following:
 * "ti,bq24250"
 * "ti,bq24251"
 * "ti,bq24257"
 * "ti,bq24257"
- reg: integer, i2c address of the device.
- reg: integer, i2c address of the device.
- interrupt-parent: Should be the phandle for the interrupt controller. Use in
    conjunction with "interrupts".
- interrupts: Interrupt mapping for GPIO IRQ (configure for both edges). Use in
    conjunction with "interrupt-parent".
- ti,battery-regulation-voltage: integer, maximum charging voltage in uV.
- ti,battery-regulation-voltage: integer, maximum charging voltage in uV.
- ti,charge-current: integer, maximum charging current in uA.
- ti,charge-current: integer, maximum charging current in uA.
- ti,termination-current: integer, charge will be terminated when current in
- ti,termination-current: integer, charge will be terminated when current in
    constant-voltage phase drops below this value (in uA).
    constant-voltage phase drops below this value (in uA).


Optional properties:
- pg-gpios: GPIO used for connecting the bq2425x device PG (Power Good) pin.
    This pin is not available on all devices however it should be used if
    possible as this is the recommended way to obtain the charger's input PG
    state. If this pin is not specified a software-based approach for PG
    detection is used.
- ti,current-limit: The maximum current to be drawn from the charger's input
    (in uA). If this property is not specified, the input limit current is
    set automatically using USB D+/D- signal based charger type detection.
    If the hardware does not support the D+/D- based detection, a default
    of 500,000 is used (=500mA) instead.
- ti,ovp-voltage: Configures the over voltage protection voltage (in uV). If
    not specified a default of 6,5000,000 (=6.5V) is used.
- ti,in-dpm-voltage: Configures the threshold input voltage for the dynamic
    power path management (in uV). If not specified a default of 4,360,000
    (=4.36V) is used.

Example:
Example:


bq24257 {
bq24257 {
	compatible = "ti,bq24257";
	compatible = "ti,bq24257";
	reg = <0x6a>;
	reg = <0x6a>;
	interrupt-parent = <&gpio1>;
	interrupts = <16 IRQ_TYPE_EDGE_BOTH>;

	pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;


	ti,battery-regulation-voltage = <4200000>;
	ti,battery-regulation-voltage = <4200000>;
	ti,charge-current = <1000000>;
	ti,charge-current = <1000000>;
	ti,termination-current = <50000>;
	ti,termination-current = <50000>;
};
};

Example:

bq24250 {
	compatible = "ti,bq24250";
	reg = <0x6a>;
	interrupt-parent = <&gpio1>;
	interrupts = <16 IRQ_TYPE_EDGE_BOTH>;

	ti,battery-regulation-voltage = <4200000>;
	ti,charge-current = <500000>;
	ti,termination-current = <50000>;
	ti,current-limit = <900000>;
	ti,ovp-voltage = <9500000>;
	ti,in-dpm-voltage = <4440000>;
};
+34 −0
Original line number Original line Diff line number Diff line
AXP20x USB power supply

Required Properties:
-compatible: "x-powers,axp202-usb-power-supply"

This node is a subnode of the axp20x PMIC.

Example:

axp209: pmic@34 {
	compatible = "x-powers,axp209";
	reg = <0x34>;
	interrupt-parent = <&nmi_intc>;
	interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
	interrupt-controller;
	#interrupt-cells = <1>;

	regulators {
		x-powers,dcdc-freq = <1500>;

		vdd_cpu: dcdc2 {
			regulator-always-on;
			regulator-min-microvolt = <1000000>;
			regulator-max-microvolt = <1450000>;
			regulator-name = "vdd-cpu";
		};

		...
	};

	usb-power-supply: usb-power-supply {
		compatible = "x-powers,axp202-usb-power-supply";
	};
};
+131 −0
Original line number Original line Diff line number Diff line
Qualcomm Switch-Mode Battery Charger and Boost

PROPERTIES
- compatible:
  Usage: required
  Value type: <stringlist>
  Description: Must be one of:
               - "qcom,pm8941-charger"

- reg:
  Usage: required
  Value type: <prop-encoded-array>
  Description: Base address of registers for SMBB block

- interrupts:
  Usage: required
  Value type: <prop-encoded-array>
  Description: The format of the specifier is defined by the binding document
               describing the node's interrupt parent.  Must contain one
               specifier for each of the following interrupts, in order:
               - charge done
               - charge fast mode
               - charge trickle mode
               - battery temperature ok
               - battery present
               - charger disconnected
               - USB-in valid
               - DC-in valid

- interrupt-names:
  Usage: required
  Value type: <stringlist>
  Description: Must contain the following list, strictly ordered:
               "chg-done",
               "chg-fast",
               "chg-trkl",
               "bat-temp-ok",
               "bat-present",
               "chg-gone",
               "usb-valid",
               "dc-valid"

- qcom,fast-charge-current-limit:
  Usage: optional (default: 1A, or pre-configured value)
  Value type: <u32>; uA; range [100mA : 3A]
  Description: Maximum charge current; May be clamped to safety limits.

- qcom,fast-charge-low-threshold-voltage:
  Usage: optional (default: 3.2V, or pre-configured value)
  Value type: <u32>; uV; range [2.1V : 3.6V]
  Description: Battery voltage limit above which fast charging may operate;
               Below this value linear or switch-mode auto-trickle-charging
               will operate.

- qcom,fast-charge-high-threshold-voltage:
  Usage: optional (default: 4.2V, or pre-configured value)
  Value type: <u32>; uV; range [3.24V : 5V]
  Description: Battery voltage limit below which fast charging may operate;
               The fast charger will attempt to charge the battery to this
               voltage.  May be clamped to safety limits.

- qcom,fast-charge-safe-voltage:
  Usage: optional (default: 4.2V, or pre-configured value)
  Value type: <u32>; uV; range [3.24V : 5V]
  Description: Maximum safe battery voltage; May be pre-set by bootloader, in
               which case, setting this will harmlessly fail. The property
               'fast-charge-high-watermark' will be clamped by this value.

- qcom,fast-charge-safe-current:
  Usage: optional (default: 1A, or pre-configured value)
  Value type: <u32>; uA; range [100mA : 3A]
  Description: Maximum safe battery charge current; May pre-set by bootloader,
               in which case, setting this will harmlessly fail. The property
               'qcom,fast-charge-current-limit' will be clamped by this value.

- qcom,auto-recharge-threshold-voltage:
  Usage: optional (default: 4.1V, or pre-configured value)
  Value type: <u32>; uV; range [3.24V : 5V]
  Description: Battery voltage limit below which auto-recharge functionality
               will restart charging after end-of-charge;  The high cutoff
               limit for auto-recharge is 5% above this value.

- qcom,minimum-input-voltage:
  Usage: optional (default: 4.3V, or pre-configured value)
  Value type: <u32>; uV; range [4.2V : 9.6V]
  Description: Input voltage level above which charging may operate

- qcom,dc-current-limit:
  Usage: optional (default: 100mA, or pre-configured value)
  Value type: <u32>; uA; range [100mA : 2.5A]
  Description: Default DC charge current limit

- qcom,disable-dc:
  Usage: optional (default: false)
  Value type: boolean: <u32> or <empty>
  Description: Disable DC charger

- qcom,jeita-extended-temp-range:
  Usage: optional (default: false)
  Value type: boolean: <u32> or <empty>
  Description: Enable JEITA extended temperature range;  This does *not*
               adjust the maximum charge voltage or current in the extended
               temperature range.  It only allows charging when the battery
               is in the extended temperature range.  Voltage/current
               regulation must be done externally to fully comply with
               the JEITA safety guidelines if this flag is set.

EXAMPLE
charger@1000 {
       compatible = "qcom,pm8941-charger";
       reg = <0x1000 0x700>;
       interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
                       <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
       interrupt-names = "chg-done",
                       "chg-fast",
                       "chg-trkl",
                       "bat-temp-ok",
                       "bat-present",
                       "chg-gone",
                       "usb-valid",
                       "dc-valid";

       qcom,fast-charge-current-limit = <1000000>;
       qcom,dc-charge-current-limit = <1000000>;
};
+12 −0
Original line number Original line Diff line number Diff line
TPS65217 Charger

Required Properties:
-compatible: "ti,tps65217-charger"

This node is a subnode of the tps65217 PMIC.

Example:

	tps65217-charger {
		compatible = "ti,tps65090-charger";
	};
Loading