All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Lee Jones <lee@kernel.org>, Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Thomas Gleixner <tglx@kernel.org>,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: [PATCH] mfd: wm8994: remove dead legacy-gpio code
Date: Mon, 27 Apr 2026 16:34:27 +0200	[thread overview]
Message-ID: <20260427143437.3059210-1-arnd@kernel.org> (raw)

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.

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
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


             reply	other threads:[~2026-04-27 14:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 14:34 Arnd Bergmann [this message]
2026-04-30 11:17 ` [PATCH] mfd: wm8994: remove dead legacy-gpio code Linus Walleij
2026-04-30 12:06 ` Charles Keepax
2026-05-07 19:46 ` (subset) " 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=20260427143437.3059210-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@kernel.org \
    --cc=jirislaby@kernel.org \
    --cc=lee@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=tglx@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.