From nobody Mon Jun 8 18:57:47 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1587540B6D2; Wed, 27 May 2026 13:05:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779887127; cv=none; b=sc4I9fbOQjzydR1pmFnyAe+smUryOyuo1ZmhksEgqiAZ5i0Pr3psse9XK5T0s3ixyMuf+yWKiec/m41CNRkYGq7pQ02wtuuu3zHHV4OZs8geGsZmWvFctFGgPzLME7s+1muMd7kKc3AlY60fugXaydUN3T7mE6GMVuY0HR2xU4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779887127; c=relaxed/simple; bh=0X0szkG5yLiMj09IJZBb45Om8c4jwNps5B8juTZM4wQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nSuPOQP6VOLtbhcSVVfczBrGT0jKfqzv49Pe2bSyYRXAnYeqNf86+eB+BA4DELFaVkqFgLtS5s417j3lHfh9mWoEOJzIkevoijDq+r6MHaeq+MmdNaiSOiLmx1RWMK1qkJAlWwfIRJOtUdDPUdSn1AD3AoTDwAmhrtDgP887kUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P3ML7YFu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P3ML7YFu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FED31F00A3C; Wed, 27 May 2026 13:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779887125; bh=vpmrGvI+S9mqjhJ6dDecf+d4FxN+jhtGetmts2ZTPoY=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=P3ML7YFujcE1TmHDbPRTwHG1NpmQNeQtubntOuyO+9jWoAfnUu8zRM6H+hI0dWRhk rxRKrub2GqeHBbqhiFgjCMvf11d5UR1FQuO+w268CfezPE34CPNYGOEMk9wY+05412 aFGQGYfRc06kTJoS05NJa9ADe4uBGiiS9LYRNd2/5tsJAYm/q4AueIJ8cVkHYOsU+z DYBGGvNCzgZ4H+VwYjKaSw1a0b47/aLG0c1f31mXXhLu/TJEmDMWNWe6jgQgcrU+dW DlRtRI+Aevqt22BisFaNQw6FmoKsPW+8Ir07hrmSc869vEGKX5VTBAA/gy6/+lDPsq gyRU5MIxzSy/g== From: Linus Walleij Date: Wed, 27 May 2026 15:05:16 +0200 Subject: [PATCH v5 1/2] dt-bindings: mfd: wlf,arizona: Add irq-gpios Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260527-mfd-arizona-irq-v5-1-ebeda2e925da@kernel.org> References: <20260527-mfd-arizona-irq-v5-0-ebeda2e925da@kernel.org> In-Reply-To: <20260527-mfd-arizona-irq-v5-0-ebeda2e925da@kernel.org> To: Lee Jones , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Charles Keepax Cc: patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Conor Dooley , Bartosz Golaszewski X-Mailer: b4 0.15.2 The Wolfson Microelectronics Arizona sometimes needs to poll the GPIO line corresponding to the IRQ to counter bugs in the hardware that appear on edge-triggered IRQs. For this situation, provide the optional irq-gpios property. Acked-by: Conor Dooley Reviewed-by: Charles Keepax Reviewed-by: Bartosz Golaszewski Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/mfd/wlf,arizona.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/wlf,arizona.yaml b/Docum= entation/devicetree/bindings/mfd/wlf,arizona.yaml index 7902f3c5d289..359e40b3dacb 100644 --- a/Documentation/devicetree/bindings/mfd/wlf,arizona.yaml +++ b/Documentation/devicetree/bindings/mfd/wlf,arizona.yaml @@ -194,6 +194,16 @@ properties: reset-gpios: maxItems: 1 =20 + irq-gpios: + maxItems: 1 + description: + A functional IRQ should be provided in the interrupts + property. This property enables edge triggered IRQ emulation + for hosts that don't support the codecs level triggered IRQ + output. The GPIO line corresponding to the IRQ will be polled + until all IRQs have been handled, ensuring an edge is generated + for the next IRQ. + wlf,reset: description: GPIO specifier for the GPIO controlling RESET --=20 2.54.0 From nobody Mon Jun 8 18:57:47 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A3E840C5CC; Wed, 27 May 2026 13:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779887130; cv=none; b=JRZtWusAbwXBoF8bitdLdhartvTqr3RQF/mJc70FgwGO5N4IsLfDmn36lOGIRD1K2D8eKhDR/sqsc1BIUT+bvDbAonWjttsUsaSXq4HehDLNAY0JX2I400Ruezx3Mb5XsBLM5McMy1vqqrjGAoetbaNzLfuNIiReKMpZ5nTK/xQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779887130; c=relaxed/simple; bh=p8ecWyRncMPcGe+3/f4BVz47AqFWY/j6H2zjImhf72A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oCRaU1squCS8Y2gjIDSoSgJL73u0aPFAYksIBRxYeoG0gF1Tft9w6ZRBOGNt2KcND1NfJxCaLd0I/jG5UVwoFnZzcwzaQYlYJDWrL8w0NEtbG7fne3sBZAX661djPcsYh2MNgUCjlJp3N0XCPyueGDPSI93PVVBI8mzoM1Nkbd4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m2h1ng5T; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m2h1ng5T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71ED31F00A3A; Wed, 27 May 2026 13:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779887129; bh=lLQv8H71OHeKYkoMQOaGRtmNZqYzRq0dXYVUq94IW2Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=m2h1ng5TT1zfgfuEOAa/nBa8xyhDHA3cugeuJ+lS0QdFohuJdsp91xbmrpbESOZ2j aSFwrr0ucmVw4t8/mimjGBo5AdeFxou6CGEy7yae4vAcaUsVD20UhjBY5spkSd2ekQ aVZDhM7Fce6xw1hZ3T/oiHk9b3NzO93DFUuDduGJdGtCfN6qBsZRjMUs5cZkL7m7uv /1jzeDunqp3a/yT36D5ndFVjnOkzI9FxBEhhVtYmk4DfvK8AahV65dKVBBrNSULB8u J3nRhKGMN5Hvi39dUjlOQdWqvxj6n8LdtR1ZgRwynegPcENYCV0v1oQ5BvX7xzfNEB Cn9PsIHLwFJPw== From: Linus Walleij Date: Wed, 27 May 2026 15:05:17 +0200 Subject: [PATCH v5 2/2] mfd: arizona: Convert GPIO IRQ handling to descriptors Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260527-mfd-arizona-irq-v5-2-ebeda2e925da@kernel.org> References: <20260527-mfd-arizona-irq-v5-0-ebeda2e925da@kernel.org> In-Reply-To: <20260527-mfd-arizona-irq-v5-0-ebeda2e925da@kernel.org> To: Lee Jones , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Charles Keepax Cc: patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Bartosz Golaszewski X-Mailer: b4 0.15.2 Convert the arizona polling GPIO handling to use a GPIO descriptor instead of passing a global GPIO number as platform data. This mechanism is not used in the kernel, but let's preserve the mechanism to be nice. Users can define "irq-gpios" in the devicetree or software node for the Arizona chip to provide the GPIO line corresponding to the IRQ. Reviewed-by: Charles Keepax Reviewed-by: Bartosz Golaszewski Signed-off-by: Linus Walleij --- drivers/mfd/arizona-irq.c | 50 +++++++++++++++++++++--------------= ---- include/linux/mfd/arizona/core.h | 2 ++ include/linux/mfd/arizona/pdata.h | 5 ---- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index 544016d420fe..cf8e42662585 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c @@ -136,21 +136,19 @@ static irqreturn_t arizona_irq_thread(int irq, void *= data) dev_err(arizona->dev, "Failed to read main IRQ status: %d\n", ret); } -#ifdef CONFIG_GPIOLIB_LEGACY /* * Poll the IRQ pin status to see if we're really done * if the interrupt controller can't do it for us. */ - if (!arizona->pdata.irq_gpio) { + if (!arizona->irq_gpiod) { break; } else if (arizona->pdata.irq_flags & IRQF_TRIGGER_RISING && - gpio_get_value_cansleep(arizona->pdata.irq_gpio)) { + gpiod_get_value_cansleep(arizona->irq_gpiod)) { poll =3D true; } else if (arizona->pdata.irq_flags & IRQF_TRIGGER_FALLING && - !gpio_get_value_cansleep(arizona->pdata.irq_gpio)) { + !gpiod_get_value_cansleep(arizona->irq_gpiod)) { poll =3D true; } -#endif } while (poll); =20 pm_runtime_put_autosuspend(arizona->dev); @@ -210,6 +208,7 @@ int arizona_irq_init(struct arizona *arizona) const struct regmap_irq_chip *aod, *irq; struct irq_data *irq_data; unsigned int virq; + int gpio_irq; =20 arizona->ctrlif_error =3D true; =20 @@ -350,27 +349,32 @@ int arizona_irq_init(struct arizona *arizona) goto err_map_main_irq; } =20 -#ifdef CONFIG_GPIOLIB_LEGACY - /* Used to emulate edge trigger and to work around broken pinmux */ - if (arizona->pdata.irq_gpio) { - if (gpio_to_irq(arizona->pdata.irq_gpio) !=3D arizona->irq) { - dev_warn(arizona->dev, "IRQ %d is not GPIO %d (%d)\n", - arizona->irq, arizona->pdata.irq_gpio, - gpio_to_irq(arizona->pdata.irq_gpio)); - arizona->irq =3D gpio_to_irq(arizona->pdata.irq_gpio); + /* + * Used to emulate edge trigger and to work around broken pinmux + * define "irq-gpios" in device tree or software node. + */ + arizona->irq_gpiod =3D devm_gpiod_get_optional(arizona->dev, "irq", + GPIOD_IN); + if (IS_ERR(arizona->irq_gpiod)) { + ret =3D dev_err_probe(arizona->dev, + PTR_ERR(arizona->irq_gpiod), + "Error getting IRQ GPIO\n"); + goto err_main_irq; + } + if (arizona->irq_gpiod) { + gpio_irq =3D gpiod_to_irq(arizona->irq_gpiod); + if (gpio_irq < 0) { + ret =3D dev_err_probe(arizona->dev, gpio_irq, + "GPIO IRQ line is invalid\n"); + goto err_main_irq; } - - ret =3D devm_gpio_request_one(arizona->dev, - arizona->pdata.irq_gpio, - GPIOF_IN, "arizona IRQ"); - if (ret !=3D 0) { - dev_err(arizona->dev, - "Failed to request IRQ GPIO %d:: %d\n", - arizona->pdata.irq_gpio, ret); - arizona->pdata.irq_gpio =3D 0; + if (gpio_irq !=3D arizona->irq) { + dev_warn(arizona->dev, "IRQ %d does not match GPIO's IRQ %d\n", + arizona->irq, gpio_irq); + arizona->irq =3D gpio_irq; } + gpiod_set_consumer_name(arizona->irq_gpiod, "arizona IRQ"); } -#endif =20 ret =3D request_threaded_irq(arizona->irq, NULL, arizona_irq_thread, flags, "arizona", arizona); diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/c= ore.h index 6d6f96b2b29f..7129651c9af6 100644 --- a/include/linux/mfd/arizona/core.h +++ b/include/linux/mfd/arizona/core.h @@ -11,6 +11,7 @@ #define _WM_ARIZONA_CORE_H =20 #include +#include #include #include #include @@ -136,6 +137,7 @@ struct arizona { struct irq_domain *virq; struct regmap_irq_chip_data *aod_irq_chip; struct regmap_irq_chip_data *irq_chip; + struct gpio_desc *irq_gpiod; =20 bool hpdet_clamp; unsigned int hp_ena; diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/= pdata.h index d465dcd8c90a..2f980d51cdfa 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h @@ -178,11 +178,6 @@ struct arizona_pdata { /** Haptic actuator type */ unsigned int hap_act; =20 -#ifdef CONFIG_GPIOLIB_LEGACY - /** GPIO for primary IRQ (used for edge triggered emulation) */ - int irq_gpio; -#endif - /** General purpose switch control */ unsigned int gpsw; }; --=20 2.54.0