summaryrefslogtreecommitdiffstats
path: root/drivers/power
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-v5.1-rc' of ↵Linus Torvalds2019-05-012-6/+3Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Sebastian Reichel: "Two more fixes for the 5.1 cycle. One division by zero fix in a specific driver and one core workaround for bad userspace behaviour from systemd regarding uevents. IMHO this can be considered to be a userspace bug, but the debug messages are useless anyways - cpcap-battery: fix a division by zero - core: fix systemd issue due to log messages produced by uevent" * tag 'for-v5.1-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG power: supply: cpcap-battery: Fix division by zero
| * power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUGAndrey Smirnov2019-04-261-6/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a similar endless event loop as was done in commit 8dcf32175b4e ("i2c: prevent endless uevent loop with CONFIG_I2C_DEBUG_CORE"): The culprit is the dev_dbg printk in the i2c uevent handler. If this is activated (for instance by CONFIG_I2C_DEBUG_CORE) it results in an endless loop with systemd-journald. This happens if user-space scans the system log and reads the uevent file to get information about a newly created device, which seems fair use to me. Unfortunately reading the "uevent" file uses the same function that runs for creating the uevent for a new device, generating the next syslog entry Both CONFIG_I2C_DEBUG_CORE and CONFIG_POWER_SUPPLY_DEBUG were reported in https://bugs.freedesktop.org/show_bug.cgi?id=76886 but only former seems to have been fixed. Drop debug prints as it was done in I2C subsystem to resolve the issue. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: cpcap-battery: Fix division by zeroTony Lindgren2019-04-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If called fast enough so samples do not increment, we can get division by zero in kernel: __div0 cpcap_battery_cc_raw_div cpcap_battery_get_property power_supply_get_property.part.1 power_supply_get_property power_supply_show_property power_supply_uevent Fixes: 874b2adbed12 ("power: supply: cpcap-battery: Add a battery driver") Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | drivers: power: supply: goldfish_battery: Fix bogus SPDX identifierThomas Gleixner2019-04-151-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spdxcheck.py complains: drivers/power/supply/goldfish_battery.c: 1:28 Invalid License ID: GPL which is correct because GPL is not a valid identifier. Of course this could have been caught by checkpatch.pl _before_ submitting or merging the patch. WARNING: 'SPDX-License-Identifier: GPL' is not supported in LICENSES/... #19: FILE: drivers/power/supply/goldfish_battery.c:1: +// SPDX-License-Identifier: GPL Which is absolutely hillarious as the commit introducing this wreckage says in the changelog: There was a checkpatch complain: "Missing or malformed SPDX-License-Identifier tag". Oh well. Replacing a checkpatch warning by a different checkpatch warning is a really useful exercise. Use the proper GPL-2.0 identifier which is what the boiler plate in the file had originally. Fixes: e75e3a125b40 ("drivers: power: supply: goldfish_battery: Put an SPDX tag") Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* power: reset: at91-reset: add support for sam9x60 SoCNicolas Ferre2019-02-201-0/+13
| | | | | | | | | Add support for additional reset causes and the proper compatibility string for sam9x60 SoC. The restart function is the same as the samx7. Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* max17042_battery: fix potential use-after-free on device removeSven Van Asbroeck2019-02-201-0/+10
| | | | | | | | | | | | | | | The work which is scheduled on a POR boot is potentially left pending or running until after the device module is removed, which could result in a use-after-free. Fix by registering a cancel/sync callback, which gets executed as part of standard resource unwinding. This issue was detected with the help of Coccinelle. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: core: Add a field to support battery max voltageArtur Rojek2019-02-201-0/+3
| | | | | | | | Add a field for "voltage_max_design_uv" to present fully charged battery voltage. Signed-off-by: Artur Rojek <contact@artur-rojek.eu> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* bq27x00: use cached flagsArthur Demchenkov2019-02-201-16/+4Star
| | | | | | | | | The flags were just read by bq27xxx_battery_update(), no need to read them again. Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com> Reviewed-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ds2782: fix possible use-after-free on removeSven Van Asbroeck2019-02-121-4/+4
| | | | | | | | | | | | | | | | In remove(), use cancel_delayed_work_sync() to cancel the delayed work. Otherwise there's a chance that this work will continue to run until after the device has been removed. While we're here, fix the deallocation order in remove(), to correspond to the inverse of the probe() allocation order. This guarantees that any remaining work can run to completion with all driver structures still intact. This issue was detected with the help of Coccinelle. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq25890: show max charge current/voltage as configuredMichał Mirosław2019-01-231-2/+2
| | | | | | | | | Use firmware-provided limits for POWER_SUPPLY_*_MAX properties instead of chip max values. This will reflect the battery limits as those are the important ones. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Fix capacity saving functionYuanjiang Yu2019-01-231-5/+59
| | | | | | | | | | | | | | | We found sometimes we can not get the saving capacity to initialize the battery capacity, the reason is the user area registers are put on power always-on region, so we need delay some time to wait until values are updated successfully. Moreover we also should clear the USER_AREA_CLEAR register after setting the USER_AREA_SET register, otherwise we can not save the values in the USER_AREA_SET register. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Fix the incorrect formula when converting capacity to ↵Baolin Wang2019-01-231-1/+1
| | | | | | | | | | | coulomb counter We should multiply the calibrated current data (cur_1000ma_adc) when converting current capacity (mAh) to coulomb counter, which can get an accurate coulomb counter from the fuel gauge controller. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Add one property to read charge voltageBaolin Wang2019-01-231-0/+29
| | | | | | | | | Add POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE property to get charge voltage sampling by ADC controller, which is used to validate if the charge voltage is in normal range or not in charger manager. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* drivers: power: supply: goldfish_battery: Add support for reading more ↵Roman Kiryanov2019-01-211-0/+47
| | | | | | | | | | | | | | | | | | | properties To comply with tests we need to support more power supply properties: POWER_SUPPLY_PROP_VOLTAGE_NOW POWER_SUPPLY_PROP_TEMP POWER_SUPPLY_PROP_CHARGE_COUNTER POWER_SUPPLY_PROP_CURRENT_NOW POWER_SUPPLY_PROP_CURRENT_AVG POWER_SUPPLY_PROP_CHARGE_FULL POWER_SUPPLY_PROP_CYCLE_COUNT POWER_SUPPLY_PROP_VOLTAGE_MAX POWER_SUPPLY_PROP_CURRENT_MAX Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: charger-manager: Fix trivial language typosKrzysztof Kozlowski2019-01-201-9/+9
| | | | | | | Fix few trivial language typos. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* cpcap-charger: generate events for userspacePavel Machek2019-01-201-0/+1
| | | | | | | | | | | | | | | The driver doesn't generate uevents on charger connect/disconnect. This leads to UPower not detecting when AC is on or off... and that is bad. Reported by Arthur D. on github ( https://github.com/maemo-leste/bugtracker/issues/206 ), thanks to Merlijn Wajer for suggesting a fix. Cc: stable@kernel.org Signed-off-by: Pavel Machek <pavel@ucw.cz> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: remove some duplicated includesYangtao Li2019-01-201-2/+0Star
| | | | | | | | We include of.h twice. It's unnecessary,so just remove them. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: twl4030: fix a missing check of return valueKangjie Lu2019-01-201-1/+3
| | | | | | | | | | If twl4030_bci_read() fails, the read data in "s" is incorrect, which is however used in the following execution. The fix checks the return value of twl4030_bci_read() and returns an error code upstream upon the failure of twl4030_bci_read(). Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* drivers: power: supply: goldfish_battery: Use tabs for alignmentRoman Kiryanov2019-01-201-6/+6
| | | | | | | Tabs are preferred. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* drivers: power: supply: goldfish_battery: Fix alignmentRoman Kiryanov2019-01-201-2/+2
| | | | | | | Align two values as other values below. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* drivers: power: supply: goldfish_battery: Retire a redundant variableRoman Kiryanov2019-01-201-8/+0Star
| | | | | | | The battery_data static variable was not used. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* drivers: power: supply: goldfish_battery: Fix "line over 80 characters"Roman Kiryanov2019-01-201-2/+3
| | | | | | | There was a line longer than 80 characters. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* drivers: power: supply: goldfish_battery: Put an SPDX tagRoman Kiryanov2019-01-201-9/+1Star
| | | | | | | | | There was a checkpatch complain: "Missing or malformed SPDX-License-Identifier tag". Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: axp288_fuel_gauge: Change to use DEFINE_SHOW_ATTRIBUTE macroYangtao Li2019-01-201-12/+2Star
| | | | | | | Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: isp1704: switch to gpiod APISebastian Reichel2019-01-201-48/+12Star
| | | | | | | | | | | | | | | This migrates isp1704 driver from old GPIO API to new descriptor based GPIO API and drops useless platform data as a side-effect. Migration is simple, since all mainline users are DT based and DT API does not change. Out of tree users of the platform data need to migrate to gpiod_lookup_table as described here: Documentation/driver-api/gpio/board.rst Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* Merge tag 'for-v4.21' of ↵Linus Torvalds2018-12-2924-418/+1677
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - New core support: - battery internal resistance - battery OCV capacity lookup table - support for custom sysfs attributes - Convert all drivers to use power-supply core support for custom sysfs attributes - bq24190-charger: bq24196 support - axp20x-charger: AXP813 support - sc27xx-battery: new fuel gauge driver - gpio-poweroff: support for specific active and inactive delays - Misc fixes * tag 'for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (53 commits) power: supply: bq25890: fix BAT_COMP field definition power: supply: gpio-charger: Do not use deprecated POWER_SUPPLY_TYPE_USB_* power: supply: ds2781: switch to devm_power_supply_register power: supply: ds2780: switch to devm_power_supply_register power: supply: ds2781: fix race-condition in bin attribute registration power: supply: ds2780: fix race-condition in bin attribute registration power: supply: pcf50633: fix race-condition in sysfs registration power: supply: charger-manager: fix race-condition in sysfs registration power: supply: charger-manager: simplify generation of sysfs attribute group name power: supply: bq24257: fix race-condition in sysfs registration power: supply: bq24190_charger: fix race-condition in sysfs registration power: supply: lp8788: fix race-condition in sysfs registration power: supply: ds2781: fix race-condition in sysfs registration power: supply: ds2780: fix race-condition in sysfs registration power: supply: bq2415x: fix race-condition in sysfs registration power: supply: core: add support for custom sysfs attributes power: supply: sc27xx: Save last battery capacity power: reset: at91-poweroff: move shdwc related data to one structure power: supply: sc27xx: Add suspend/resume interfaces power: supply: sc27xx: Add fuel gauge low voltage alarm ...
| * power: supply: bq25890: fix BAT_COMP field definitionMichał Mirosław2018-12-181-1/+1
| | | | | | | | | | | | | | | | | | According to datasheet, BAT_COMP field spans bits 5-7. The rest of the code seems to assume this already. Fixes: 4aeae9cb0dad ("power_supply: Add support for TI BQ25890 charger chip") Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: gpio-charger: Do not use deprecated POWER_SUPPLY_TYPE_USB_*Sebastian Reichel2018-12-131-3/+3
| | | | | | | | Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: ds2781: switch to devm_power_supply_registerSebastian Reichel2018-12-131-12/+3Star
| | | | | | | | | | | | | | Simplify/Cleanup the driver by switching to devm_power_supply_register and dropping the driver's remove function. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: ds2780: switch to devm_power_supply_registerSebastian Reichel2018-12-131-12/+3Star
| | | | | | | | | | | | | | Simplify/Cleanup the driver by switching to devm_power_supply_register and dropping the driver's remove function. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: ds2781: fix race-condition in bin attribute registrationSebastian Reichel2018-12-131-31/+19Star
| | | | | | | | | | | | | | | | | | | | This is a follow-up patch to the previous one, which fixed a race-condition during registration of the attribute group. This fixes the same issue for the binary attributes by adding them to the properly registered group. As a side effect the code is further cleaned up. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: ds2780: fix race-condition in bin attribute registrationSebastian Reichel2018-12-131-35/+20Star
| | | | | | | | | | | | | | | | | | | | This is a follow-up patch to the previous one, which fixed a race-condition during registration of the attribute group. This fixes the same issue for the binary attributes by adding them to the properly registered group. As a side effect the code is further cleaned up. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: pcf50633: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-10/+7Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: charger-manager: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-29/+22Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: charger-manager: simplify generation of sysfs attribute group ↵Sebastian Reichel2018-12-131-9/+4Star
| | | | | | | | | | | | | | | | name This is a simple cleanup and there should be no functional changes. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: bq24257: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-12/+3Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: bq24190_charger: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-35/+8Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: lp8788: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-35/+27Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: ds2781: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-19/+4Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: ds2780: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-19/+4Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: bq2415x: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-70/+49Star
| | | | | | | | | | | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: core: add support for custom sysfs attributesSebastian Reichel2018-12-131-0/+1
| | | | | | | | | | | | | | Add functionality to setup device specific sysfs attributes in a race condition free manner Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc27xx: Save last battery capacityYuanjiang Yu2018-12-061-1/+134
| | | | | | | | | | | | | | | | | | | | | | Our charger manager can optimize the battery capacity periodically, so we can save last battery capacity into registers. Then next system power-on, we can read the last saved battery capacity as the initial battery capacity, which can make the battery capacity more accurate. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: reset: at91-poweroff: move shdwc related data to one structureClaudiu Beznea2018-12-061-23/+25
| | | | | | | | | | | | | | | | | | Move SHDWC realted data to only one structure to have them grouped. Inspired from commit 9be74f0d39c1 ("power: reset: at91-poweroff: make mpddrc_base part of struct shdwc"). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc27xx: Add suspend/resume interfacesYuanjiang Yu2018-12-061-0/+77
| | | | | | | | | | | | | | | | | | | | Add fuel gauge platform suspend and resume interfaces. In suspend state, we should enable the low voltage and coulomb counter threshold interrupts to wake up system to calibrate the battery capacity in lower voltage stage. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc27xx: Add fuel gauge low voltage alarmYuanjiang Yu2018-12-061-1/+170
| | | | | | | | | | | | | | | | | | Add low voltage alarm support to make sure the battery capacity more accurate in lower voltage stage. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc27xx: Add fuel gauge calibrationBaolin Wang2018-12-061-11/+51
| | | | | | | | | | | | | | | | | | This patch adds support to read calibration values from the eFuse controller to calibrate the ADC values corresponding to current and voltage, which can make the current and voltage data more accurate. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc2731_charger: Free battery informationBaolin Wang2018-12-051-0/+2
| | | | | | | | | | | | | | Free battery information in case of adding battery OCV tables. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc2731_charger: Avoid repeated charge/dischargeBaolin Wang2018-12-051-2/+2
| | | | | | | | | | | | | | | | Add info->charging validation to avoid repeated charge or discharge operation. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: sc2731_charger: Add charger status detectionBaolin Wang2018-12-051-0/+20
| | | | | | | | | | | | | | | | | | The USB charger status can be notified before the charger driver registers the USB phy notifier, so we should check the charger status in probe() in case we missed the USB charger notification. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>