Skip to content

Commit a7dcf5f

Browse files
committed
Merge tag 'for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel: "Battery/charger driver changes: - acer_a500: new fuel gauge driver for Acer Iconia Tab A500 - bq256xx: new charger driver - bq27xxx: Support CHARGE_NOW for bq27z561/bq28z610/bq34z100 - bq27xxx: Fix inverted CURRENT_NOW sign - cpcap: rework fuel gauge and charger drivers - ltc4162l: new charger driver - max8997-charger: add extcon based current limit configuration - max8903, wm97xx, z2: convert to GPIO descriptors (incl. ARM board files) - misc cleanup and fixes Reset drivers: - new poweroff driver for ATC260x - at91-sama5d2_shdwc: add support for sama7g5 - drop zte zx driver (SoC support is removed from kernel)" * tag 'for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (55 commits) power-supply: use kobj_to_dev() power: supply: charger-manager: fix typo power/reset: remove zte zx driver power: supply: bq25980: Fix repetive bq25975 with bq25960 power: supply: smb347-charger: Fix interrupt usage if interrupt is unavailable power: supply: axp20x_usb_power: Init work before enabling IRQs power: supply: fix sbs-charger build, needs REGMAP_I2C power: supply: bq27xxx: fix polarity of current_now power: supply: charger-manager: fix incorrect health status power: reset: at91-sama5d2_shdwc: add support for sama7g5 dt-bindings: atmel-sysreg: add microchip,sama7g5-shdwc power: reset: at91-sama5d2_shdwc: fix wkupdbc mask dt-bindings: power/supply: Add ltc4162-l-charger power: supply: bq24190_charger: convert comma to semicolon power: supply: ab8500_fg: convert comma to semicolon power: supply: ds2780: Switch to using the new API kobj_to_dev() power: supply: bq27xxx: Support CHARGE_NOW for bq27z561/bq28z610/bq34z100 power: supply: cpcap-charger: Fix power_supply_put on null battery pointer power: supply: cpcap-battery: constify psy_desc power: supply: cpcap-battery: Fix typo ...
2 parents 28b9aaa + a72acc5 commit a7dcf5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4331
-559
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
What: /sys/class/power_supply/ltc4162-l/charge_status
2+
Date: Januari 2021
3+
KernelVersion: 5.11
4+
Description:
5+
Detailed charge status information as reported by the chip.
6+
7+
Access: Read
8+
9+
Valid values:
10+
ilim_reg_active
11+
thermal_reg_active
12+
vin_uvcl_active
13+
iin_limit_active
14+
constant_current
15+
constant_voltage
16+
charger_off
17+
18+
What: /sys/class/power_supply/ltc4162-l/ibat
19+
Date: Januari 2021
20+
KernelVersion: 5.11
21+
Description:
22+
Battery input current as measured by the charger. Negative value
23+
means that the battery is discharging.
24+
25+
Access: Read
26+
27+
Valid values: Signed value in microamps
28+
29+
What: /sys/class/power_supply/ltc4162-l/vbat
30+
Date: Januari 2021
31+
KernelVersion: 5.11
32+
Description:
33+
Battery voltage as measured by the charger.
34+
35+
Access: Read
36+
37+
Valid values: In microvolts
38+
39+
What: /sys/class/power_supply/ltc4162-l/vbat_avg
40+
Date: Januari 2021
41+
KernelVersion: 5.11
42+
Description:
43+
Battery voltage, averaged over time, as measured by the charger.
44+
45+
Access: Read
46+
47+
Valid values: In microvolts
48+
49+
What: /sys/class/power_supply/ltc4162-l/force_telemetry
50+
Date: Januari 2021
51+
KernelVersion: 5.11
52+
Description:
53+
To save battery current, the measurement system is disabled if
54+
the battery is the only source of power. This affects all
55+
voltage, current and temperature measurements.
56+
Write a "1" to this to keep performing telemetry once every few
57+
seconds, even when running on battery (as reported by the online
58+
property, which is "1" when external power is available and "0"
59+
when the system runs on battery).
60+
61+
Access: Read, Write
62+
63+
Valid values: 0 (disabled) or 1 (enabled)
64+
65+
What: /sys/class/power_supply/ltc4162-l/arm_ship_mode
66+
Date: Januari 2021
67+
KernelVersion: 5.11
68+
Description:
69+
The charger will normally drain the battery while inactive,
70+
typically drawing about 54 microamps. Write a "1" to this
71+
property to arm a special "ship" mode that extends shelf life
72+
by reducing the leakage to about 2.8 microamps. The chip will
73+
remain in this mode (and no longer respond to I2C commands)
74+
until some external power-supply is attached raising the input
75+
voltage above 1V. It will then automatically revert to "0".
76+
Writing a "0" to the property cancels the "ship" mode request.
77+
The ship mode, when armed, activates once the input voltage
78+
drops below 1V.
79+
80+
Access: Read, Write
81+
82+
Valid values: 0 (disable) or 1 (enable)

Documentation/devicetree/bindings/arm/atmel-sysregs.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ SHDWC SAMA5D2-Compatible Shutdown Controller
9191
1) shdwc node
9292

9393
required properties:
94-
- compatible: should be "atmel,sama5d2-shdwc" or "microchip,sam9x60-shdwc".
94+
- compatible: should be "atmel,sama5d2-shdwc", "microchip,sam9x60-shdwc" or
95+
"microchip,sama7g5-shdwc"
9596
- reg: should contain registers location and length
9697
- clocks: phandle to input clock.
9798
- #address-cells: should be one. The cell is the wake-up input index.
@@ -103,7 +104,7 @@ optional properties:
103104
microseconds. It's usually a board-related property.
104105
- atmel,wakeup-rtc-timer: boolean to enable Real-Time Clock wake-up.
105106

106-
optional microchip,sam9x60-shdwc properties:
107+
optional microchip,sam9x60-shdwc or microchip,sama7g5-shdwc properties:
107108
- atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up.
108109

109110
The node contains child nodes for each wake-up input that the platform uses.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
2+
# Copyright (C) 2020 Texas Instruments Incorporated
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/power/supply/bq256xx.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: TI bq256xx Switch Mode Buck Charger
9+
10+
maintainers:
11+
- Ricardo Rivera-Matos <[email protected]>
12+
13+
description: |
14+
The bq256xx devices are a family of highly-integrated battery charge
15+
management and system power management ICs for single cell Li-ion and Li-
16+
polymer batteries.
17+
18+
Datasheets:
19+
- https://www.ti.com/lit/ds/symlink/bq25600.pdf
20+
- https://www.ti.com/lit/ds/symlink/bq25601.pdf
21+
- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
22+
- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
23+
- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
24+
- https://www.ti.com/lit/ds/symlink/bq25618.pdf
25+
- https://www.ti.com/lit/ds/symlink/bq25619.pdf
26+
27+
properties:
28+
compatible:
29+
enum:
30+
- ti,bq25600
31+
- ti,bq25601
32+
- ti,bq25600d
33+
- ti,bq25601d
34+
- ti,bq25611d
35+
- ti,bq25618
36+
- ti,bq25619
37+
38+
reg:
39+
maxItems: 1
40+
41+
ti,watchdog-timeout-ms:
42+
$ref: /schemas/types.yaml#/definitions/uint32
43+
default: 0
44+
description: |
45+
Watchdog timer in ms. 0 (default) disables the watchdog
46+
minimum: 0
47+
maximum: 160000
48+
enum: [ 0, 40000, 80000, 160000]
49+
50+
input-voltage-limit-microvolt:
51+
description: |
52+
Minimum input voltage limit in µV with a 100000 µV step
53+
minimum: 3900000
54+
maximum: 5400000
55+
56+
input-current-limit-microamp:
57+
description: |
58+
Maximum input current limit in µA with a 100000 µA step
59+
minimum: 100000
60+
maximum: 3200000
61+
62+
monitored-battery:
63+
$ref: /schemas/types.yaml#/definitions/phandle
64+
description: phandle to the battery node being monitored
65+
66+
interrupts:
67+
maxItems: 1
68+
description: |
69+
Interrupt sends an active low, 256 μs pulse to host to report the charger
70+
device status and faults.
71+
72+
required:
73+
- compatible
74+
- reg
75+
- monitored-battery
76+
77+
additionalProperties: false
78+
79+
examples:
80+
- |
81+
bat: battery {
82+
compatible = "simple-battery";
83+
constant-charge-current-max-microamp = <2040000>;
84+
constant-charge-voltage-max-microvolt = <4352000>;
85+
precharge-current-microamp = <180000>;
86+
charge-term-current-microamp = <180000>;
87+
};
88+
#include <dt-bindings/gpio/gpio.h>
89+
#include <dt-bindings/interrupt-controller/irq.h>
90+
i2c {
91+
92+
clock-frequency = <400000>;
93+
94+
#address-cells = <1>;
95+
#size-cells = <0>;
96+
97+
charger@6b {
98+
compatible = "ti,bq25601";
99+
reg = <0x6b>;
100+
monitored-battery = <&bat>;
101+
102+
interrupt-parent = <&gpio1>;
103+
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
104+
ti,watchdog-timeout-ms = <40000>;
105+
106+
input-voltage-limit-microvolt = <4500000>;
107+
input-current-limit-microamp = <2400000>;
108+
};
109+
};
110+
...
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
# Copyright (C) 2020 Topic Embedded Products
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/power/supply/ltc4162-l.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: Linear Technology (Analog Devices) LTC4162-L Charger
9+
10+
maintainers:
11+
- Mike Looijmans <[email protected]>
12+
13+
description: |
14+
The LTC ® 4162-L is an advanced monolithic synchronous step-down switching
15+
battery charger and PowerPath (TM) manager that seamlessly manages power
16+
distribution between input sources such as wall adapters, backplanes, solar
17+
panels, etc., and a rechargeable Lithium-Ion/Polymer battery.
18+
19+
Specifications about the charger can be found at:
20+
https://www.analog.com/en/products/ltc4162-s.html
21+
22+
properties:
23+
compatible:
24+
enum:
25+
- lltc,ltc4162-l
26+
27+
reg:
28+
maxItems: 1
29+
description: I2C address of the charger.
30+
31+
lltc,rsnsb-micro-ohms:
32+
$ref: /schemas/types.yaml#/definitions/uint32
33+
description: Battery sense resistor in microohm.
34+
minimum: 1000
35+
36+
lltc,rsnsi-micro-ohms:
37+
$ref: /schemas/types.yaml#/definitions/uint32
38+
description: Input current sense resistor in microohm.
39+
minimum: 1000
40+
41+
lltc,cell-count:
42+
$ref: /schemas/types.yaml#/definitions/uint32
43+
description: |
44+
Number of battery cells. If not provided, will be obtained from the chip
45+
once the external power is applied. Omit this when the number of cells
46+
is somewhat dynamic. Without it, several measurements will return 0 until
47+
the charger is connected to an external supply.
48+
49+
required:
50+
- compatible
51+
- reg
52+
- lltc,rsnsb-micro-ohms
53+
- lltc,rsnsi-micro-ohms
54+
55+
additionalProperties: false
56+
57+
examples:
58+
- |
59+
i2c0 {
60+
#address-cells = <1>;
61+
#size-cells = <0>;
62+
charger: battery-charger@68 {
63+
compatible = "lltc,ltc4162-l";
64+
reg = <0x68>;
65+
lltc,rsnsb-micro-ohms = <10000>;
66+
lltc,rsnsi-micro-ohms = <16000>;
67+
lltc,cell-count = <2>;
68+
};
69+
};

arch/arm/mach-pxa/mioa701.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ static struct platform_device power_dev = {
577577
static struct wm97xx_batt_pdata mioa701_battery_data = {
578578
.batt_aux = WM97XX_AUX_ID1,
579579
.temp_aux = -1,
580-
.charge_gpio = -1,
581580
.min_voltage = 0xc00,
582581
.max_voltage = 0xfc0,
583582
.batt_tech = POWER_SUPPLY_TECHNOLOGY_LION,

arch/arm/mach-pxa/palm27x.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ void __init palm27x_irda_init(int pwdn)
212212
static struct wm97xx_batt_pdata palm27x_batt_pdata = {
213213
.batt_aux = WM97XX_AUX_ID3,
214214
.temp_aux = WM97XX_AUX_ID2,
215-
.charge_gpio = -1,
216215
.batt_mult = 1000,
217216
.batt_div = 414,
218217
.temp_mult = 1,

arch/arm/mach-pxa/palmte2.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ static struct platform_device power_supply = {
273273
static struct wm97xx_batt_pdata palmte2_batt_pdata = {
274274
.batt_aux = WM97XX_AUX_ID3,
275275
.temp_aux = WM97XX_AUX_ID2,
276-
.charge_gpio = -1,
277276
.max_voltage = PALMTE2_BAT_MAX_VOLTAGE,
278277
.min_voltage = PALMTE2_BAT_MIN_VOLTAGE,
279278
.batt_mult = 1000,

arch/arm/mach-pxa/z2.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ static struct z2_battery_info batt_chip_info = {
487487
.batt_I2C_bus = 0,
488488
.batt_I2C_addr = 0x55,
489489
.batt_I2C_reg = 2,
490-
.charge_gpio = GPIO0_ZIPITZ2_AC_DETECT,
491490
.min_voltage = 3475000,
492491
.max_voltage = 4190000,
493492
.batt_div = 59,
@@ -496,9 +495,19 @@ static struct z2_battery_info batt_chip_info = {
496495
.batt_name = "Z2",
497496
};
498497

498+
static struct gpiod_lookup_table z2_battery_gpio_table = {
499+
.dev_id = "aer915",
500+
.table = {
501+
GPIO_LOOKUP("gpio-pxa", GPIO0_ZIPITZ2_AC_DETECT,
502+
NULL, GPIO_ACTIVE_HIGH),
503+
{ },
504+
},
505+
};
506+
499507
static struct i2c_board_info __initdata z2_i2c_board_info[] = {
500508
{
501509
I2C_BOARD_INFO("aer915", 0x55),
510+
.dev_name = "aer915",
502511
.platform_data = &batt_chip_info,
503512
}, {
504513
I2C_BOARD_INFO("wm8750", 0x1b),
@@ -509,6 +518,7 @@ static struct i2c_board_info __initdata z2_i2c_board_info[] = {
509518
static void __init z2_i2c_init(void)
510519
{
511520
pxa_set_i2c_info(NULL);
521+
gpiod_add_lookup_table(&z2_battery_gpio_table);
512522
i2c_register_board_info(0, ARRAY_AND_SIZE(z2_i2c_board_info));
513523
}
514524
#else

drivers/power/reset/Kconfig

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ config POWER_RESET_AT91_SAMA5D2_SHDWC
3939
This driver supports the alternate shutdown controller for some Atmel
4040
SAMA5 SoCs. It is present for example on SAMA5D2 SoC.
4141

42+
config POWER_RESET_ATC260X
43+
tristate "Actions Semi ATC260x PMIC power-off driver"
44+
depends on MFD_ATC260X
45+
help
46+
This driver provides power-off and restart support for a system
47+
through Actions Semi ATC260x series PMICs.
48+
4249
config POWER_RESET_AXXIA
4350
bool "LSI Axxia reset driver"
4451
depends on ARCH_AXXIA
@@ -251,13 +258,6 @@ config POWER_RESET_RMOBILE
251258
help
252259
Reboot support for Renesas R-Mobile and SH-Mobile SoCs.
253260

254-
config POWER_RESET_ZX
255-
tristate "ZTE SoCs reset driver"
256-
depends on ARCH_ZX || COMPILE_TEST
257-
depends on HAS_IOMEM
258-
help
259-
Reboot support for ZTE SoCs.
260-
261261
config REBOOT_MODE
262262
tristate
263263

@@ -292,4 +292,3 @@ config NVMEM_REBOOT_MODE
292292
action according to the mode.
293293

294294
endif
295-

drivers/power/reset/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o
33
obj-$(CONFIG_POWER_RESET_AT91_POWEROFF) += at91-poweroff.o
44
obj-$(CONFIG_POWER_RESET_AT91_RESET) += at91-reset.o
55
obj-$(CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC) += at91-sama5d2_shdwc.o
6+
obj-$(CONFIG_POWER_RESET_ATC260X) += atc260x-poweroff.o
67
obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o
78
obj-$(CONFIG_POWER_RESET_BRCMKONA) += brcm-kona-reset.o
89
obj-$(CONFIG_POWER_RESET_BRCMSTB) += brcmstb-reboot.o
@@ -29,7 +30,6 @@ obj-$(CONFIG_POWER_RESET_KEYSTONE) += keystone-reset.o
2930
obj-$(CONFIG_POWER_RESET_SYSCON) += syscon-reboot.o
3031
obj-$(CONFIG_POWER_RESET_SYSCON_POWEROFF) += syscon-poweroff.o
3132
obj-$(CONFIG_POWER_RESET_RMOBILE) += rmobile-reset.o
32-
obj-$(CONFIG_POWER_RESET_ZX) += zx-reboot.o
3333
obj-$(CONFIG_REBOOT_MODE) += reboot-mode.o
3434
obj-$(CONFIG_SYSCON_REBOOT_MODE) += syscon-reboot-mode.o
3535
obj-$(CONFIG_POWER_RESET_SC27XX) += sc27xx-poweroff.o

0 commit comments

Comments
 (0)