linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ACPI / AC / battery: DMI quirk cleanups
@ 2020-02-23 14:29 Hans de Goede
  2020-02-23 14:29 ` [PATCH 1/2] ACPI / AC: Cleanup DMI quirk table Hans de Goede
  2020-02-23 14:29 ` [PATCH 2/2] ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2020-02-23 14:29 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown; +Cc: Hans de Goede, linux-acpi

Hi Rafael,

These 2 cleanup patches were preparation patches for adding a quirk
to both drivers for one more model. But in the end I ended up solving
the problem on that model in a different way.

I still think the cleanups are good to have, so I'm submitting them
without any further changes on top.

Regards,

Hans


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ACPI / AC: Cleanup DMI quirk table
  2020-02-23 14:29 [PATCH 0/2] ACPI / AC / battery: DMI quirk cleanups Hans de Goede
@ 2020-02-23 14:29 ` Hans de Goede
  2020-03-04 10:58   ` Rafael J. Wysocki
  2020-02-23 14:29 ` [PATCH 2/2] ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry Hans de Goede
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2020-02-23 14:29 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown; +Cc: Hans de Goede, linux-acpi

The 3 different entries we have sofar all use different identation and
2 of the use DMI_MATCH where as 1 unnecessarily used DMI_EXACT_MATCH
Fix this to just use full tab idents for each level and DMI_MATCH
everywhere and sort the entries alphabetically.

Also add a bit of text to the comments explaining why the quirk is
necessary.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/ac.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 829f37d36b9f..69d2db13886b 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -293,29 +293,30 @@ static int __init ac_do_not_check_pmic_quirk(const struct dmi_system_id *d)
 	return 0;
 }
 
+/* Please keep this list alphabetically sorted */
 static const struct dmi_system_id ac_dmi_table[]  __initconst = {
 	{
-	/* Thinkpad e530 */
-	.callback = thinkpad_e530_quirk,
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"),
+		/* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
+		.callback = ac_do_not_check_pmic_quirk,
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
 		},
 	},
 	{
-		/* ECS EF20EA */
+		/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
 		.callback = ac_do_not_check_pmic_quirk,
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "80XF"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
 		},
 	},
 	{
-		/* Lenovo Ideapad Miix 320 */
-		.callback = ac_do_not_check_pmic_quirk,
+		/* Lenovo Thinkpad e530, see comment in acpi_ac_notify() */
+		.callback = thinkpad_e530_quirk,
 		.matches = {
-		  DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		  DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"),
-		  DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"),
 		},
 	},
 	{},
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry
  2020-02-23 14:29 [PATCH 0/2] ACPI / AC / battery: DMI quirk cleanups Hans de Goede
  2020-02-23 14:29 ` [PATCH 1/2] ACPI / AC: Cleanup DMI quirk table Hans de Goede
@ 2020-02-23 14:29 ` Hans de Goede
  1 sibling, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2020-02-23 14:29 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown; +Cc: Hans de Goede, linux-acpi

The Lenovo Ideapad Miix 320 bat_dmi_table entry is using weird indentation
and is the only entry which (unnecessarily) uses DMI_EXACT_MATCH instead
of DMI_MATCH, fixup both to make the entry consistent with the others.

While at it also update the comments for battery_do_not_check_pmic_quirk
entries, adding a bit of text explaining why the quirk is necessary.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/battery.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 111a407dcc77..366c389175d8 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1365,19 +1365,19 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
 		},
 	},
 	{
-		/* ECS EF20EA */
+		/* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
 		.callback = battery_do_not_check_pmic_quirk,
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
 		},
 	},
 	{
-		/* Lenovo Ideapad Miix 320 */
+		/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
 		.callback = battery_do_not_check_pmic_quirk,
 		.matches = {
-		  DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		  DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"),
-		  DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "80XF"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
 		},
 	},
 	{},
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ACPI / AC: Cleanup DMI quirk table
  2020-02-23 14:29 ` [PATCH 1/2] ACPI / AC: Cleanup DMI quirk table Hans de Goede
@ 2020-03-04 10:58   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-03-04 10:58 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Len Brown, linux-acpi

On Sunday, February 23, 2020 3:29:40 PM CET Hans de Goede wrote:
> The 3 different entries we have sofar all use different identation and
> 2 of the use DMI_MATCH where as 1 unnecessarily used DMI_EXACT_MATCH
> Fix this to just use full tab idents for each level and DMI_MATCH
> everywhere and sort the entries alphabetically.
> 
> Also add a bit of text to the comments explaining why the quirk is
> necessary.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/acpi/ac.c | 25 +++++++++++++------------
>  1 file changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
> index 829f37d36b9f..69d2db13886b 100644
> --- a/drivers/acpi/ac.c
> +++ b/drivers/acpi/ac.c
> @@ -293,29 +293,30 @@ static int __init ac_do_not_check_pmic_quirk(const struct dmi_system_id *d)
>  	return 0;
>  }
>  
> +/* Please keep this list alphabetically sorted */
>  static const struct dmi_system_id ac_dmi_table[]  __initconst = {
>  	{
> -	/* Thinkpad e530 */
> -	.callback = thinkpad_e530_quirk,
> -	.matches = {
> -		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> -		DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"),
> +		/* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
> +		.callback = ac_do_not_check_pmic_quirk,
> +		.matches = {
> +			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
>  		},
>  	},
>  	{
> -		/* ECS EF20EA */
> +		/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
>  		.callback = ac_do_not_check_pmic_quirk,
>  		.matches = {
> -			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
> +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "80XF"),
> +			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
>  		},
>  	},
>  	{
> -		/* Lenovo Ideapad Miix 320 */
> -		.callback = ac_do_not_check_pmic_quirk,
> +		/* Lenovo Thinkpad e530, see comment in acpi_ac_notify() */
> +		.callback = thinkpad_e530_quirk,
>  		.matches = {
> -		  DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> -		  DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"),
> -		  DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
> +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"),
>  		},
>  	},
>  	{},
> 

Both patches in the series applied as 5.7 material, thanks!





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-04 10:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23 14:29 [PATCH 0/2] ACPI / AC / battery: DMI quirk cleanups Hans de Goede
2020-02-23 14:29 ` [PATCH 1/2] ACPI / AC: Cleanup DMI quirk table Hans de Goede
2020-03-04 10:58   ` Rafael J. Wysocki
2020-02-23 14:29 ` [PATCH 2/2] ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).