aboutsummarylogtreecommitdiffstats
path: root/lg-laptop-Recognize-more-models.patch
blob: 904efce14b89036c7985262db6a23a58010fc4b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From c03af20354e338bb1e47eee01d535f23717a7608 Mon Sep 17 00:00:00 2001
From: Matan Ziv-Av <matan@svgalib.org>
Date: Tue, 23 Nov 2021 22:14:55 +0200
Subject: [PATCH 2/3] lg-laptop: Recognize more models

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.

Signed-off-by: Matan Ziv-Av <matan@svgalib.org>
For: https://bugs.archlinux.org/task/71772
---
 drivers/platform/x86/lg-laptop.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
index 88b551caeaaf..d6f74d3a7605 100644
--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -658,6 +658,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;
-- 
2.34.1