From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 297DE13DDAA for ; Mon, 6 Jul 2026 22:27:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783376860; cv=none; b=MN4y13kD5fsr2u/37UP4YivHbX57VJuU5d5TKM9NvQTYA9pDlvLEWe93+dztufHoBoth2ExxHdexLwmeCmvReaAzLOJ2+xro69J/M5n9Ri2QAE8/V4GLRSdRzgGtiV35nrYO9+KvGvIgyDM3o/oRNQsykl2W7InUYHGr6hz4LTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783376860; c=relaxed/simple; bh=vaiQ3AfBWtep3SeSCBjYHJdEzA9Z7eKfxTsObJfbpfs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KA0TryBtkQbUdi0cG4Rz2x9V5KKxBk7DihoGq4Pq/gV+tvpYzwoPPC02GYD17RUCRzc+tJ5iOOE5MVlJjPQO00UDY2o9M5aXgEuMp8zxKkgDhEO40uIjzIp0+eZq+mLdsDSisvXd6w7STbxUHTKv5GHvfhHSBAI7K0ciWe6snR0= 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=bbJavD74; arc=none smtp.client-ip=209.85.216.50 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="bbJavD74" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-3856d6fbcb3so1498635a91.2 for ; Mon, 06 Jul 2026 15:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783376858; x=1783981658; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=UlfrZ5FyUPhzfV6IX0/KkvcMrW8tDi59lFiED4k/r2U=; b=bbJavD74MhsJ3M6mseqQCUhIvgZbYq+X3EEOEoa/OK4m7JRmOvxJCWYVJ/yp4RWFVJ ywTWeunt00QT8qTNtKQ8FMqnpJ7Je47PkXRc9ldk2YJOVkHfRhSDQn1W9k/oHGWo4IRY mvxeIlJ8RqvKq4WGjGhBt9XiIWVHMCORdcpatCt4M3IKCcUNx5VLodDVBVUnvx/w+vMZ avm3xpF4r7TQ+Fw4a/NSKliaTHUu0CbTofISaTddANOW9AhoVJxCExJf5oqldFjjU4UH YwL1TOrRO7SvD9FoODcNsQcOdGkejKzbtW6RXPDt6CD44O/9eath/AJksr0RnY812YmP XnDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783376858; x=1783981658; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UlfrZ5FyUPhzfV6IX0/KkvcMrW8tDi59lFiED4k/r2U=; b=CzDPckT75w3NK8AYHgN4mONf/w8EvqNl5b3iBZvEUBl2eJnXXi/IyGxNyW0RyvGGVd G6zE3pR4VurW/7GYy5w/7/lh96se5402ALh45k1rurFCYEv0CZbFIsMQv6LiSZO+Fs+L LvZLTXcIP88cbyLKcJ/bpjiQ7TjtqwIVYxqTUxh2bNryOEh6OicocPHJZNd8o0NlFClO qAJ84GVdPpWXLYcfMcjp5b5wJZvFN0NzFaNHUPvLDHXQ4byjejxDCWzjeWERLIm/kXz8 HkKGRETVTW4Ky428Frgv3OSp/T4W5eTslbZFNqeJ9WoCc0E4DIuME+1SWJxIDjlqC1CA Zz7g== X-Forwarded-Encrypted: i=1; AHgh+RqEdjRj5P3KAVD1sSPZO8dVwXFFVoOgrjyTV46VJ24vZVpdsgIwXGmKxusfJX29ZsgLRamEOyAwUZ9KSnY=@vger.kernel.org X-Gm-Message-State: AOJu0YwbvkeeXlDPV1TMEhIgv1a6jnV+afU8FoY7URRzmZBGjse7bmxJ knPXUY9t5B59Mop4591sl+QMDyvkxyl7degrm1FVDaE3FTSb7JtNFXP2qPDYXA== X-Gm-Gg: AfdE7cm/SxWbFD3o6DBypoF9fJ6q7rQSgq4/6q7D/3aPKrlaChl1CMZmwtDbFiZedQF RS9iOQv/D2f23QqcjEAwapE9FhmCFPGLb57xhS1nN+5gDcqy/Lr7iSvaNbKE6V6xxDEcadMyQqC QZdRMlyvxIKMv+QKuxLfjwYYyR9ED+sygCGPZgG04YvaIIt0xajGjPaCyh2hpR9yVEa5vcLJB3c pIne6riRz1SfjmGwiwbImsWWTyHUy7WCJZZ9SfAoKIfSh3lqhVVWP4nIz5FwhNIWH81T+ge5sQt oTxk2nItMi4kJbQi+bIB9mRDNn0wN3nQbJ01ogbZEQ1eVnbaw+XQjzQUcFVpeQbXuSu4zHux0UH jLmMeMNDJpCk8gtOANswPcI3eamIjv26Ofmugk7htB9ar0AHtjEEA/LVQBdAvNDa733Q2BbPCI8 pZ7IhePQJN1gKf+GxSDtJSas8JrHoEk5UnNPOH5ctGT91IbtJUQByiRw== X-Received: by 2002:a17:90b:55cd:b0:36d:5d1c:c4ad with SMTP id 98e67ed59e1d1-38755478040mr2239201a91.9.1783376858476; Mon, 06 Jul 2026 15:27:38 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:d89b:1fdd:a8f2:dbeb]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31174a583bcsm1035101eec.19.2026.07.06.15.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 15:27:37 -0700 (PDT) Date: Mon, 6 Jul 2026 15:27:35 -0700 From: Dmitry Torokhov To: Matti Vaittinen Cc: Lee Jones , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: rohm: Factor out power button registration Message-ID: References: <9ec0928a-4fe9-426b-96e1-d90b30c1ef74@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ec0928a-4fe9-426b-96e1-d90b30c1ef74@gmail.com> Hi Matti, On Fri, Jun 26, 2026 at 10:35:19AM +0300, Matti Vaittinen wrote: > 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(?) I want through drivers for similar buttons and I currently do not see any other candidates for the conversion besides the 2 ROHM drivers. This is because the rest of the power button drivers implement true tracking of the button state (instead of only detecting press via an IRQ and simulating release). The only potential users of the helper would be new drivers, but new drivers outside of MFD realm will use ACPI/DT and not static device properties as they will handle new devices on new boards. It is only within the context of MFD that I can see slight possibility of more drivers using this mechanism (and not regular DT configuration) and that is why I do not think putting the helper in gpio-keys would make sense. Additionally putting it in gpio-keys will add unwanted (IMO) dependency (module-load-wise). Thanks. -- Dmitry