Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216360/?format=api
{ "id": 2216360, "url": "http://patchwork.ozlabs.org/api/patches/2216360/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260326-mfd-arizona-irq-v4-2-50c47ed0a18e@kernel.org/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260326-mfd-arizona-irq-v4-2-50c47ed0a18e@kernel.org>", "list_archive_url": null, "date": "2026-03-26T10:51:12", "name": "[v4,2/2] mfd: arizona: Convert GPIO IRQ handling to descriptors", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "07d35bae41310992c8cae4f75ab460d21adf8558", "submitter": { "id": 92050, "url": "http://patchwork.ozlabs.org/api/people/92050/?format=api", "name": "Linus Walleij", "email": "linusw@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260326-mfd-arizona-irq-v4-2-50c47ed0a18e@kernel.org/mbox/", "series": [ { "id": 497567, "url": "http://patchwork.ozlabs.org/api/series/497567/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=497567", "date": "2026-03-26T10:51:10", "name": "mfd: arizona: Move IRQ GPIO to GPIO descriptor", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/497567/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216360/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216360/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-gpio+bounces-34203-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=CPJIWRgp;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34203-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"CPJIWRgp\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhLZg0Q3Vz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 22:07:07 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id CC1193214A83\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 10:56:51 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 15EF43E3DB1;\n\tThu, 26 Mar 2026 10:51:21 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id CCEF73DDDD3;\n\tThu, 26 Mar 2026 10:51:20 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 7CA4AC116C6;\n\tThu, 26 Mar 2026 10:51:18 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774522280; cv=none;\n b=c7VV6mTM/7RUyOpX8oplHf4/4D18/+jjcnDP3Qb5AD1bMAJ4o4xa6g/bZcNwxME5HwCcyCYAKiB6iWoDZ+im2Gki+i9rsrwl3mfxc3yO9oHcoMHM+LghEDjzWExGo1Q1nF9dY7Rb+IAq8Vppv+q1xBtmxm0my3BaRAQyI7L7da4=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774522280; c=relaxed/simple;\n\tbh=u6EZGlMh29IsIeDQA19WFLVtpE5oyFCv9a5xoycxBUI=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=RL9L6bz1Ixwb8TRjJdMUEJsDM8opy+UoNbXDyjMblZnfUesNYKsBhBUcMIH/VkLp+cdy+kIs6ozYy+vmr1iYRkIkS26gYeyLB29G8wDrsM5rYhssaQYA+VhOmL1heN7eDmTKA+jC8LCn78LoUbhHWpUSUvpTnJgmOA+oP9FUY2k=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=CPJIWRgp; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774522280;\n\tbh=u6EZGlMh29IsIeDQA19WFLVtpE5oyFCv9a5xoycxBUI=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=CPJIWRgppRweaVYOahHej5lq9M383F3uuff0aKKodezrDAXutUsHUymx+mOio1QJ1\n\t PAiak9q4Ceukp0VbvwT9uph3n1OIvR+ZchbEgBXYlroCvo6eZiS6DovFAk3JKyuQCN\n\t 1y74gfYaHqbqsHxTnNdQPkscr/WIdnbkSCfwxug2zuf90BdyYzabM7DsFcLHHOS6gB\n\t c/FcrUxKgbxFW4W3G6prq01j8mZdyn1fJ4jcxhsXbKkIueYUseKYGLYn+I3liSHdih\n\t r/AqNwnykFbzfIlcEKuAkvyGiqHP/dGsDGO7M/eI+iAm5YufNMNysGJ2c9DAJafLqK\n\t ERUFUQG9KgUhA==", "From": "Linus Walleij <linusw@kernel.org>", "Date": "Thu, 26 Mar 2026 11:51:12 +0100", "Subject": "[PATCH v4 2/2] mfd: arizona: Convert GPIO IRQ handling to\n descriptors", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20260326-mfd-arizona-irq-v4-2-50c47ed0a18e@kernel.org>", "References": "<20260326-mfd-arizona-irq-v4-0-50c47ed0a18e@kernel.org>", "In-Reply-To": "<20260326-mfd-arizona-irq-v4-0-50c47ed0a18e@kernel.org>", "To": "Lee Jones <lee@kernel.org>, Bartosz Golaszewski <brgl@kernel.org>,\n Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,\n Conor Dooley <conor+dt@kernel.org>,\n Charles Keepax <ckeepax@opensource.cirrus.com>", "Cc": "patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,\n linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,\n Linus Walleij <linusw@kernel.org>", "X-Mailer": "b4 0.14.3" }, "content": "Convert the arizona polling GPIO handling to use a GPIO descriptor\ninstead of passing a global GPIO number as platform data.\n\nThis mechanism is not used in the kernel, but let's preserve\nthe mechanism to be nice.\n\nUsers can define \"irq-gpios\" in the devicetree or software node\nfor the Arizona chip to provide the GPIO line corresponding to\nthe IRQ.\n\nReviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>\nSigned-off-by: Linus Walleij <linusw@kernel.org>\n---\n drivers/mfd/arizona-irq.c | 46 +++++++++++++++++++--------------------\n include/linux/mfd/arizona/core.h | 2 ++\n include/linux/mfd/arizona/pdata.h | 5 -----\n 3 files changed, 24 insertions(+), 29 deletions(-)", "diff": "diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c\nindex 544016d420fe..8b752a1257b1 100644\n--- a/drivers/mfd/arizona-irq.c\n+++ b/drivers/mfd/arizona-irq.c\n@@ -136,21 +136,19 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)\n \t\t\tdev_err(arizona->dev,\n \t\t\t\t\"Failed to read main IRQ status: %d\\n\", ret);\n \t\t}\n-#ifdef CONFIG_GPIOLIB_LEGACY\n \t\t/*\n \t\t * Poll the IRQ pin status to see if we're really done\n \t\t * if the interrupt controller can't do it for us.\n \t\t */\n-\t\tif (!arizona->pdata.irq_gpio) {\n+\t\tif (!arizona->irq_gpiod) {\n \t\t\tbreak;\n \t\t} else if (arizona->pdata.irq_flags & IRQF_TRIGGER_RISING &&\n-\t\t\t gpio_get_value_cansleep(arizona->pdata.irq_gpio)) {\n+\t\t\t gpiod_get_value_cansleep(arizona->irq_gpiod)) {\n \t\t\tpoll = true;\n \t\t} else if (arizona->pdata.irq_flags & IRQF_TRIGGER_FALLING &&\n-\t\t\t !gpio_get_value_cansleep(arizona->pdata.irq_gpio)) {\n+\t\t\t !gpiod_get_value_cansleep(arizona->irq_gpiod)) {\n \t\t\tpoll = true;\n \t\t}\n-#endif\n \t} while (poll);\n \n \tpm_runtime_put_autosuspend(arizona->dev);\n@@ -350,27 +348,26 @@ int arizona_irq_init(struct arizona *arizona)\n \t\tgoto err_map_main_irq;\n \t}\n \n-#ifdef CONFIG_GPIOLIB_LEGACY\n-\t/* Used to emulate edge trigger and to work around broken pinmux */\n-\tif (arizona->pdata.irq_gpio) {\n-\t\tif (gpio_to_irq(arizona->pdata.irq_gpio) != arizona->irq) {\n-\t\t\tdev_warn(arizona->dev, \"IRQ %d is not GPIO %d (%d)\\n\",\n-\t\t\t\t arizona->irq, arizona->pdata.irq_gpio,\n-\t\t\t\t gpio_to_irq(arizona->pdata.irq_gpio));\n-\t\t\tarizona->irq = gpio_to_irq(arizona->pdata.irq_gpio);\n-\t\t}\n-\n-\t\tret = devm_gpio_request_one(arizona->dev,\n-\t\t\t\t\t arizona->pdata.irq_gpio,\n-\t\t\t\t\t GPIOF_IN, \"arizona IRQ\");\n-\t\tif (ret != 0) {\n-\t\t\tdev_err(arizona->dev,\n-\t\t\t\t\"Failed to request IRQ GPIO %d:: %d\\n\",\n-\t\t\t\tarizona->pdata.irq_gpio, ret);\n-\t\t\tarizona->pdata.irq_gpio = 0;\n+\t/*\n+\t * Used to emulate edge trigger and to work around broken pinmux\n+\t * define \"irq-gpios\" in device tree or software node.\n+\t */\n+\tarizona->irq_gpiod = devm_gpiod_get_optional(arizona->dev, \"irq\",\n+\t\t\t\t\t\t GPIOD_IN);\n+\tif (IS_ERR(arizona->irq_gpiod)) {\n+\t\tret = dev_err_probe(arizona->dev,\n+\t\t\t\t PTR_ERR(arizona->irq_gpiod),\n+\t\t\t\t \"error getting IRQ GPIO\\n\");\n+\t\tgoto err_irq_gpiod;\n+\t}\n+\tif (arizona->irq_gpiod) {\n+\t\tif (gpiod_to_irq(arizona->irq_gpiod) != arizona->irq) {\n+\t\t\tdev_warn(arizona->dev, \"IRQ %d does not match GPIO's IRQ %d\\n\",\n+\t\t\t\t arizona->irq, gpiod_to_irq(arizona->irq_gpiod));\n+\t\t\tarizona->irq = gpiod_to_irq(arizona->irq_gpiod);\n \t\t}\n+\t\tgpiod_set_consumer_name(arizona->irq_gpiod, \"arizona IRQ\");\n \t}\n-#endif\n \n \tret = request_threaded_irq(arizona->irq, NULL, arizona_irq_thread,\n \t\t\t\t flags, \"arizona\", arizona);\n@@ -409,6 +406,7 @@ int arizona_irq_init(struct arizona *arizona)\n \tarizona_free_irq(arizona, ARIZONA_IRQ_BOOT_DONE, arizona);\n err_boot_done:\n \tfree_irq(arizona->irq, arizona);\n+err_irq_gpiod:\n err_main_irq:\n \tregmap_del_irq_chip(irq_find_mapping(arizona->virq,\n \t\t\t\t\t ARIZONA_MAIN_IRQ_INDEX),\ndiff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h\nindex 6d6f96b2b29f..7129651c9af6 100644\n--- a/include/linux/mfd/arizona/core.h\n+++ b/include/linux/mfd/arizona/core.h\n@@ -11,6 +11,7 @@\n #define _WM_ARIZONA_CORE_H\n \n #include <linux/clk.h>\n+#include <linux/gpio/consumer.h>\n #include <linux/interrupt.h>\n #include <linux/notifier.h>\n #include <linux/regmap.h>\n@@ -136,6 +137,7 @@ struct arizona {\n \tstruct irq_domain *virq;\n \tstruct regmap_irq_chip_data *aod_irq_chip;\n \tstruct regmap_irq_chip_data *irq_chip;\n+\tstruct gpio_desc *irq_gpiod;\n \n \tbool hpdet_clamp;\n \tunsigned int hp_ena;\ndiff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h\nindex f72e6d4b14a7..20118bad869a 100644\n--- a/include/linux/mfd/arizona/pdata.h\n+++ b/include/linux/mfd/arizona/pdata.h\n@@ -188,11 +188,6 @@ struct arizona_pdata {\n \t/** Haptic actuator type */\n \tunsigned int hap_act;\n \n-#ifdef CONFIG_GPIOLIB_LEGACY\n-\t/** GPIO for primary IRQ (used for edge triggered emulation) */\n-\tint irq_gpio;\n-#endif\n-\n \t/** General purpose switch control */\n \tunsigned int gpsw;\n };\n", "prefixes": [ "v4", "2/2" ] }