0006-lg-laptop-Recognize-more-models.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 9633e4af545533b6738180955a059af8f2bd904f Mon Sep 17 00:00:00 2001
  2. From: Matan Ziv-Av <matan@svgalib.org>
  3. Date: Tue, 23 Nov 2021 22:14:55 +0200
  4. Subject: [PATCH 6/6] lg-laptop: Recognize more models
  5. 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.
  6. Signed-off-by: Matan Ziv-Av <matan@svgalib.org>
  7. For: https://bugs.archlinux.org/task/71772
  8. ---
  9. drivers/platform/x86/lg-laptop.c | 12 ++++++++++++
  10. 1 file changed, 12 insertions(+)
  11. diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
  12. index 88b551caeaaf..d6f74d3a7605 100644
  13. --- a/drivers/platform/x86/lg-laptop.c
  14. +++ b/drivers/platform/x86/lg-laptop.c
  15. @@ -658,6 +658,18 @@ static int acpi_add(struct acpi_device *device)
  16. if (product && strlen(product) > 4)
  17. switch (product[4]) {
  18. case '5':
  19. + if (strlen(product) > 5)
  20. + switch (product[5]) {
  21. + case 'N':
  22. + year = 2021;
  23. + break;
  24. + case '0':
  25. + year = 2016;
  26. + break;
  27. + default:
  28. + year = 2022;
  29. + }
  30. + break;
  31. case '6':
  32. year = 2016;
  33. break;
  34. --
  35. 2.34.1