]> git.ipfire.org Git - thirdparty/linux.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)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 3 Nov 2025 00:01:57 +0000 (01:01 +0100)
commit8809980fdc8a86070667032fa4005ee83f1c62f3
tree7e263c7e17a3e967d72dd3a81b5f52adb3e79650
parentea14bae6df18942bccb467fcf5ff33ca677b8253
power: supply: qcom_battmgr: clamp charge control thresholds

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>
drivers/power/supply/qcom_battmgr.c