summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/ab8500_charger.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva2020-08-231-2/+2
| | | | | | | | | | Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
* power: supply: ab8500_charger: Fix typos in commit messagesAshish Chavan2020-03-061-16/+19
| | | | | | | Trivial fix to spelling mistake in commit messages. Signed-off-by: Ashish Chavan <ashish.gschavan@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ab8500_charger: Remove unneeded semicolonMa Feng2019-12-191-3/+3
| | | | | | | | | | | | Fixes coccicheck warning: drivers/power/supply/ab8500_charger.c:1082:2-3: Unneeded semicolon drivers/power/supply/ab8500_charger.c:792:2-3: Unneeded semicolon drivers/power/supply/ab8500_charger.c:2430:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ma Feng <mafeng.ma@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ab8500_charger: Fix inconsistent IS_ERR and PTR_ERRGustavo A. R. Silva2019-10-271-1/+1
| | | | | | | | | | | | | | Fix inconsistent IS_ERR and PTR_ERR in ab8500_charger_probe(). The proper pointer to be passed as argument is di->adc_main_charger_c This bug was detected with the help of Coccinelle. Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ab8500: Handle invalid IRQ from platform_get_irq_byname()Krzysztof Kozlowski2019-10-201-0/+5
| | | | | | | | | platform_get_irq_byname() might return -errno which later would be cast to an unsigned int and used in request_irq(). Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ab8500_charger: Convert to IIO ADCLinus Walleij2019-10-181-20/+58
| | | | | | | | | | This switches the AB8500 battery charger driver to using the standard IIO ADC channel lookup and conversion routines. Acked-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* power: supply: ab8500: remove set but not used variables 'vbup33_vrtcn' and ↵YueHaibing2019-09-021-7/+0
| | | | | | | | | | | | | | | | | | | 'bup_vch_range' Fixes gcc '-Wunused-but-set-variable' warnings: drivers/power/supply/ab8500_charger.c: In function ab8500_charger_init_hw_registers: drivers/power/supply/ab8500_charger.c:3013:24: warning: variable vbup33_vrtcn set but not used [-Wunused-but-set-variable] drivers/power/supply/ab8500_charger.c:3013:5: warning: variable bup_vch_range set but not used [-Wunused-but-set-variable] Fixes: 4c4268dc97c4 ("power: supply: ab8500: Drop AB8540/9540 support") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ab8500_charger: Mark expected switch fall-throughGustavo A. R. Silva2019-09-021-0/+1
| | | | | | | | | | | Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: allmodconfig arm): drivers/power/supply/ab8500_charger.c:738:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 197Thomas Gleixner2019-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): license terms gnu general public license v2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 37 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170027.724130665@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* power: supply: ab8500_charger: fix spelling mistake: "faile" -> "failed"Colin Ian King2018-05-011-1/+1
| | | | | | | trivial fix to spelling mistake in dev_error message. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
* power: supply: ab8500: Drop AB8540/9540 supportLinus Walleij2018-04-251-122/+9
| | | | | | | | | | | | | The AB8540 was an evolved version of the AB8500, but it was never mass produced or put into products, only reference designs exist. The upstream support was never completed and it is unlikely that this will happen so drop the support for now to simplify maintenance of the AB8500. Cc: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
* power: supply: ab8500_charger: Bail out in case of error in ↵Christophe JAILLET2017-12-011-1/+3
| | | | | | | | | | | | | | | | | | | | 'ab8500_charger_init_hw_registers()' If an error occurs when we enable the backup battery charging, we should go through the error handling path directly. Before commit db43e6c473b5 ("ab8500-bm: Add usb power path support") this was the case, but this commit has added some code between the last test and the 'out' label. So, in case of error, this added code is executed and the error may be silently ignored. Fix it by adding the missing 'goto out', as done in all other error handling paths. Fixes: db43e6c473b5 ("ab8500-bm: Add usb power path support") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
* power: supply: ab8500_charger: Fix an error handling pathChristophe JAILLET2017-12-011-1/+1
| | | | | | | | | | | 'ret' is know to be 0 at this point, because it has not been updated by the the previous call to 'abx500_mask_and_set_register_interruptible()'. Fix it by updating 'ret' before checking if an error occurred. Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
* power: supply: ab8500_charger: spelling: "prechage" -> "precharge"Colin Ian King2017-05-011-1/+1
| | | | | | | trivial fix to spelling mistake in dev_error message. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
* power: ab8500_charger: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar2016-08-161-2/+2
| | | | | | | | | | | | | | | | | | | | | alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces deprecated create_singlethread_workqueue(). This is the identity conversion. The workqueue "charger_wq" is used for the IRQs and checking HW state of the charger. It has been identity converted. It has multiple work items viz usb_charger_attached_work, kick_wd_work, check_vbat_work, check_hw_failure_work, usb_charger_attached_work, ac_work, ac_charger_attached_work, attach_work and check_usbchgnotok_work, which require execution ordering. Hence, a dedicated ordered workqueue has been used here. The WQ_MEM_RECLAIM flag has also been set to ensure forward progress under memory pressure. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* power: move power supply drivers to power/supplySebastian Reichel2016-08-111-0/+3765
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>