diff mbox series

[1/2] lg-laptop: Recognize more models correctly

Message ID c83c1074057eec03595b22cbb671a7fb3ebcf192.1645278914.git.matan@svgalib.org (mailing list archive)
State Mainlined, archived
Headers show
Series lg-laptop: model recognition improvements, common battery charge limit location | expand

Commit Message

Matan Ziv-Av Nov. 21, 2021, 7:43 a.m. UTC
LG uses 5 instead of 0 in the third (second after 2019) digit of
the year string to indicate newer models in the same year.

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

Comments

Hans de Goede Feb. 22, 2022, 5:52 p.m. UTC | #1
Hi,

On 11/21/21 08:43, Matan Ziv-Av wrote:
> LG uses 5 instead of 0 in the third (second after 2019) digit of
> the year string to indicate newer models in the same year.
> 
> Signed-off-by: Matan Ziv-Av <matan@svgalib.org>

It seems that you accidentally resend this one, it was
already merged quite a while ago...

Regards,

Hans


> ---
>  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 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;
diff mbox series

Patch

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;