mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Lee Jones <lee@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: rohm: Factor out power button registration
Date: Fri, 26 Jun 2026 10:35:19 +0300	[thread overview]
Message-ID: <9ec0928a-4fe9-426b-96e1-d90b30c1ef74@gmail.com> (raw)
In-Reply-To: <aj1zmqgyXta8EM8E@google.com>

On 25/06/2026 21:33, Dmitry Torokhov wrote:
> Hi Matti,
> 
> On Thu, Jun 25, 2026 at 11:00:08AM +0300, Matti Vaittinen wrote:
>> On 18/06/2026 21:58, Dmitry Torokhov wrote:
>>> Factor out the power button registration logic using software nodes
>>> from rohm-bd718x7 and rohm-bd71828 drivers into a shared module
>>> rohm-pwrbutton.
>>>
>>> This reduces duplication and makes it easier to support other ROHM
>>> PMICs with similar power button configurations.
>>>
>>> Suggested-by: Lee Jones <lee@kernel.org>
>>> Assisted-by: Antigravity:gemini-3.5-flash
>>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>
>> Thanks a lot Dmitry. I like the idea of having generic helpers for crearting
>> the swnodes for the power-button!
>>
>>> ---
>>>    MAINTAINERS                  |   2 +
>>>    drivers/mfd/Kconfig          |   6 ++
>>>    drivers/mfd/Makefile         |   1 +
>>>    drivers/mfd/rohm-bd71828.c   |  84 ++------------------------
>>>    drivers/mfd/rohm-bd718x7.c   |  84 ++------------------------
>>>    drivers/mfd/rohm-pwrbutton.c | 112 +++++++++++++++++++++++++++++++++++
>>>    drivers/mfd/rohm-pwrbutton.h |  12 ++++
>>>    7 files changed, 141 insertions(+), 160 deletions(-)
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index f1caa6e5198b..40c46a7363fb 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -23524,6 +23524,8 @@ F:	drivers/mfd/rohm-bd71828.c
>>>    F:	drivers/mfd/rohm-bd718x7.c
>>>    F:	drivers/mfd/rohm-bd9576.c
>>>    F:	drivers/mfd/rohm-bd96801.c
>>> +F:	drivers/mfd/rohm-pwrbutton.c
>>> +F:	drivers/mfd/rohm-pwrbutton.h
>>>    F:	drivers/regulator/bd71815-regulator.c
>>>    F:	drivers/regulator/bd71828-regulator.c
>>>    F:	drivers/regulator/bd718x7-regulator.c
>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>> index 763ce6a34782..8d04e1b1f8c8 100644
>>> --- a/drivers/mfd/Kconfig
>>> +++ b/drivers/mfd/Kconfig
>>> @@ -2208,6 +2208,10 @@ config MFD_STW481X
>>>    	  in various ST Microelectronics and ST-Ericsson embedded
>>>    	  Nomadik series.
>>> +config MFD_ROHM_PWRBUTTON
>>> +	tristate
>>> +	select MFD_CORE
>>
>> I would drop the MFD dependency from the helper. It'd be nice to be able to
>> add the SW-nodes representing power-button(s) outside MFD as well.
> 
> Do you have potential users in mind for this? I mean specifically
> single IRQ-backed buttons besides these 2 ROHM controllers?

I don't think it needs to be a single IRQ backed? There are quite a few 
IRQs in these PMICs. But no, I don't have concrete users for you (as of 
now), but a power-button which generates and IRQ does really sound like 
a very generic concept to me.

> I would prefer no over-generalize if there are no users. Kernel modules
> are not totally free.

I suppose these IRQ backed power-buttons would in most cases be handled 
by the GPIO_KEYS. Perhaps you could consider exporting the helper from 
it instead of having it in MFD(?)

Well, I am not going to insist - I feel like you're already going an 
extra mile with this - but I really believe more generic helper would be 
useful :)

Yours,
	-- Matti

-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

  reply	other threads:[~2026-06-26  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 18:58 Dmitry Torokhov
2026-06-19  9:02 ` Lee Jones
2026-06-25  8:00 ` Matti Vaittinen
2026-06-25 18:33   ` Dmitry Torokhov
2026-06-26  7:35     ` Matti Vaittinen [this message]
2026-07-06 22:27       ` Dmitry Torokhov
2026-07-12 16:11         ` Matti Vaittinen

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=9ec0928a-4fe9-426b-96e1-d90b30c1ef74@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome