From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.12.y 1/7] gpiolib: acpi: Switch to use enum in acpi_gpio_in_ignore_list()
Date: Wed, 31 Dec 2025 09:32:12 -0500 [thread overview]
Message-ID: <20251231143218.3042757-1-sashal@kernel.org> (raw)
In-Reply-To: <2025122946-rotunda-passenger-2915@gregkh>
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ Upstream commit b24fd5bc8e6d6b6006db65b5956c2c2cd0ee5a7b ]
Switch to use enum instead of pointers in acpi_gpio_in_ignore_list()
which moves towards isolating the GPIO ACPI and quirk APIs. It will
helps splitting them completely in the next changes.
No functional changes.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Stable-dep-of: 2d967310c49e ("gpiolib: acpi: Add quirk for Dell Precision 7780")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib-acpi.c | 21 ++++++++++++++++-----
drivers/gpio/gpiolib-acpi.h | 8 ++++++++
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 148b4d1788a2..6b6f6a82b82d 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -350,14 +350,25 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
return desc;
}
-static bool acpi_gpio_in_ignore_list(const char *ignore_list, const char *controller_in,
- unsigned int pin_in)
+bool acpi_gpio_in_ignore_list(enum acpi_gpio_ignore_list list, const char *controller_in,
+ unsigned int pin_in)
{
- const char *controller, *pin_str;
+ const char *ignore_list, *controller, *pin_str;
unsigned int pin;
char *endp;
int len;
+ switch (list) {
+ case ACPI_GPIO_IGNORE_WAKE:
+ ignore_list = ignore_wake;
+ break;
+ case ACPI_GPIO_IGNORE_INTERRUPT:
+ ignore_list = ignore_interrupt;
+ break;
+ default:
+ return false;
+ }
+
controller = ignore_list;
while (controller) {
pin_str = strchr(controller, '@');
@@ -394,7 +405,7 @@ static bool acpi_gpio_irq_is_wake(struct device *parent,
if (agpio->wake_capable != ACPI_WAKE_CAPABLE)
return false;
- if (acpi_gpio_in_ignore_list(ignore_wake, dev_name(parent), pin)) {
+ if (acpi_gpio_in_ignore_list(ACPI_GPIO_IGNORE_WAKE, dev_name(parent), pin)) {
dev_info(parent, "Ignoring wakeup on pin %u\n", pin);
return false;
}
@@ -437,7 +448,7 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
if (!handler)
return AE_OK;
- if (acpi_gpio_in_ignore_list(ignore_interrupt, dev_name(chip->parent), pin)) {
+ if (acpi_gpio_in_ignore_list(ACPI_GPIO_IGNORE_INTERRUPT, dev_name(chip->parent), pin)) {
dev_info(chip->parent, "Ignoring interrupt on pin %u\n", pin);
return AE_OK;
}
diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h
index 7e1c51d04040..ef0b1a3c85d7 100644
--- a/drivers/gpio/gpiolib-acpi.h
+++ b/drivers/gpio/gpiolib-acpi.h
@@ -58,4 +58,12 @@ static inline int acpi_gpio_count(const struct fwnode_handle *fwnode,
}
#endif
+enum acpi_gpio_ignore_list {
+ ACPI_GPIO_IGNORE_WAKE,
+ ACPI_GPIO_IGNORE_INTERRUPT,
+};
+
+bool acpi_gpio_in_ignore_list(enum acpi_gpio_ignore_list list,
+ const char *controller_in, unsigned int pin_in);
+
#endif /* GPIOLIB_ACPI_H */
--
2.51.0
next prev parent reply other threads:[~2025-12-31 14:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-29 14:34 FAILED: patch "[PATCH] gpiolib: acpi: Add quirk for Dell Precision 7780" failed to apply to 6.12-stable tree gregkh
2025-12-31 14:32 ` Sasha Levin [this message]
2025-12-31 14:32 ` [PATCH 6.12.y 2/7] gpiolib: acpi: Handle deferred list via new API Sasha Levin
2025-12-31 14:32 ` [PATCH 6.12.y 3/7] gpiolib: acpi: Add acpi_gpio_need_run_edge_events_on_boot() getter Sasha Levin
2025-12-31 14:32 ` [PATCH 6.12.y 4/7] gpiolib: acpi: Move quirks to a separate file Sasha Levin
2025-12-31 14:32 ` [PATCH 6.12.y 5/7] gpiolib: acpi: Add a quirk for Acer Nitro V15 Sasha Levin
2025-12-31 14:32 ` [PATCH 6.12.y 6/7] gpiolib: acpi: Add quirk for ASUS ProArt PX13 Sasha Levin
2025-12-31 14:32 ` [PATCH 6.12.y 7/7] gpiolib: acpi: Add quirk for Dell Precision 7780 Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251231143218.3042757-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=mika.westerberg@linux.intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.