From: Arnd Bergmann <arnd@kernel.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, Lee Jones <lee@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Thomas Gleixner <tglx@linutronix.de>,
"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
patches@opensource.cirrus.com, linux-kernel@vger.kernel.org
Subject: [PATCH 07/21] mfd: wm8994: remove dead legacy-gpio code
Date: Fri, 8 Aug 2025 17:17:51 +0200 [thread overview]
Message-ID: <20250808151822.536879-8-arnd@kernel.org> (raw)
In-Reply-To: <20250808151822.536879-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
The old-style gpio handling in wm8994 came from a commit 7c8844481a1c
("mfd: wm8994: Emulate level triggered interrupts if required") in
linux-3.11, but nothing in the kernel ever set the 'irq_gpio' member
in the wm8994_pdata structure, so this was always dead code.
Remove it now to reduce the dependency on the legacy gpio interfaces.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mfd/wm8994-irq.c | 94 ++------------------------------
include/linux/mfd/wm8994/pdata.h | 5 --
2 files changed, 4 insertions(+), 95 deletions(-)
diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c
index 1475b1ac6983..a46cea948763 100644
--- a/drivers/mfd/wm8994-irq.c
+++ b/drivers/mfd/wm8994-irq.c
@@ -135,53 +135,9 @@ static const struct regmap_irq_chip wm8994_irq_chip = {
.runtime_pm = true,
};
-static void wm8994_edge_irq_enable(struct irq_data *data)
-{
-}
-
-static void wm8994_edge_irq_disable(struct irq_data *data)
-{
-}
-
-static struct irq_chip wm8994_edge_irq_chip = {
- .name = "wm8994_edge",
- .irq_disable = wm8994_edge_irq_disable,
- .irq_enable = wm8994_edge_irq_enable,
-};
-
-static irqreturn_t wm8994_edge_irq(int irq, void *data)
-{
- struct wm8994 *wm8994 = data;
-
- while (gpio_get_value_cansleep(wm8994->pdata.irq_gpio))
- handle_nested_irq(irq_find_mapping(wm8994->edge_irq, 0));
-
- return IRQ_HANDLED;
-}
-
-static int wm8994_edge_irq_map(struct irq_domain *h, unsigned int virq,
- irq_hw_number_t hw)
-{
- struct wm8994 *wm8994 = h->host_data;
-
- irq_set_chip_data(virq, wm8994);
- irq_set_chip_and_handler(virq, &wm8994_edge_irq_chip, handle_edge_irq);
- irq_set_nested_thread(virq, 1);
- irq_set_noprobe(virq);
-
- return 0;
-}
-
-static const struct irq_domain_ops wm8994_edge_irq_ops = {
- .map = wm8994_edge_irq_map,
- .xlate = irq_domain_xlate_twocell,
-};
-
int wm8994_irq_init(struct wm8994 *wm8994)
{
int ret;
- unsigned long irqflags;
- struct wm8994_pdata *pdata = &wm8994->pdata;
if (!wm8994->irq) {
dev_warn(wm8994->dev,
@@ -190,53 +146,11 @@ int wm8994_irq_init(struct wm8994 *wm8994)
return 0;
}
- /* select user or default irq flags */
- irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
- if (pdata->irq_flags)
- irqflags = pdata->irq_flags;
-
/* use a GPIO for edge triggered controllers */
- if (irqflags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
- if (gpio_to_irq(pdata->irq_gpio) != wm8994->irq) {
- dev_warn(wm8994->dev, "IRQ %d is not GPIO %d (%d)\n",
- wm8994->irq, pdata->irq_gpio,
- gpio_to_irq(pdata->irq_gpio));
- wm8994->irq = gpio_to_irq(pdata->irq_gpio);
- }
-
- ret = devm_gpio_request_one(wm8994->dev, pdata->irq_gpio,
- GPIOF_IN, "WM8994 IRQ");
-
- if (ret != 0) {
- dev_err(wm8994->dev, "Failed to get IRQ GPIO: %d\n",
- ret);
- return ret;
- }
-
- wm8994->edge_irq = irq_domain_create_linear(NULL, 1, &wm8994_edge_irq_ops, wm8994);
-
- ret = regmap_add_irq_chip(wm8994->regmap,
- irq_create_mapping(wm8994->edge_irq,
- 0),
- IRQF_ONESHOT,
- wm8994->irq_base, &wm8994_irq_chip,
- &wm8994->irq_data);
- if (ret != 0) {
- dev_err(wm8994->dev, "Failed to get IRQ: %d\n",
- ret);
- return ret;
- }
-
- ret = request_threaded_irq(wm8994->irq,
- NULL, wm8994_edge_irq,
- irqflags,
- "WM8994 edge", wm8994);
- } else {
- ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq,
- irqflags,
- wm8994->irq_base, &wm8994_irq_chip,
- &wm8994->irq_data);
- }
+ ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq,
+ IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+ wm8994->irq_base, &wm8994_irq_chip,
+ &wm8994->irq_data);
if (ret != 0) {
dev_err(wm8994->dev, "Failed to register IRQ chip: %d\n", ret);
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 6e2962ef5b81..b95a56a338c3 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -226,11 +226,6 @@ struct wm8994_pdata {
* lines is mastered.
*/
int max_channels_clocked[WM8994_NUM_AIF];
-
- /**
- * GPIO for the IRQ pin if host only supports edge triggering
- */
- int irq_gpio;
};
#endif
--
2.39.5
next prev parent reply other threads:[~2025-08-08 15:21 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 15:17 [PATCH 00/21] gpiolib: fence off legacy interfaces Arnd Bergmann
2025-08-08 15:17 ` [PATCH 01/21] ARM: select legacy gpiolib interfaces where used Arnd Bergmann
2025-08-11 8:49 ` Krzysztof Kozlowski
2025-08-08 15:17 ` [PATCH 02/21] m68k: coldfire: select legacy gpiolib interface for mcfqspi Arnd Bergmann
2025-08-08 15:17 ` [PATCH 03/21] mips: select legacy gpiolib interfaces where used Arnd Bergmann
2025-08-08 15:17 ` [PATCH 04/21] sh: select legacy gpiolib interface Arnd Bergmann
2025-08-12 18:28 ` Rob Landley
2025-08-12 21:28 ` Arnd Bergmann
2025-08-08 15:17 ` [PATCH 05/21] x86/platform: select legacy gpiolib interfaces where used Arnd Bergmann
2025-08-09 10:00 ` Andy Shevchenko
2025-08-09 19:44 ` Arnd Bergmann
2025-08-10 15:12 ` Hans de Goede
2025-08-11 2:27 ` Dmitry Torokhov
2025-08-08 15:17 ` [PATCH 06/21] x86/olpc: select GPIOLIB_LEGACY Arnd Bergmann
2025-08-12 17:01 ` Borislav Petkov
2025-08-08 15:17 ` Arnd Bergmann [this message]
2025-08-11 13:14 ` [PATCH 07/21] mfd: wm8994: remove dead legacy-gpio code Bartosz Golaszewski
2025-08-08 15:17 ` [PATCH 08/21] ASoC: add GPIOLIB_LEGACY dependency where needed Arnd Bergmann
2025-08-08 15:17 ` [PATCH 09/21] input: gpio-keys: make legacy gpiolib optional Arnd Bergmann
2025-08-11 10:34 ` Matti Vaittinen
2025-08-11 12:52 ` Andy Shevchenko
2025-08-11 19:21 ` Dmitry Torokhov
2025-08-11 20:09 ` Andy Shevchenko
2025-08-12 5:11 ` Matti Vaittinen
2025-08-08 15:17 ` [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional Arnd Bergmann
2025-08-18 15:37 ` Linus Walleij
2025-08-19 12:19 ` Lee Jones
2025-08-19 12:59 ` Arnd Bergmann
2025-08-20 7:16 ` Lee Jones
2025-08-20 12:00 ` Arnd Bergmann
2025-08-20 13:15 ` Andy Shevchenko
2025-08-20 13:15 ` Andy Shevchenko
2025-08-08 15:17 ` [PATCH 11/21] media: em28xx: add special case for legacy gpiolib interface Arnd Bergmann
2025-08-08 15:17 ` [PATCH 12/21] mfd: arizona: make legacy gpiolib interface optional Arnd Bergmann
2025-09-02 12:44 ` Lee Jones
2025-09-02 13:47 ` Arnd Bergmann
2025-09-03 8:05 ` Lee Jones
2025-09-03 9:26 ` Arnd Bergmann
2025-08-08 15:17 ` [PATCH 13/21] mfd: si476x: add GPIOLIB_LEGACY dependency Arnd Bergmann
2025-08-08 15:17 ` [PATCH 14/21] mfd: aat2870: " Arnd Bergmann
2025-08-08 15:17 ` [PATCH 15/21] dsa: b53: hide legacy gpiolib usage on non-mips Arnd Bergmann
2025-08-09 10:01 ` Jonas Gorski
2025-08-09 20:55 ` Arnd Bergmann
2025-08-08 15:18 ` [PATCH 16/21] ath10k: remove gpio number assignment Arnd Bergmann
2025-08-08 15:18 ` [PATCH 17/21] nfc: marvell: convert to gpio descriptors Arnd Bergmann
2025-08-09 10:09 ` Andy Shevchenko
2025-08-11 21:43 ` Dmitry Torokhov
2025-08-13 12:35 ` Andy Shevchenko
2025-08-11 7:49 ` Bartosz Golaszewski
2025-08-13 7:48 ` Krzysztof Kozlowski
2025-08-08 15:18 ` [PATCH 18/21] nfc: s3fwrn5: " Arnd Bergmann
2025-08-11 22:08 ` Dmitry Torokhov
2025-08-08 15:18 ` [PATCH 19/21] usb: udc: pxa: remove unused platform_data Arnd Bergmann
2025-08-09 10:15 ` Andy Shevchenko
2025-08-11 22:12 ` Dmitry Torokhov
2025-08-08 15:18 ` [PATCH 20/21] ASoC: pxa: add GPIOLIB_LEGACY dependency Arnd Bergmann
2025-08-08 15:18 ` [PATCH 21/21] gpiolib: turn off legacy interface by default Arnd Bergmann
2025-08-09 10:18 ` Andy Shevchenko
2025-08-09 19:47 ` Arnd Bergmann
2025-08-11 12:49 ` Andy Shevchenko
2025-08-11 13:10 ` [PATCH 00/21] gpiolib: fence off legacy interfaces Bartosz Golaszewski
2025-08-12 16:23 ` (subset) " Mark Brown
2025-09-02 12:56 ` Lee Jones
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=20250808151822.536879-8-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=brgl@bgdev.pl \
--cc=jirislaby@kernel.org \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=tglx@linutronix.de \
/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 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).