From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAA9D3DB62F for ; Fri, 26 Jun 2026 07:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782459325; cv=none; b=Fv2PSqq6iL2gvBy9z/Gm200DFJFNz5mAIYWj1S2IRot4buFt4Pr0XZy5k8t1ZKQCMUBLd4D0HEV4F42YdsB8t2qhFcbiqKWy7UaRCuSehjxusYJBZJ+n3FTO4/6Rz0o41bfmnujFwymaoKSkj+SpiWNXpCcCUqe4fYV3Qh3KJrk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782459325; c=relaxed/simple; bh=wY/dBaBzqalzascxYNssgwJADfGmXymtRJs4nQA9pcI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mE1Ypdek6pqmP/nm7ueBZUGlqQ7+q/u9DwZvUYuZsnHFi6CCMiNDJbkvFXdqaSLABRiqUJ0eDmerxHM/pTiEiv92JfL5XpSyC5NPOJhcnK5FZjoTkoLFc71GTJQiy5J38HJcl447oM1kCNjkI3Fshl4Lei6riT5nGzUJraUbTsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qcHatDPY; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qcHatDPY" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-399f5e574b0so6775381fa.1 for ; Fri, 26 Jun 2026 00:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782459322; x=1783064122; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KCWci8t5wm9FBiJKblfmxj9DEC/UYDWqa2VF15uFcNA=; b=qcHatDPYgLt895xMBMyiagY5dlj7T3Tm+/Hh0Bq/2prrh6qW67cbUilVPTu5UiyeMS P5ZlZEreFSZoocFiZ2Ox0CHKIND3wkbEWQw3Makkz5keEmq+vs4KyaRbVzC5K71Xpk9r tKN6sATvrxIEPaFRBjnazzoo1BNDVmfJr6Eb4VrW9BJCsrqc+cBwGia3v4Wfg8cQluyp vem9nvoy+H5gZ4evxn/plg2mDWaUXZ3bH4gxM3Ny8g34iK73Z8cej/6kfMSJTnEIy7d0 nrnZfEpgZTVC4Od9WMQKM6hA5MxmVXyCe9YEJVAxXss7aULD7Sd0JA9cKFXXvAml9MJ0 PNEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782459322; x=1783064122; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KCWci8t5wm9FBiJKblfmxj9DEC/UYDWqa2VF15uFcNA=; b=JXrrq5zFzlHYpw2YOuTJqRoJl09pOBcCKdCQ1w5BshTrRnBORNesjFaz5k247xAyU0 5QhYD5JXVsjEMVhRRfuUjGchgczPtWtyNSRoZeDq7hMpNm1pu397dmFIrzaD3clHuAad hpiHwdbAcnRqGL4+6pQ06oaxHNA9NWavMTL/j0aO1QXOzAeAkV/J7rVo0L/Xc6HIXtod VMEY8tq4359Qtc9cGTuCSBivHeCFs8I2/RsyO0YR5ivsysvsoNu4dVRZzH8zaFyUzlC+ P7fG2Q4WyKSZpZnwIwmXFnTOUJysZlwK3q+uZT0ryrh0hJob5HHdbWV1OcKYxWrtOQsz U9tQ== X-Forwarded-Encrypted: i=1; AHgh+Ro8YN0+dmHBQWRxlyVonIHHOVZFosn6QmAbhZ7D04kMq9XL3E4+hYCwOuhw10lxDuWJ4xNTCWIoiM/e3fY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw73zHfgAIaB2w4/uuycpbb66ZV0xnF79n+PGJrgKeQI5mWK3W+ 0d+WXXGtPUfgRol67XRUGlWdJa3Pqo+QTsEm9OaJ3JTR9YlT/mZSX4kk X-Gm-Gg: AfdE7cm0uxLB6vfnh1MjRARn2rVsIunq+478zYT5l11U4VUH79zTWLsZ30fdmvrYlHC 2xyInIxCVwrb4xfUIJb+TXDx5GJ7cz20lWrH5I56X1aZOgx1U4RtQ4ZavLlzt82Gut9WGjZkM2l 5AVtiKd4WQGTCU1y+a0id/Ty+1B/VLX0sdfEO6yq1UCr83ROHze9t2F5ZSsTxibqVRJqklMGfYS WsXJaY4old0u2pOuaHr++RUvZW+kO1CXNjNhMKmh1I/hbgzNQbU6lxSC+jbfjTe5xA7V1C2hqxq Td2wpYSxqEwB5WT16UCY8sYFdrLL/tbagbZqOIkulT8lm5QFgpUlNIV7A8ZnIu+/maR6DzLPthv Zdwhrf7oUYd2QZow+WI94Mpm1OxQ1CWrJsli2B7YWBMzZyMJ/53SGnHdY6F4yyQhwGJLYng1Qm7 vfQzuWTqK+xkYx3eObp0pz3Vv2Vwn6npijdEXOv55OKDQeMktmxPvdtiOfGBFyTyksTIT3GQ== X-Received: by 2002:a05:6512:6608:b0:5ad:49da:bbed with SMTP id 2adb3069b0e04-5aea1f47e57mr1658658e87.16.1782459321647; Fri, 26 Jun 2026 00:35:21 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5ad695509dfsm3212667e87.18.2026.06.26.00.35.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jun 2026 00:35:20 -0700 (PDT) Message-ID: <9ec0928a-4fe9-426b-96e1-d90b30c1ef74@gmail.com> Date: Fri, 26 Jun 2026 10:35:19 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mfd: rohm: Factor out power button registration To: Dmitry Torokhov Cc: Lee Jones , linux-kernel@vger.kernel.org References: Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 >>> Assisted-by: Antigravity:gemini-3.5-flash >>> Signed-off-by: Dmitry Torokhov >> >> 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! ~~