2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 06:34:11 +08:00
linux-next/drivers/power/supply
Hans de Goede 6cf62a3b97 power: supply: bq24190_charger: Add disable-reset device-property
Allow platform-code to disable the reset on probe and suspend/resume
by setting a "disable-reset" boolean device property on the device.

There are several reasons why the platform-code may want to disable
the reset on probe and suspend/resume:

1) Resetting the charger should never be necessary it should always have
sane values programmed. If it is running with invalid values while we
are not running (system turned off or suspended) there is a big problem
as that may lead to overcharging the battery.

2) The reset in suspend() is meant to put the charger back into default
mode, but this is not necessary and not a good idea. If the charger has
been programmed with a higher max charge_current / charge_voltage then
putting it back in default-mode will reset those to the safe power-on
defaults, leading to slower charging, or charging to a lower voltage
(and thus not using the full capacity) while suspended which is
undesirable. Reprogramming the max charge_current / charge_voltage
after the reset will not help here as that will put the charger back
in host mode and start the i2c watchdog if the host then does not do
anything for 40s (iow if we're suspended for more then 40s) the watchdog
expires resetting the device to default-mode, including resetting all
the registers to there safe power-on defaults. So the only way to keep
using custom charge settings while suspending is to keep the charger in
its normal running state with the i2c watchdog disabled. This is fine
as the charger will still automatically switch from constant current
to constant voltage and stop charging when the battery is full.

3) Besides never being necessary resetting the charger also causes
problems on systems where the charge voltage limit is set higher then the
reset value, if this is the case and the charger is reset while charging
and the battery voltage is between the 2 voltages, then about half the
time the charger gets confused and claims to be charging (REG08 contains
0x64) but in reality the charger has decoupled itself from VBUS (Q1 off)
and is drawing 0A from VBUS, leaving the system running from the battery.

This last problem is happening on a GPD-win mini PC with a bq24292i
charger chip combined with a max17047 fuel-gauge and a LiHV battery.
I've checked and TI does not list any errata for the bq24292i which
could explain this (there are no errata at all).

Cc: Liam Breck <kernel@networkimprov.net>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Liam Breck <kernel@networkimprov.net>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-05-01 11:34:20 +02:00
..
88pm860x_battery.c
88pm860x_charger.c
ab8500_bmdata.c power: supply: ab8500: Replaced spaces with tabs in indent 2017-04-14 01:41:34 +02:00
ab8500_btemp.c power: supply: ab8500_btemp: Compress return logic into one line. 2017-01-17 00:28:38 +01:00
ab8500_charger.c
ab8500_fg.c power: supply: improve function-level documentation 2016-10-19 05:06:22 +02:00
abx500_chargalg.c
act8945a_charger.c power: supply: act8945a_charger: Add max current property 2016-09-01 13:55:55 +02:00
apm_power.c
axp20x_ac_power.c power: supply: add AC power supply driver for AXP20X and AXP22X PMICs 2017-01-29 23:15:18 +01:00
axp20x_usb_power.c power: supply: axp20x_usb_power: use IIO channels when available 2017-01-29 23:15:17 +01:00
axp288_charger.c power: supply: axp288_charger: Use one notifier_block per extcon cable 2017-01-04 22:03:20 +01:00
axp288_fuel_gauge.c power: supply: axp288_fuel_gauge: Remove unnecessary irq?_en register writes 2017-01-04 22:03:44 +01:00
bq27xxx_battery_i2c.c power: supply: bq27xxx: adds specific support for bq27520-g4 revision. 2017-01-12 02:30:13 +01:00
bq27xxx_battery.c power: supply: bq27xxx: adds specific support for bq27520-g4 revision. 2017-01-12 02:30:13 +01:00
bq2415x_charger.c power: supply: bq2415x: check for NULL acpi_id to avoid null pointer dereference 2017-01-21 03:35:07 +01:00
bq24190_charger.c power: supply: bq24190_charger: Add disable-reset device-property 2017-05-01 11:34:20 +02:00
bq24257_charger.c power: bq24257: Fix use of uninitialized pointer bq->charger 2016-09-19 20:56:22 +02:00
bq24735-charger.c power: supply: bq24735: bring down the noise level 2017-01-04 22:03:33 +01:00
bq25890_charger.c power: supply: bq25890: Use gpiod_get() 2017-04-14 01:41:34 +02:00
charger-manager.c power: supply: charger-manager: simplify return statements 2017-04-14 01:41:34 +02:00
collie_battery.c
cpcap-charger.c power: supply: cpcap-charger: Add minimal CPCAP PMIC battery charger 2017-04-14 01:41:34 +02:00
da9030_battery.c
da9052-battery.c
da9150-charger.c
da9150-fg.c
ds2760_battery.c
ds2780_battery.c
ds2781_battery.c
ds2782_battery.c
generic-adc-battery.c
goldfish_battery.c
gpio-charger.c power: supply: gpio_charger: switch to using GPIO descriptors 2017-01-04 22:04:50 +01:00
ipaq_micro_battery.c power: ipaq_micro_battery: fix alias 2016-11-23 23:44:40 +01:00
isp1704_charger.c
jz4740-battery.c
Kconfig power: supply: New driver for LEGO MINDSTORMS EV3 battery 2017-04-14 01:41:35 +02:00
lego_ev3_battery.c power: supply: New driver for LEGO MINDSTORMS EV3 battery 2017-04-14 01:41:35 +02:00
lp8727_charger.c
lp8788-charger.c power: supply: lp8788: prevent out of bounds array access 2017-04-14 01:41:34 +02:00
ltc2941-battery-gauge.c power: supply: ltc2941-battery-gauge: Add OF device ID table 2017-04-14 01:41:34 +02:00
Makefile power: supply: New driver for LEGO MINDSTORMS EV3 battery 2017-04-14 01:41:35 +02:00
max8903_charger.c
max8925_power.c
max8997_charger.c power: supply: max8997_charger: Using device managed API and remove OOM print 2017-01-04 21:59:56 +01:00
max8998_charger.c
max14577_charger.c
max14656_charger_detector.c power: supply: max14656: Export I2C and OF device ID as module aliases 2017-01-29 23:15:17 +01:00
max17040_battery.c power: supply: max17040: Add OF device ID table 2017-04-14 01:41:33 +02:00
max17042_battery.c
max77693_charger.c
olpc_battery.c
pcf50633-charger.c power: supply: pcf50633-charger: Compress return logic into one line. 2017-01-17 00:29:16 +01:00
pda_power.c
pm2301_charger.c
pm2301_charger.h
pmu_battery.c
power_supply_core.c power: supply: improve function-level documentation 2016-10-19 05:06:22 +02:00
power_supply_leds.c
power_supply_sysfs.c
power_supply.h
qcom_smbb.c power: supply: qcom_smbb: Add otg regulator for control of vbus 2017-01-16 23:02:46 +01:00
rt5033_battery.c
rt9455_charger.c
rx51_battery.c
s3c_adc_battery.c
sbs-battery.c power: supply: sbs-battery: Cleanup removal of chip->pdata 2016-09-21 02:04:47 +02:00
sbs-charger.c power: supply: sbs-charger: simplified bool function 2017-04-14 01:41:34 +02:00
smb347-charger.c
test_power.c
tosa_battery.c
tps65090-charger.c
tps65217_charger.c power: supply: tps65217: remove debug messages for function calls 2017-04-14 01:41:35 +02:00
twl4030_charger.c power: supply: twl4030_charger: remove incorrect __exit markups 2017-04-14 01:41:33 +02:00
twl4030_madc_battery.c
wm97xx_battery.c power: supply: wm97xx_battery: remove redundant 2nd null check on pdata 2017-01-04 22:04:20 +01:00
wm831x_backup.c
wm831x_power.c
wm8350_power.c wm8350_power: use permission-specific DEVICE_ATTR variants 2016-11-23 23:46:20 +01:00
z2_battery.c