Skip to content

Commit 4520dcb

Browse files
committed
Merge tag 'for-v5.15' 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 related: - cros-peripheral-charger: new driver - mt6360-charger: new driver - simple-battery: support reading chemistry info - max17042-battery: add max77849 support - sbs-battery: add time_to_empty_now support - smb347-charger: prepare USB OTG support - rn5t618: add voltage_now support - axp288: cleanup & optimizations - max17042_battery: cleanups - ab8500: cleanups - misc minor cleanups and DT binding fixes reset related: - tps65086-restart: new driver - linkstation-poweroff: support NETGEAR ReadyNAS Duo v2" * tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (51 commits) power: supply: core: Fix parsing of battery chemistry/technology power: supply: max17042_battery: log SOC threshold using debug log level power: supply: max17042_battery: more robust chip type checks power: supply: max17042_battery: fix typo in MAx17042_TOFF power: supply: max17042_battery: clean up MAX17055_V_empty power: supply: smb347-charger: Implement USB VBUS regulator power: supply: smb347-charger: Add missing pin control activation power: supply: smb347-charger: Utilize generic regmap caching power: supply: smb347-charger: Make smb347_set_writable() IRQ-safe dt-bindings: power: supply: smb347-charger: Document USB VBUS regulator power: reset: Add TPS65086 restart driver dt-bindings: power: supply: max17042: describe interrupt power: supply: max17042: remove duplicated STATUS bit defines power: supply: max17042: handle fails of reading status register power: supply: core: Parse battery chemistry/technology dt-bindings: power: Extend battery bindings with chemistry power: reset: linkstation-poweroff: add new device power: reset: linkstation-poweroff: prepare for new devices power: supply: bq24735: reorganize ChargeOption command macros power: supply: rn5t618: Add voltage_now property ...
2 parents 0da9bc6 + c939845 commit 4520dcb

39 files changed

Lines changed: 2645 additions & 937 deletions

‎Documentation/devicetree/bindings/power/supply/battery.yaml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ properties:
3131
compatible:
3232
const: simple-battery
3333

34+
device-chemistry:
35+
description: This describes the chemical technology of the battery.
36+
oneOf:
37+
- const: nickel-cadmium
38+
- const: nickel-metal-hydride
39+
- const: lithium-ion
40+
description: This is a blanket type for all lithium-ion batteries,
41+
including those below. If possible, a precise compatible string
42+
from below should be used, but sometimes it is unknown which specific
43+
lithium ion battery is employed and this wide compatible can be used.
44+
- const: lithium-ion-polymer
45+
- const: lithium-ion-iron-phosphate
46+
- const: lithium-ion-manganese-oxide
47+
3448
over-voltage-threshold-microvolt:
3549
description: battery over-voltage limit
3650

‎Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ properties:
1919
- maxim,max17047
2020
- maxim,max17050
2121
- maxim,max17055
22+
- maxim,max77849-battery
2223

2324
reg:
2425
maxItems: 1
2526

2627
interrupts:
2728
maxItems: 1
29+
description: |
30+
The ALRT pin, an open-drain interrupt.
2831
2932
maxim,rsns-microohm:
3033
$ref: /schemas/types.yaml#/definitions/uint32
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/mt6360_charger.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Battery charger driver for MT6360 PMIC from MediaTek Integrated.
8+
9+
maintainers:
10+
- Gene Chen <gene_chen@richtek.com>
11+
12+
description: |
13+
This module is part of the MT6360 MFD device.
14+
Provides Battery Charger, Boost for OTG devices and BC1.2 detection.
15+
16+
properties:
17+
compatible:
18+
const: mediatek,mt6360-chg
19+
20+
richtek,vinovp-microvolt:
21+
description: Maximum CHGIN regulation voltage in uV.
22+
enum: [ 5500000, 6500000, 11000000, 14500000 ]
23+
24+
25+
usb-otg-vbus-regulator:
26+
type: object
27+
description: OTG boost regulator.
28+
$ref: /schemas/regulator/regulator.yaml#
29+
30+
required:
31+
- compatible
32+
33+
additionalProperties: false
34+
35+
examples:
36+
- |
37+
mt6360_charger: charger {
38+
compatible = "mediatek,mt6360-chg";
39+
richtek,vinovp-microvolt = <14500000>;
40+
41+
otg_vbus_regulator: usb-otg-vbus-regulator {
42+
regulator-compatible = "usb-otg-vbus";
43+
regulator-name = "usb-otg-vbus";
44+
regulator-min-microvolt = <4425000>;
45+
regulator-max-microvolt = <5825000>;
46+
};
47+
};
48+
...

‎Documentation/devicetree/bindings/power/supply/summit,smb347-charger.yaml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@ properties:
7373
- 1 # SMB3XX_SOFT_TEMP_COMPENSATE_CURRENT Current compensation
7474
- 2 # SMB3XX_SOFT_TEMP_COMPENSATE_VOLTAGE Voltage compensation
7575

76+
summit,inok-polarity:
77+
description: |
78+
Polarity of INOK signal indicating presence of external power supply.
79+
$ref: /schemas/types.yaml#/definitions/uint32
80+
enum:
81+
- 0 # SMB3XX_SYSOK_INOK_ACTIVE_LOW
82+
- 1 # SMB3XX_SYSOK_INOK_ACTIVE_HIGH
83+
84+
usb-vbus:
85+
$ref: "../../regulator/regulator.yaml#"
86+
type: object
87+
88+
properties:
89+
summit,needs-inok-toggle:
90+
type: boolean
91+
description: INOK signal is fixed and polarity needs to be toggled
92+
in order to enable/disable output mode.
93+
94+
unevaluatedProperties: false
95+
7696
allOf:
7797
- if:
7898
properties:
@@ -134,13 +154,23 @@ examples:
134154
reg = <0x7f>;
135155
136156
summit,enable-charge-control = <SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH>;
157+
summit,inok-polarity = <SMB3XX_SYSOK_INOK_ACTIVE_LOW>;
137158
summit,chip-temperature-threshold-celsius = <110>;
138159
summit,mains-current-limit-microamp = <2000000>;
139160
summit,usb-current-limit-microamp = <500000>;
140161
summit,enable-usb-charging;
141162
summit,enable-mains-charging;
142163
143164
monitored-battery = <&battery>;
165+
166+
usb-vbus {
167+
regulator-name = "usb_vbus";
168+
regulator-min-microvolt = <5000000>;
169+
regulator-max-microvolt = <5000000>;
170+
regulator-min-microamp = <750000>;
171+
regulator-max-microamp = <750000>;
172+
summit,needs-inok-toggle;
173+
};
144174
};
145175
};
146176

‎Documentation/devicetree/bindings/power/supply/x-powers,axp20x-ac-power-supply.yaml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ allOf:
2121

2222
properties:
2323
compatible:
24-
enum:
25-
- x-powers,axp202-ac-power-supply
26-
- x-powers,axp221-ac-power-supply
27-
- x-powers,axp813-ac-power-supply
24+
oneOf:
25+
- const: x-powers,axp202-ac-power-supply
26+
- const: x-powers,axp221-ac-power-supply
27+
- items:
28+
- const: x-powers,axp803-ac-power-supply
29+
- const: x-powers,axp813-ac-power-supply
30+
- const: x-powers,axp813-ac-power-supply
2831

2932
required:
3033
- compatible

‎Documentation/devicetree/bindings/power/supply/x-powers,axp20x-battery-power-supply.yaml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ allOf:
1919

2020
properties:
2121
compatible:
22-
enum:
23-
- x-powers,axp209-battery-power-supply
24-
- x-powers,axp221-battery-power-supply
25-
- x-powers,axp813-battery-power-supply
22+
oneOf:
23+
- const: x-powers,axp202-battery-power-supply
24+
- const: x-powers,axp209-battery-power-supply
25+
- const: x-powers,axp221-battery-power-supply
26+
- items:
27+
- const: x-powers,axp803-battery-power-supply
28+
- const: x-powers,axp813-battery-power-supply
29+
- const: x-powers,axp813-battery-power-supply
2630

2731
required:
2832
- compatible

‎Documentation/devicetree/bindings/power/supply/x-powers,axp20x-usb-power-supply.yaml‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ allOf:
2020

2121
properties:
2222
compatible:
23-
enum:
24-
- x-powers,axp202-usb-power-supply
25-
- x-powers,axp221-usb-power-supply
26-
- x-powers,axp223-usb-power-supply
27-
- x-powers,axp813-usb-power-supply
23+
oneOf:
24+
- enum:
25+
- x-powers,axp202-usb-power-supply
26+
- x-powers,axp221-usb-power-supply
27+
- x-powers,axp223-usb-power-supply
28+
- x-powers,axp813-usb-power-supply
29+
- items:
30+
- const: x-powers,axp803-usb-power-supply
31+
- const: x-powers,axp813-usb-power-supply
2832

2933

3034
required:

‎drivers/iio/adc/rn5t618-adc.c‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/completion.h>
1717
#include <linux/regmap.h>
1818
#include <linux/iio/iio.h>
19+
#include <linux/iio/driver.h>
20+
#include <linux/iio/machine.h>
1921
#include <linux/slab.h>
2022

2123
#define RN5T618_ADC_CONVERSION_TIMEOUT (msecs_to_jiffies(500))
@@ -189,6 +191,19 @@ static const struct iio_chan_spec rn5t618_adc_iio_channels[] = {
189191
RN5T618_ADC_CHANNEL(AIN0, IIO_VOLTAGE, "AIN0")
190192
};
191193

194+
static struct iio_map rn5t618_maps[] = {
195+
IIO_MAP("VADP", "rn5t618-power", "vadp"),
196+
IIO_MAP("VUSB", "rn5t618-power", "vusb"),
197+
{ /* sentinel */ }
198+
};
199+
200+
static void unregister_map(void *data)
201+
{
202+
struct iio_dev *iio_dev = (struct iio_dev *) data;
203+
204+
iio_map_array_unregister(iio_dev);
205+
}
206+
192207
static int rn5t618_adc_probe(struct platform_device *pdev)
193208
{
194209
int ret;
@@ -239,6 +254,14 @@ static int rn5t618_adc_probe(struct platform_device *pdev)
239254
return ret;
240255
}
241256

257+
ret = iio_map_array_register(iio_dev, rn5t618_maps);
258+
if (ret < 0)
259+
return ret;
260+
261+
ret = devm_add_action_or_reset(adc->dev, unregister_map, iio_dev);
262+
if (ret < 0)
263+
return ret;
264+
242265
return devm_iio_device_register(adc->dev, iio_dev);
243266
}
244267

‎drivers/power/reset/Kconfig‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ config POWER_RESET_ST
204204
help
205205
Reset support for STMicroelectronics boards.
206206

207+
config POWER_RESET_TPS65086
208+
bool "TPS65086 restart driver"
209+
depends on MFD_TPS65086
210+
help
211+
This driver adds support for resetting the TPS65086 PMIC on restart.
212+
207213
config POWER_RESET_VERSATILE
208214
bool "ARM Versatile family reboot driver"
209215
depends on ARM

‎drivers/power/reset/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
2323
obj-$(CONFIG_POWER_RESET_REGULATOR) += regulator-poweroff.o
2424
obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
2525
obj-$(CONFIG_POWER_RESET_ST) += st-poweroff.o
26+
obj-$(CONFIG_POWER_RESET_TPS65086) += tps65086-restart.o
2627
obj-$(CONFIG_POWER_RESET_VERSATILE) += arm-versatile-reboot.o
2728
obj-$(CONFIG_POWER_RESET_VEXPRESS) += vexpress-poweroff.o
2829
obj-$(CONFIG_POWER_RESET_XGENE) += xgene-reboot.o

0 commit comments

Comments
 (0)