From: Andreas Kemnade <andreas@kemnade.info>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Tony Lindgren <tony@atomide.com>,
Kevin Hilman <khilman@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/3] Input: add TWL603x power button
Date: Thu, 23 Oct 2025 20:56:53 +0200 [thread overview]
Message-ID: <20251023205653.468e49d2@kemnade.info> (raw)
In-Reply-To: <viq7cjqmt7guulqbuliismflq5gxtfqrxj7vzn2goctlcn5zlt@vaht6usiiedt>
On Wed, 22 Oct 2025 11:48:59 -0700
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Wed, Oct 22, 2025 at 02:44:22PM +0200, Andreas Kemnade wrote:
> > On Tue, 21 Oct 2025 10:58:35 -0700
> > Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> >
> > > On Mon, Oct 20, 2025 at 02:31:59PM +0200, akemnade@kernel.org wrote:
> > > > From: Andreas Kemnade <andreas@kemnade.info>
> > > >
> > > > Like the TWL4030, these PMICs also have a power button feature, so add
> > > > a driver for it.
> > >
> > > Could it be integrated into twl4030-pwrbutton.c? I think the differences
> > > can be accounted for via a "chip" structure attached to a compatible...
> > >
> > So what is different:
> > - different register (but same bit)
> > - some custom irq stuff for 603x (so if (is_603x) needed)
>
> Right, why do we need to unmask the interrupt by hand for 6030? I'd
> expect this handled in the core, when we request the interrupt, not in
> the button driver..in the core, when we request the interrupt, not in
> the button driver...
>
Short answer: irqchip ops do not provide mask/unmask for 6030.
Why... Interrupts are merged. There are 3 irq registers for the whole chip
and some of these 24bits are merged to provide one interrupt per submodule.
Apparently these custom calls are there to enable the merged interrupts
individually or multiple together. That is at least my theory I derived
from my archeology session.
The thing is implemented differently for the twl4030, there you have multiple
irqs per module.
But why two calls here? With one of them the interrupt pad of the pmic reacts
to the interrupt, with the other call, the irq status register does.
So can it all be implemented differently? Probably yes, but things
need to be done carefully or with one cross-subsystem patch changing
everything in lockstep. This somehow itches me for several reasons.
Regards,
Andreas
next prev parent reply other threads:[~2025-10-23 18:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 12:31 [PATCH 0/3] mfd: twl603x: add power button akemnade
2025-10-20 12:31 ` [PATCH 1/3] dt-bindings: mfd: twl: enable power button also for twl603x akemnade
2025-10-21 7:10 ` Krzysztof Kozlowski
2025-10-21 8:45 ` Andreas Kemnade
2025-10-21 9:58 ` Krzysztof Kozlowski
2025-10-21 16:36 ` Andreas Kemnade
2025-10-21 17:18 ` Krzysztof Kozlowski
2025-10-22 8:55 ` Andreas Kemnade
2025-10-20 12:31 ` [PATCH 2/3] Input: add TWL603x power button akemnade
2025-10-21 7:07 ` Krzysztof Kozlowski
2025-10-21 17:58 ` Dmitry Torokhov
2025-10-22 12:44 ` Andreas Kemnade
2025-10-22 18:48 ` Dmitry Torokhov
2025-10-23 18:56 ` Andreas Kemnade [this message]
2025-10-20 12:32 ` [PATCH 3/3] ARM: dts: ti/omap: omap4-epson-embt2ws: add powerbutton akemnade
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=20251023205653.468e49d2@kemnade.info \
--to=andreas@kemnade.info \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=khilman@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=robh@kernel.org \
--cc=tony@atomide.com \
/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).