Re: [PATCH 09/21] input: gpio-keys: make legacy gpiolib optional
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2025-08-11 20:10:02
Also in:
linux-gpio, lkml
On Mon, Aug 11, 2025 at 12:21:51PM -0700, Dmitry Torokhov wrote:
On Mon, Aug 11, 2025 at 03:52:19PM +0300, Andy Shevchenko wrote:quoted
On Mon, Aug 11, 2025 at 01:34:43PM +0300, Matti Vaittinen wrote:quoted
On 08/08/2025 18:17, Arnd Bergmann wrote:
...
quoted
quoted
As such, this patch seems Ok to me, you can treat this as an ack :) This, however made me ponder following - is this the tight way to handle the power-button IRQ? I don't see any other MFD devices doing this in same way, although I am pretty sure there are other PMICs with similar power-button IRQ... I see for example the "drivers/mfd/rt5120.c" to invoke "drivers/input/misc/rt5120-pwrkey.c" instead of using the gpio-keys. This, however, feels like code duplication to me. I'd rather kept using the gpio-keys, but seeing: git grep KEY_POWER drivers/mfd/ drivers/mfd/rohm-bd71828.c: .code = KEY_POWER, drivers/mfd/rohm-bd718x7.c: .code = KEY_POWER, makes me wonder if there is more widely used (better) way?FWIW, on Intel platforms that use power button by PMIC we add a special driver for each of such cases.If we can make gpio-keys work for various power buttons that would be great IMO. The MFD drivers in question already are using device tree, but they do not define/expect nodes for the power buttons. If the nodes were there then I think gpio-keys would work out of the box?
Looking at the, e.g., https://elixir.bootlin.com/linux/v6.16/source/drivers/platform/x86/intel/mrfld_pwrbtn.c, I am not sure it's as simply as it sounds. Basically it's an IRQ, which requires IRQ handling and proper acking/masking/etc. -- With Best Regards, Andy Shevchenko