platform/x86: lg-laptop: Recognize more models
authorMatan Ziv-Av <matan@svgalib.org>
Tue, 23 Nov 2021 20:14:55 +0000 (22:14 +0200)
committerHans de Goede <hdegoede@redhat.com>
Thu, 2 Dec 2021 11:58:26 +0000 (12:58 +0100)
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>
Link: https://lore.kernel.org/r/c752b3b2-9718-bd9a-732d-e165aa8a1fca@svgalib.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/lg-laptop.c

index ae9293024c77bd23427a9089f19659cb1f894d59..a91847a551a725336a063235697046d660c698dc 100644 (file)
@@ -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;