]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
platform/x86: uniwill-laptop: Accept charging threshold of 0
authorArmin Wolf <W_Armin@gmx.de>
Tue, 12 May 2026 23:21:39 +0000 (01:21 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 19 May 2026 13:52:46 +0000 (16:52 +0300)
commitc16a4823cc60a32b891f7a148bb30c0f51d12cf4
tree018b608d401ef2ea312e2546bea80369c87164f9
parentc12cc42dadd85dea210d5699d4f21def827382eb
platform/x86: uniwill-laptop: Accept charging threshold of 0

The power supply sysfs ABI states that:

Not all hardware is capable of setting this to an arbitrary
percentage. Drivers will round written values to the nearest
supported value. Reading back the value will show the actual
threshold set by the driver.

The driver currently violates this ABI by rejecting a charging
threshold of 0. Fix this by clamping this value to 1.

Fixes: d050479693bb ("platform/x86: Add Uniwill laptop driver")
Reviewed-by: Werner Sembach <wse@tuxedocomputers.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260512232145.329260-3-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/uniwill/uniwill-acpi.c