public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling
@ 2025-10-12 23:32 Val Packett
  2025-10-12 23:32 ` [PATCH 1/2] power: supply: qcom_battmgr: clamp charge control thresholds Val Packett
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Val Packett @ 2025-10-12 23:32 UTC (permalink / raw)
  To: Sebastian Reichel, Fenglin Wu, Neil Armstrong, linux-arm-msm,
	linux-pm, linux-kernel
  Cc: Val Packett

Currently, upowerd is unable to turn off the battery preservation mode[1]
on Qualcomm laptops, because it does that by setting the start threshold to
zero and the driver returns an error:

pmic_glink.power-supply.0: charge control start threshold exceed range: [50 - 95]

Kernel documentation says the end threshold must be clamped[2] but does
not say anything about the start threshold.

In this proposal I've special-cased start==0 to actually disable the
functionality via the enable bit, and otherwise made both start and
end thresholds be clamped to the acceptable range. Hopefully that's
fine? Or should the [1 - 49] range for start actually be rejected?

[1]: https://gitlab.freedesktop.org/upower/upower/-/issues/327
[2]: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power

Thanks,
~val

Val Packett (2):
  power: supply: qcom_battmgr: clamp charge control thresholds
  power: supply: qcom_battmgr: support disabling charge control

 drivers/power/supply/qcom_battmgr.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-11-18 10:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-12 23:32 [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling Val Packett
2025-10-12 23:32 ` [PATCH 1/2] power: supply: qcom_battmgr: clamp charge control thresholds Val Packett
2025-10-13  9:43   ` Konrad Dybcio
2025-10-12 23:32 ` [PATCH 2/2] power: supply: qcom_battmgr: support disabling charge control Val Packett
2025-11-17  5:22   ` Fenglin Wu
2025-11-03  0:48 ` [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling Sebastian Reichel
2025-11-03  3:46   ` Val Packett
2025-11-03 14:41     ` Sebastian Reichel
2025-11-17  5:12 ` Fenglin Wu
2025-11-17 12:45   ` Konrad Dybcio
2025-11-18  2:29     ` Fenglin Wu
2025-11-18 10:13       ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox