Commit graph

996235 commits

Author SHA1 Message Date
Roman Kiryanov
570b7c0ea2 power: supply: goldfish: Remove the GOLDFISH dependency
This will allow to use the BATTERY_GOLDFISH driver
without enabling GOLDFISH.

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-05 12:10:11 +02:00
Marek Czerski
52473b0740 power: reset: ltc2952: make trigger delay configurable
Make trigger delay configurable through device tree with
trigger-delay-ms property.

Trigger delay is the time to wait before starting shutdown
sequence after trigger line assertion.
Trigger delay must take into account the OFFT time configured
with the capacitor connected to OFFT pin of the LTC2952 chip.
Basically, the higher the capacitance connected to OFFT pin,
the larger trigger delay must be.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-05 12:05:51 +02:00
Yang Li
816aacd541 power: supply: cpcap-charger: Simplify bool conversion
Fix the following coccicheck warning:
./drivers/power/supply/cpcap-charger.c:416:31-36: WARNING: conversion to
bool not needed here

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-05 11:37:06 +02:00
Carl Philipp Klemm
751faedf06 power: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce
Adds 80000 us sleep when the usb cable is plugged in to hopefully avoid
bouncing contacts.

Upon pluging in the usb cable vbus will bounce for some time, causing cpcap to
dissconnect charging due to detecting an undervoltage condition. This is a
scope of vbus on xt894 while quickly inserting the usb cable with firm force,
probed at the far side of the usb socket and vbus loaded with approx 1k:
http://uvos.xyz/maserati/usbplug.jpg.

As can clearly be seen, vbus is all over the place for the first 15 ms or so
with a small blip at ~40 ms this causes the cpcap to trip up and disable
charging again.

The delay helps cpcap_usb_detect avoid the worst of this. It is, however, still
not ideal as strong vibrations can cause the issue to reapear any time during
charging. I have however not been able to cause the device to stop charging due
to this in practice as it is hard to vibrate the device such that the vbus pins
start bouncing again but cpcap_usb_detect is not called again due to a detected
disconnect/reconnect event.

Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-05 10:22:18 +02:00
Carl Philipp Klemm
8a5a0cc13a power: supply: cpcap-charger: fix small mistake in current to register conversion
Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-05 10:21:12 +02:00
Sebastian Reichel
3af26e2ad5 power: supply: core: reduce loglevel for probe defer info
Avoid logging probe defer information for default loglevel
configurations. This is only required for debugging probe
defer issues, which requires enabling debug messages for
other subsystems.

This dev_info() message predates having deferred devices
information available in /sys/kernel/debug/devices_deferred,
which is generally more useful.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:26 +02:00
Sebastian Reichel
17948f5899 power: supply: sbs-manager: update gpio include
sbs-manager implements a GPIO chip, so include the proper
gpio driver include instead of the legacy gpio.h.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:26 +02:00
Sebastian Reichel
436ff8c928 power: supply: sbs-manager: use dev_err_probe
Introduce usage of dev_err_probe in probe routine, which
makes the code slightly more readable and removes some
lines of code. It also removes PROBE_DEFER errors being
logged by default.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:25 +02:00
Sebastian Reichel
814ddbd9ec power: supply: sbs-manager: use managed i2c_mux_adapter
Simplify code by using devm_add_action_or_reset to unregister
the i2c_mux_adapter.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:25 +02:00
Sebastian Reichel
310162f6dd power: supply: sbs-charger: drop unused gpio includes
sbs-charger does not use any GPIOs, so no need to include
gpio.h and of_gpio.h.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:25 +02:00
Sebastian Reichel
e319f4e25a power: supply: sbs-charger: use dev_err_probe
Introduce usage of dev_err_probe in probe routine, which
makes the code slightly more readable and removes some
lines of code. It also removes PROBE_DEFER errors being
logged by default.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:25 +02:00
Sebastian Reichel
166767ab91 power: supply: sbs-battery: use dev_err_probe
Introduce usage of dev_err_probe in probe routine, which
makes the code slightly more readable and removes some
lines of code. It also removes PROBE_DEFER errors being
logged by default, which are common when the battery is
waiting for the charger driver to be registered.

This also cleans up a useless goto and instead returns
directly.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:19:25 +02:00
Milan Djurovic
33ae8b0346 power: supply: 88pm860x_battery: Remove unnecessary int for long long
Change 'long long int' to 'long long' because the int is unnecessary,
as suggested by checkpatch.pl.

Signed-off-by: Milan Djurovic <mdjurovic@zohomail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:14:58 +02:00
Timon Baetz
416682f27a power: supply: max8997_charger: Switch to new binding
Get regulator from parent device's node and extcon by name.

Signed-off-by: Timon Baetz <timon.baetz@protonmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 14:12:52 +02:00
Hao Fang
9f45275a34 power: reset: hisi-reboot: use the correct HiSilicon copyright
s/Hisilicon/HiSilicon/g.
It should use capital S, according to
https://www.hisilicon.com/en/terms-of-use.

Signed-off-by: Hao Fang <fanghao11@huawei.com>
Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 13:58:34 +02:00
Claudiu Beznea
bd3127733f power: reset: at91-reset: use devm_of_iomap
Use devm_of_iomap() to map resources. This will avoid the necessity to
track the mapped resources and free them on failure path or on remove.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 13:11:45 +02:00
Mauro Carvalho Chehab
e4e4092938 dt-bindings: power: update battery.yaml reference
Changesets: 70c23e62d2 ("dt-bindings: power: supply: Fix remaining battery.txt links")
and: 471dec8023 ("dt-bindings: power: Convert battery.txt to battery.yaml")
renamed: Documentation/devicetree/bindings/power/supply/battery.txt
to: Documentation/devicetree/bindings/power/supply/battery.yaml.

Update its cross-reference accordingly.

Fixes: 70c23e62d2 ("dt-bindings: power: supply: Fix remaining battery.txt links")
Fixes: 471dec8023 ("dt-bindings: power: Convert battery.txt to battery.yaml")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 13:00:55 +02:00
Mauro Carvalho Chehab
d9e903f8cc MAINTAINERS: update lego,ev3-battery.yaml reference
Changeset 3004e581d9 ("dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format")
renamed: Documentation/devicetree/bindings/power/supply/lego_ev3_battery.txt
to: Documentation/devicetree/bindings/power/supply/lego,ev3-battery.yaml.

Update its cross-reference accordingly.

Fixes: 3004e581d9 ("dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: David Lechner <david@lechnology.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-04-02 13:00:55 +02:00
Daniel Golle
3aeaf50938 power: reset: replace curly brackets in Makefile
Normal parentheses should be used when referring to config variables
in Makefile. Replace the accidentally introduced curly brackets by
regular parentheses.

Fixes: a7f79f9954 ("power: reset: add driver for LinkStation power off")
Acked-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-23 16:25:56 +01:00
Bhaskar Chowdhury
37ad56aa82 power: supply: max17042: Trivial spelling fixes
Few trivial spelling fixes.

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-23 14:27:11 +01:00
Sebastian Reichel
f735e8366a dt-bindings: power: supply: Drop power_supply.txt
The file has been replaced by power-supply.yaml and all links
have been updated to the new file.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:24 +01:00
Sebastian Reichel
70c23e62d2 dt-bindings: power: supply: Fix remaining battery.txt links
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:24 +01:00
Sebastian Reichel
3ef11821de dt-bindings: power: supply: sbs-battery: Fix dtbs_check
Existing in-tree users make use of '"ti,bq20z45", "sbs,sbs-battery"', so
add it to the list of known compatible strings.

Also add missing support for the generic 'power-supplies' property by
importing power-supply.yaml and setting unevaluatedProperties instead
of additionalProperties.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:24 +01:00
Sebastian Reichel
eb91749773 dt-bindings: power: supply: ab8500: Convert to DT schema format
Convert the binding to DT schema format.

Note: The battery node does not have a compatible value and needs
to be described from the binding file for the PMIC. That has not
yet been converted, so I kept the information in plaintext for now.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:24 +01:00
Sebastian Reichel
ee66274196 dt-bindings: power: supply: olpc-battery: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:24 +01:00
Sebastian Reichel
95b00152cb dt-bindings: power: supply: rt9455: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:24 +01:00
Sebastian Reichel
d913a03bc1 dt-bindings: power: supply: ltc294x: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
97f03280e0 dt-bindings: power: supply: lt3651: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
c44242f0d0 dt-bindings: power: supply: lp8727: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
59604ba756 dt-bindings: power: supply: da9150: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
a3388d750c dt-bindings: power: supply: axp20x: Convert to DT schema format
Convert the binding to DT schema format.

Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
ee123ad978 dt-bindings: power: supply: act8945a: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
6c463222a2 dt-bindings: power: supply: pm8941-coincell: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
1a4d86b4c9 dt-bindings: power: supply: pm8941-charger: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
f444be1245 dt-bindings: power: supply: ucs1002: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
402a3cb34e dt-bindings: power: supply: max8903: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
eb3b616ee1 dt-bindings: power: supply: max17042: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
aad19ec18e dt-bindings: power: supply: max14656: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
ab1a76df6d dt-bindings: power: supply: max17040: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:55:23 +01:00
Sebastian Reichel
3004e581d9 dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format
Convert the binding to DT schema format.

Cc: David Lechner <david@lechnology.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:59 +01:00
Sebastian Reichel
df89b2850a dt-bindings: power: supply: n900-battery: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Rejected-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:54 +01:00
Sebastian Reichel
bb56712aba dt-bindings: power: supply: twl4030: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:54 +01:00
Sebastian Reichel
0e2d1823a6 dt-bindings: power: supply: tps65217: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:54 +01:00
Sebastian Reichel
4ac8f03056 dt-bindings: power: supply: tps65090: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:54 +01:00
Sebastian Reichel
dc721203c5 dt-bindings: power: supply: sc2731-charger: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:54 +01:00
Sebastian Reichel
89919370c5 dt-bindings: power: supply: sc27xx-fg: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:53 +01:00
Sebastian Reichel
2f06fcbdac dt-bindings: power: supply: ds2760: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:53 +01:00
Sebastian Reichel
f5bf381a10 dt-bindings: power: supply: sbs-manager: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:53 +01:00
Sebastian Reichel
90f6c44d7e dt-bindings: power: supply: sbs-charger: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:53 +01:00
Sebastian Reichel
437e6b6c8f dt-bindings: power: supply: isp1704: Convert to DT schema format
Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:53 +01:00