Commit graph

996220 commits

Author SHA1 Message Date
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
Sebastian Reichel
464a748871 dt-bindings: power: supply: bq24735: 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
9c05cfaf3f dt-bindings: power: supply: bq2415x: 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
e7c2431759 dt-bindings: power: supply: bq24190: 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
102d4a0b69 dt-bindings: power: supply: bq24257: 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
648d383253 dt-bindings: power: supply: bq25890: 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
ce49e42822 dt-bindings: power: supply: cpcap-charger: Convert to DT schema format
Convert the binding to DT schema format. I also added the missing bits
used by the only in-tree user and implemented in the driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:50 +01:00
Sebastian Reichel
3c5be04549 dt-bindings: power: supply: cpcap-battery: Convert to DT schema format
Convert the binding to DT schema format. I also added the missing bits
used by the only in-tree user and implemented in the driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2021-03-23 12:54:44 +01:00
Xiaofeng Cao
bd3689a64e power: supply: max1721x: Correct spelling
Change  'stanalone'      to  'standalone'
Change  'mesaurement'    to  'measurement'
Change  'nonvilatile'    to  'nonvolatile'
Change  'unical'         to  'unique'
Change  'unaccesable'    to  'unaccessible'
Change  'correcpondent'  to  'correspond'

Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-22 15:11:22 +01:00
dongjian
c77b26e327 power: supply: ds2781: use kobj_to_dev()
Use kobj_to_dev() instead of open-coding it

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-22 15:05:41 +01:00
Bhaskar Chowdhury
31ba6fadc3 power: supply: charger-manager: Fix a typo
s/systme/system/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-22 14:59:48 +01:00
dongjian
091d0a3a48 power: reset: remove unneeded semicolon
Fixes coccicheck warning:
drivers/power/reset/vexpress-poweroff.c:136:2-3: Unneeded semicolon

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-22 14:55:50 +01:00
dongjian
2469b836fa power: supply: Use IRQF_ONESHOT
Fixes coccicheck error:

drivers/power/supply/pm2301_charger.c:1089:7-27: ERROR:
drivers/power/supply/lp8788-charger.c:502:8-28: ERROR:
drivers/power/supply/tps65217_charger.c:239:8-33: ERROR:
drivers/power/supply/tps65090-charger.c:303:8-33: ERROR:

Threaded IRQ with no primary handler requested without IRQF_ONESHOT

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-22 14:54:24 +01:00
LI Qingwu
4eed7f5a83 power: supply: bq27xxx: Add support for BQ78Z100
Add support for TI BQ78Z100, I2C interface gas gauge.
It provides a fully integrated safety protection
and authentication for 1 to 2-series cell Li-Ion and
Li-Polymer battery packs.

The patch was tested with BQ78Z100 equipment.

CASE I:  Discharging:
	POWER_SUPPLY_NAME=bq78z100-0
	POWER_SUPPLY_STATUS=Discharging
	POWER_SUPPLY_PRESENT=1
	POWER_SUPPLY_VOLTAGE_NOW=3386000
	POWER_SUPPLY_CURRENT_NOW=-5000
	POWER_SUPPLY_CAPACITY=27
	POWER_SUPPLY_CAPACITY_LEVEL=Normal
	POWER_SUPPLY_TEMP=269
	POWER_SUPPLY_TIME_TO_EMPTY_NOW=1249920
	POWER_SUPPLY_TECHNOLOGY=Li-ion
	POWER_SUPPLY_CHARGE_FULL=6494000
	POWER_SUPPLY_CHARGE_NOW=1736000
	POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
	POWER_SUPPLY_CYCLE_COUNT=1
	POWER_SUPPLY_POWER_AVG=-20000
	POWER_SUPPLY_HEALTH=Good
	POWER_SUPPLY_MANUFACTURER=Texas Instruments

CASE II : No discharging current:
	POWER_SUPPLY_NAME=bq78z100-0
	POWER_SUPPLY_STATUS=Not charging
	POWER_SUPPLY_PRESENT=1
	POWER_SUPPLY_VOLTAGE_NOW=3386000
	POWER_SUPPLY_CURRENT_NOW=0
	POWER_SUPPLY_CAPACITY=27
	POWER_SUPPLY_CAPACITY_LEVEL=Normal
	POWER_SUPPLY_TEMP=270
	POWER_SUPPLY_TECHNOLOGY=Li-ion
	POWER_SUPPLY_CHARGE_FULL=6494000
	POWER_SUPPLY_CHARGE_NOW=1734000
	POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
	POWER_SUPPLY_CYCLE_COUNT=1
	POWER_SUPPLY_POWER_AVG=0
	POWER_SUPPLY_HEALTH=Good
	POWER_SUPPLY_MANUFACTURER=Texas Instruments

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-21 21:29:26 +01:00
LI Qingwu
83ee068199 dt-bindings: power: bq27xxx: add bq78z100
Add bindings for TI BQ78Z100. An I2C interface gas gauge.
It provides a fully integrated safety protection
and authentication for 1 to 2-series cell Li-Ion and
Li-Polymer battery packs.

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-21 21:28:37 +01:00
Matthias Schiffer
c3a6d6a1df power: supply: bq27xxx: make status more robust
There are multiple issues in bq27xxx_battery_status():

- On BQ28Q610 is was observed that the "full" flag may be set even while
  the battery is charging or discharging. With the current logic to make
  "full" override everything else, it look a very long time (>20min) for
  the status to change from "full" to "discharging" after unplugging the
  supply on a device with low power consumption
- The POWER_SUPPLY_STATUS_NOT_CHARGING check depends on
  power_supply_am_i_supplied(), which will not work when the supply
  doesn't exist as a separate device known to Linux

We can solve both issues by deriving the status from the current instead
of the flags field. The flags are now only used to distinguish "full"
from "not charging", and to determine the sign of the current on
BQ27XXX_O_ZERO devices.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-03-15 02:26:03 +01:00