]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
power: supply: bq257xx: Fix VSYSMIN clamping logic
authorAlexey Charkov <alchark@flipper.net>
Tue, 2 Jun 2026 20:10:50 +0000 (00:10 +0400)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 3 Jun 2026 20:44:19 +0000 (22:44 +0200)
commitb6c6b9260a92dacef6edef8e93bc2767b86b1dfe
tree2dc05a1aaf41cb69ff792e977343a34d7dfadfac
parenta2c14ff63e0e02e3c832385e523e9cc81301171c
power: supply: bq257xx: Fix VSYSMIN clamping logic

The minimal system voltage (VSYSMIN) is meant to protect the battery from
dangerous over-discharge. When the device tree provides a value for the
minimum design voltage of the battery, the user should not be allowed to
set a lower VSYSMIN, as that would defeat the purpose of this protection.

Flip the clamping logic when setting VSYSMIN to ensure that battery design
voltage is respected.

Cc: stable@vger.kernel.org
Fixes: 1cc017b7f9c7 ("power: supply: bq257xx: Add support for BQ257XX charger")
Tested-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/20260603-bq25792-v7-2-d487bed276d0@flipper.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq257xx_charger.c