Skip to contentSkip to conversation

power: supply: axp288_fuel_gauge: Sort the DMI blacklist alphabetically

PATCH In review Hans de Goede 2 participants 4 messages Aug 25, 2019 – Sep 1, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 power: supply: axp288_fuel_gauge: Sort the DMI blacklist alphabetically

The blacklist is getting big enough that it is good to have some sort of fixed order for it, sort it alphabetically.

---
 drivers/power/supply/axp288_fuel_gauge.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/power/supply/axp288_fuel_gauge.c +7 -6
index 44169dabb705..6db2e86098e9 100644
@@ -674,6 +674,7 @@ static void fuel_gauge_init_irq(struct axp288_fg_info *info)
 /*
  * Some devices have no battery (HDMI sticks) and the axp288 battery's
  * detection reports one despite it not being there.
+ * Please keep this listed sorted alphabetically.
  */
 static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 	{
@@ -696,6 +697,12 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1.000"),
 		},
 	},
+	{
+		/* ECS EF20EA */
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
+		},
+	},
 	{
 		/* Intel Cherry Trail Compute Stick, Windows version */
 		.matches = {
@@ -719,12 +726,6 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_MATCH(DMI_BOARD_VERSION, "V1.1"),
 		},
 	},
-	{
-		/* ECS EF20EA */
-		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
-		},
-	},
 	{}
 };
 
Signature · 1 line
2.23.0
#1 lore raw

PATCH 2/2 power: supply: axp288_fuel_gauge: Add Minix Neo Z83-4 to the blacklist

The Minix Neo Z83-4 is another mini PC using the AXP288 PMIC where the EFI code does not disable the charger part of the PMIC causing us to report battery readings (of always 100%) to userspace even though there is no battery in this wall-outlet powered device.

Add it to the blacklist to avoid the bogus battery status reporting.

---
 drivers/power/supply/axp288_fuel_gauge.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/power/supply/axp288_fuel_gauge.c +7 -0
index 6db2e86098e9..e1bc4e6e6f30 100644
@@ -726,6 +726,13 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_MATCH(DMI_BOARD_VERSION, "V1.1"),
 		},
 	},
+	{
+		/* Minix Neo Z83-4 mini PC */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
+		}
+	},
 	{}
 };
 
Signature · 1 line
2.23.0
#2 lore raw

Re: [PATCH 2/2] power: supply: axp288_fuel_gauge: Add Minix Neo Z83-4 to the blacklist

Hi,

Quoted 9 lines · Hans de Goede

The Minix Neo Z83-4 is another mini PC using the AXP288 PMIC where the EFI code does not disable the charger part of the PMIC causing us to report battery readings (of always 100%) to userspace even though there is no battery in this wall-outlet powered device.

Add it to the blacklist to avoid the bogus battery status reporting.

---

Thanks, queued.

-- Sebastian

Quoted 24 lines
 drivers/power/supply/axp288_fuel_gauge.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/power/supply/axp288_fuel_gauge.c +7 -0
index 6db2e86098e9..e1bc4e6e6f30 100644
@@ -726,6 +726,13 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_MATCH(DMI_BOARD_VERSION, "V1.1"),
 		},
 	},
+	{
+		/* Minix Neo Z83-4 mini PC */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
+		}
+	},
 	{}
 };
 
Signature · 1 line
2.23.0
#3 lore raw
In reply to Hans de Goede

Hi,

Quoted 5 lines · Hans de Goede

The blacklist is getting big enough that it is good to have some sort of fixed order for it, sort it alphabetically.

---

Thanks, queued.

-- Sebastian

Quoted 44 lines
 drivers/power/supply/axp288_fuel_gauge.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/power/supply/axp288_fuel_gauge.c +7 -6
index 44169dabb705..6db2e86098e9 100644
@@ -674,6 +674,7 @@ static void fuel_gauge_init_irq(struct axp288_fg_info *info)
 /*
  * Some devices have no battery (HDMI sticks) and the axp288 battery's
  * detection reports one despite it not being there.
+ * Please keep this listed sorted alphabetically.
  */
 static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 	{
@@ -696,6 +697,12 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1.000"),
 		},
 	},
+	{
+		/* ECS EF20EA */
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
+		},
+	},
 	{
 		/* Intel Cherry Trail Compute Stick, Windows version */
 		.matches = {
@@ -719,12 +726,6 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_MATCH(DMI_BOARD_VERSION, "V1.1"),
 		},
 	},
-	{
-		/* ECS EF20EA */
-		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
-		},
-	},
 	{}
 };
 
Signature · 1 line
2.23.0