[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211031162428.22368-4-hdegoede@redhat.com>
Date: Sun, 31 Oct 2021 17:24:26 +0100
From: Hans de Goede <hdegoede@...hat.com>
To: "Rafael J . Wysocki" <rjw@...ysocki.net>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Mark Gross <markgross@...nel.org>,
Andy Shevchenko <andy@...radead.org>,
Wolfram Sang <wsa@...-dreams.de>,
Sebastian Reichel <sre@...nel.org>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Ard Biesheuvel <ardb@...nel.org>
Cc: Hans de Goede <hdegoede@...hat.com>, Len Brown <lenb@...nel.org>,
linux-acpi@...r.kernel.org, Yauhen Kharuzhy <jekhor@...il.com>,
Tsuchiya Yuto <kitakar@...il.com>,
platform-driver-x86@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-efi@...r.kernel.org
Subject: [RFC 3/5] gpiolib: acpi: Add a new "ignore" module option
Add a new "ignore" module option to completely ignore controller@pin combos
from _AEI lists.
And add a DMI quirk to ignore the interrupt of the BQ27520 fuel-gauge IC
on the Xiaomi Mi Pad 2. On this device we use native charger + fuel-gauge
drivers because of issues with the ACPI battery implementation. The _AEI
listing of the fuel-gauge IRQ is intended for use with the unused ACPI
battery implementation and is blocking the bq27xxx fuel-gauge driver
from binding.
Signed-off-by: Hans de Goede <hdegoede@...hat.com>
---
drivers/gpio/gpiolib-acpi.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 342219a58a32..2d08f33a22a6 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -32,9 +32,16 @@ MODULE_PARM_DESC(ignore_wake,
"controller@pin combos on which to ignore the ACPI wake flag "
"ignore_wake=controller@pin[,controller@pin[,...]]");
+static char *ignore;
+module_param(ignore, charp, 0444);
+MODULE_PARM_DESC(ignore,
+ "controller@pin combos which are to be ignored from _AEI lists "
+ "ignore=controller@pin[,controller@pin[,...]]");
+
struct acpi_gpiolib_dmi_quirk {
bool no_edge_events_on_boot;
char *ignore_wake;
+ char *ignore;
};
/**
@@ -407,6 +414,11 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
if (!handler)
return AE_OK;
+ if (acpi_gpio_in_ignore_list(ignore, dev_name(chip->parent), pin)) {
+ dev_info(chip->parent, "Ignoring _AEI entry for pin %d\n", pin);
+ return AE_OK;
+ }
+
desc = acpi_request_own_gpiod(chip, agpio, 0, "ACPI:Event");
if (IS_ERR(desc)) {
dev_err(chip->parent,
@@ -1565,6 +1577,19 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] __initconst = {
.ignore_wake = "INT33FF:01@0",
},
},
+ {
+ /*
+ * On the Xiaomi Mi Pad 2 we use native battery drivers, disable
+ * the _AEI entry for the fuel-gauge IRQ.
+ */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
+ },
+ .driver_data = &(struct acpi_gpiolib_dmi_quirk) {
+ .ignore = "INT33FF:03@52",
+ },
+ },
{} /* Terminating entry */
};
@@ -1587,6 +1612,9 @@ static int __init acpi_gpio_setup_params(void)
if (ignore_wake == NULL && quirk && quirk->ignore_wake)
ignore_wake = quirk->ignore_wake;
+ if (ignore == NULL && quirk && quirk->ignore)
+ ignore = quirk->ignore;
+
return 0;
}
--
2.31.1
Powered by blists - more mailing lists