summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/act8945a_charger.c
AgeCommit message (Collapse)AuthorFilesLines
2021-04-20power: supply: act8945a: correct kerneldocKrzysztof Kozlowski1-1/+1
Remove incorrect kerneldoc marker to fix W=1 warning: drivers/power/supply/act8945a_charger.c:22: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-24power: supply: act8945a_charger: fix of_irq_get() error checkSergei Shtylyov1-2/+2
of_irq_get() may return any negative error number as well as 0 on failure, while the driver only checks for -EPROBE_DEFER, blithely continuing with the call to devm_request_irq() -- that function expects *unsigned int*, so would probably fail anyway when a large IRQ number resulting from a conversion of a negative error number is passed to it... This, however, is incorrect behavior -- error number is not IRQ number. Check for 'irq <= 0' instead and return -ENXIO from probe if of_irq_get() returned 0. Fixes: a09209acd6a8 ("power: supply: act8945a_charger: Add status change update support") Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2016-09-01power: supply: act8945a_charger: Add max current propertyWenyou Yang1-9/+80
Add the power supply's current max property, POWER_SUPPLY_PROP_CURRENT_MAX. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-01power: supply: act8945a_charger: Add capacity level propertyWenyou Yang1-1/+78
Add the power supply capacity level property, it corresponds to POWER_SUPPLY_CAPACITY_LEVEL_*. It also utilizes the precision voltage detector function module to catch the low battery voltage. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31power: supply: act8945a_charger: Fix the power supply typeWenyou Yang1-9/+39
The power supply type property is varying as the external power supply changes. It is not a constant. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31power: supply: act8945a_charger: Add status change update supportWenyou Yang1-7/+88
Add the charger status change interrupt support, it will report the power supply changed event. This interrupt is generated by one of the conditions as below: - the state machine jumps out of or into the EOC state - the CHGIN input voltage goes out of or into the valid range. - the battery temperature goes out of or into the valid range. - the PRECHARGE time-out occurs. - the total charge time-out occurs. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31power: supply: act8945a_charger: Improve state handlingWenyou Yang1-16/+70
When get the property, first check the charger state machine, then check the status bit to decide what value is assigned to the corresponding property. Retain the SUSCHG bit of REG 0x71 when configure the timers to avoid losting the charger suspending info after boot. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31power: supply: act8945a_charger: Remove "battery_temperature"Wenyou Yang1-9/+3
Remove "battery_temperature" member, it is redundant, it is the hardware's responsibility to handle TH pin properly. It is unnecessary to use the dt property to check if there is a battery temperature monitor or not. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31power: supply: act8945a_charger: Achieve properties from its nodeWenyou Yang1-2/+2
Since the act8945a_charger is regarded as a sub-device, all properties will be assigned to its own device node. All properties can be achieved from its own node, instead of from its parent device. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-11power: move power supply drivers to power/supplySebastian Reichel1-0/+359
This moves all power supply drivers from drivers/power/ to drivers/power/supply/. The intention is a cleaner source tree, since drivers/power/ also contains frameworks unrelated to power supply, like adaptive voltage scaling. Signed-off-by: Sebastian Reichel <sre@kernel.org>