Re: [PATCH] mfd: rohm: Factor out power button registration
From: Dmitry Torokhov
Date: Thu Jun 25 2026 - 14:33:47 EST
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@xxxxxxxxxx>
> > Assisted-by: Antigravity:gemini-3.5-flash
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
>
> 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 would prefer no over-generalize if there are no users. Kernel modules
are not totally free.
Thanks.
--
Dmitry