summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/max77693_charger.c
Commit message (Collapse)AuthorAgeFilesLines
* power: supply: max77693: Expose input current limit and CC current propertiesArtur Weber2024-08-271-0/+52
| | | | | | | | | | | | | | | | | | | There are two charger current limit registers: - Fast charge current limit (which controls current going from the charger to the battery); - CHGIN input current limit (which controls current going into the charger through the cable). Add the necessary functions to retrieve the CHGIN input limit (from CHARGER regulator) and maximum fast charge current values, and expose them as power supply properties. Tested-by: Henrik Grimler <henrik@grimler.se> Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240816-max77693-charger-extcon-v4-3-050a0a9bfea0@gmail.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: max77693: Use devm_power_supply_register() helperAndrew Davis2024-02-011-7/+3
| | | | | | | | | | Use the device lifecycle managed register function. This helps prevent mistakes like unregistering out of order in cleanup functions and forgetting to unregister on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20240129190246.73067-3-afd@ti.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: max77693_charger: Convert to platform remove callback ↵Uwe Kleine-König2023-09-181-4/+2
| | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230918133700.1254499-20-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: use sysfs_emit() instead of scnprintf() for sysfs show()ye xingchen2023-01-021-3/+3
| | | | | | | | | | | As documented in Documentation/filesystems/sysfs.rst the sysfs show() function should use sysfs_emit() or sysfs_emit_at() to format the userspace return value. This replaces all instances of scnprintf() with sysfs_emit() in the power-supply subsystem. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> [reword commit message] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: maxim: Add SPDX license identifiersKrzysztof Kozlowski2018-08-301-16/+6
| | | | | | | | Replace GPL v2.0 and v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: max77693_charger: fix unintentional fall-throughGustavo A. R. Silva2018-07-231-0/+1
| | | | | | | | | | | It seems that a *break* is missing in order to avoid a fall-through. Otherwise, the calculation of *data* makes no sense. Addresses-Coverity-ID: 1271172 ("Missing break in switch") Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
* power: supply: Change Krzysztof Kozlowski's email to kernel.orgKrzysztof Kozlowski2016-08-171-2/+2
| | | | | | | | | Change my email address to kernel.org instead of Samsung one for the purpose of any future contact. The copyrights remain untouched and are attributed to Samsung. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* power: move power supply drivers to power/supplySebastian Reichel2016-08-111-0/+771
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>