Request to patch lg_laptop module in Manjaro Kernel 5.15.x

Hi,

With kernel 5.15.x, Matan Ziv-Av (the primary maintainer of lg_laptop.c module) created a new patch for lg_laptop.c that solves an issue with the module ignoring battery charge limit for my LG laptop model, but, he thinks, it may not get included anytime soon in the mainline 5.15.x kernel. It would be great to get this included as a patch to the Manjaro kernel instead.

Since I can’t add the direct link to the patch, here is the copy of the small patch:

LG uses 5 instead of 0 in the third digit (second digit after 2019)
of the year string to indicate newer models in the same year. Handle
this case as well.

diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
index ae9293024c77..a91847a551a7 100644
--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -657,6 +657,18 @@ static int acpi_add(struct acpi_device *device)
  	if (product && strlen(product) > 4)
  		switch (product[4]) {
  		case '5':
+			if (strlen(product) > 5)
+				switch (product[5]) {
+				case 'N':
+					year = 2021;
+					break;
+				case '0':
+					year = 2016;
+					break;
+				default:
+					year = 2022;
+				}
+			break;
  		case '6':
  			year = 2016;
  			break;

Thanks,
Mahesh

1 Like

Hi,

Just wondering if there is any possibility of including this in the 5.15.x kernel? Apparently, 5.15.x is an LTS kernel so it would be great to include this fairly isolated and small patch.

Thanks,
Mahesh