]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: qcom_battmgr: clamp charge control thresholds
authorVal Packett <val@packett.cool>
Sun, 12 Oct 2025 23:32:18 +0000 (20:32 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:48 +0000 (14:02 +0100)
commit2614ebcf2bca48e5f2b4ca1835870db4d1e65a0b
treec32babc0a78d8e3b8ac73b4a833fe29c58de80b7
parenteade8ea73b91a2fc03c0dfb89ec3c829938fffce
power: supply: qcom_battmgr: clamp charge control thresholds

[ Upstream commit 8809980fdc8a86070667032fa4005ee83f1c62f3 ]

The sysfs API documentation says that drivers "round written values to
the nearest supported value" for charge_control_end_threshold.

Let's do this for both thresholds, as userspace (e.g. upower) generally
does not expect these writes to fail at all.

Fixes: cc3e883a0625 ("power: supply: qcom_battmgr: Add charge control support")
Signed-off-by: Val Packett <val@packett.cool>
Link: https://patch.msgid.link/20251012233333.19144-3-val@packett.cool
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/qcom_battmgr.c