Skip to content

Commit 26cbe11

Browse files
Wer-Wolfij-intel
authored andcommitted
platform/x86: uniwill-laptop: Do not enable the charging limit even when forced
It seems that on some older models (~2020) the battery charging limit can permanently damage the battery. Prevent users from enabling this feature thru the "force" module parameter to avoid causing permanent hardware damage on such devices. Fixes: d050479 ("platform/x86: Add Uniwill laptop driver") Link: https://www.reddit.com/r/XMG_gg/comments/ld9yyf/battery_limit_hidden_function_discovered_on/ 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-5-W_Armin@gmx.de Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent fb4b67c commit 26cbe11

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Documentation/admin-guide/laptops/uniwill-laptop.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ Support for changing the platform performance mode is currently not implemented.
4343
Battery Charging Control
4444
------------------------
4545

46+
.. warning:: Some devices do not properly implement the charging threshold interface. Forcing
47+
the driver to enable access to said interface on such devices might damage the
48+
battery [1]_. Because of this the driver will not enable said feature even when
49+
using the ``force`` module parameter.
50+
4651
The ``uniwill-laptop`` driver supports controlling the battery charge limit. This happens over
4752
the standard ``charge_control_end_threshold`` power supply sysfs attribute. All values
4853
between 1 and 100 percent are supported.
@@ -70,3 +75,8 @@ The ``uniwill-laptop`` driver allows to set the configurable TGP for devices wit
7075
allow it.
7176

7277
See Documentation/ABI/testing/sysfs-driver-uniwill-laptop for details.
78+
79+
References
80+
==========
81+
82+
.. [1] https://www.reddit.com/r/XMG_gg/comments/ld9yyf/battery_limit_hidden_function_discovered_on/

drivers/platform/x86/uniwill/uniwill-acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,8 +2507,8 @@ static int __init uniwill_init(void)
25072507
}
25082508

25092509
if (force) {
2510-
/* Assume that the device supports all features */
2511-
device_descriptor.features = UINT_MAX;
2510+
/* Assume that the device supports all features except the charge limit */
2511+
device_descriptor.features = UINT_MAX & ~UNIWILL_FEATURE_BATTERY;
25122512
pr_warn("Enabling potentially unsupported features\n");
25132513
}
25142514

0 commit comments

Comments
 (0)