[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lxbr75qvptmrilhll7c7l7jooblezc6sw5wuwsdbktsxisvekw@i344yc45xw25>
Date: Thu, 4 Sep 2025 07:10:11 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Alexander Kurz <akurz@...la.de>
Cc: Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Dzmitry Sankouski <dsankouski@...il.com>, "Dr. David Alan Gilbert" <linux@...blig.org>,
Heiko Stuebner <heiko@...ech.de>, Uwe Kleine-König <u.kleine-koenig@...libre.com>,
devicetree@...r.kernel.org, linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/7] Input: mc13783-pwrbutton: fix irq mixup
Hi Alexander,
On Fri, Aug 29, 2025 at 08:15:11PM +0000, Alexander Kurz wrote:
> The mfd mc13xxx interrupt handling was migrated to regmap with commit
> 10f9edaeaa30 ("mfd: mc13xxx: Use regmap irq framework for interrupts").
> As a consequence, button_irq() will get called with virtual irq instead
> of chip-internal irq now. Add wrappers for the three supported interrupts.
>
> Signed-off-by: Alexander Kurz <akurz@...la.de>
> ---
> drivers/input/misc/mc13783-pwrbutton.c | 21 ++++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c
> index 1c7faa9b7afe..4765b25bc9f6 100644
> --- a/drivers/input/misc/mc13783-pwrbutton.c
> +++ b/drivers/input/misc/mc13783-pwrbutton.c
> @@ -88,6 +88,21 @@ static irqreturn_t button_irq(int irq, void *_priv)
> return IRQ_HANDLED;
> }
>
> +static irqreturn_t button1_irq(int irq, void *_priv)
> +{
> + return button_irq(MC13783_IRQ_ONOFD1, _priv);
> +}
> +
> +static irqreturn_t button2_irq(int irq, void *_priv)
> +{
> + return button_irq(MC13783_IRQ_ONOFD2, _priv);
> +}
> +
> +static irqreturn_t button3_irq(int irq, void *_priv)
> +{
> + return button_irq(MC13783_IRQ_ONOFD3, _priv);
> +}
> +
> static int mc13783_pwrbutton_probe(struct platform_device *pdev)
> {
> const struct mc13xxx_buttons_platform_data *pdata;
> @@ -137,7 +152,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
> reg |= MC13783_POWER_CONTROL_2_ON1BRSTEN;
>
> err = mc13xxx_irq_request(mc13783, MC13783_IRQ_ONOFD1,
> - button_irq, "b1on", priv);
> + button1_irq, "b1on", priv);
I wonder if it would not be better to have drivers/mfd/mc13xxx-core.c
use resources to describe/pass interrupts to the power button driver and
get rid of mc13xxx_irq_request() completely.
The power button driver would use platform_get_irq() to fetch virtual
interrupt numbers, store them in priv, and then compare interrupt
numbers in button_irq().
Thanks.
--
Dmitry
Powered by blists - more mailing lists