From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D599C3CAA3F for ; Thu, 21 May 2026 12:07:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779365282; cv=none; b=fO7WWjEyeZ4+O6mdBDtRk9Lx8ZtHhzK6OJYha3RYzRHbyntiIWhVtyG0jNcCkAuVXpJ7+iFMIS1Cnc/yggmti9Zw6edzzESVDHYLIGechVVpQLhR+9/g9O0pxXpQ67KRP/xgLzOLV/4D3EE26GpySIVFE05siiQdZtfqKM7/kgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779365282; c=relaxed/simple; bh=bCibQz71n87Oh8NopAYrf+NoNPNLSA9BogKzMsb12yM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TQt7A0Tpq9jPjZMPa9je5bPq0CgcLwC33ycsHo2BvngQ5Dlp68B6HGMkLsf0yUx62DUlEJxtU/46WIUeH9HoLVJdMOWJJwd3oXrKEr7DkovkF/G2umZV7Aii+0DUNdMj6Jk6Lx7Pr7JV2LTyCeAqax5j5VlL5eMO8c8bNulQtSI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FIanRx98; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FIanRx98" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FA9F1F000E9; Thu, 21 May 2026 12:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779365271; bh=A2zFVXOoYDlTb29k2RsmVlU5QepekABHDlZ5MHmtwCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FIanRx981dqb0RGJg1PTWLXMJRn2UL/bl/bqbGgCaWL3AfTfT+32/DpRDfEW2vxed xQKrsnWzQA2NTBMUjpSzD3x6xRDKaoWRwYCMYxaHqfdvuoQAD67bW3QDihzAQWGrTU eHaRCzCIoEr5BmRRqM0rXC3YC8czF0+35IS82DuUHDAtKJML2sA9oszkyM1cOIot5j tvBVCBVueonqRl8FKc8ylx2bdY2ueSRCN1HixWwzOpMYJucONQc+Lby0QKVJUnp9Vx aMeUUIDEI/CNaZzIvKSgK18CMubg8XX2q/MEZqXZSkOQAcEn2YsMDSwwA8OrmNs0YO V/8kOvXyVPI+g== Date: Thu, 21 May 2026 13:07:47 +0100 From: Lee Jones To: Dmitry Torokhov Cc: Matti Vaittinen , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys Message-ID: <20260521120747.GE2921053@google.com> References: <20260427-rohm-software-nodes-v4-0-ffeb5b0c4774@gmail.com> <20260427-rohm-software-nodes-v4-1-ffeb5b0c4774@gmail.com> <20260507144247.GQ305027@google.com> <20260514160010.GP305027@google.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: On Thu, 14 May 2026, Dmitry Torokhov wrote: > On Thu, May 14, 2026 at 05:00:10PM +0100, Lee Jones wrote: > > On Thu, 07 May 2026, Dmitry Torokhov wrote: > > > > > On Thu, May 07, 2026 at 03:42:47PM +0100, Lee Jones wrote: > > > > On Mon, 27 Apr 2026, Dmitry Torokhov wrote: > > > > > > > > > Refactor the rohm-bd71828 MFD driver to use software nodes for > > > > > instantiating the gpio-keys child device, replacing the old > > > > > platform_data mechanism. > > > > > > > > > > The power key's properties are now defined using software nodes and > > > > > property entries. The IRQ is passed as a resource attached to the > > > > > platform device. > > > > > > > > > > This will allow dropping support for using platform data for configuring > > > > > gpio-keys in the future. > > > > > > > > > > Signed-off-by: Dmitry Torokhov > > > > > --- > > > > > drivers/mfd/rohm-bd71828.c | 122 +++++++++++++++++++++++++++++++++------------ > > > > > 1 file changed, 90 insertions(+), 32 deletions(-) > > > > > > > > > > diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-bd71828.c > > > > > index a79f354bf5cb..a8bdb9c955a4 100644 > > > > > --- a/drivers/mfd/rohm-bd71828.c > > > > > +++ b/drivers/mfd/rohm-bd71828.c > > > > > @@ -5,7 +5,8 @@ > > > > > * ROHM BD718[15/28/79] and BD72720 PMIC driver > > > > > */ > > > > > > > > > > -#include > > > > > +#include > > > > > +#include > > > > > #include > > > > > #include > > > > > #include > > > > > @@ -18,6 +19,7 @@ > > > > > #include > > > > > #include > > > > > #include > > > > > +#include > > > > > #include > > > > > #include > > > > > > > > > > @@ -37,19 +39,6 @@ > > > > > }, \ > > > > > } > > > > > > > > > > -static struct gpio_keys_button button = { > > > > > - .code = KEY_POWER, > > > > > - .gpio = -1, > > > > > - .type = EV_KEY, > > > > > - .wakeup = 1, > > > > > -}; > > > > > - > > > > > -static const struct gpio_keys_platform_data bd71828_powerkey_data = { > > > > > - .buttons = &button, > > > > > - .nbuttons = 1, > > > > > - .name = "bd71828-pwrkey", > > > > > -}; > > > > > - > > > > > static const struct resource bd71815_rtc_irqs[] = { > > > > > DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd70528-rtc-alm-0"), > > > > > DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd70528-rtc-alm-1"), > > > > > @@ -174,11 +163,8 @@ static struct mfd_cell bd71828_mfd_cells[] = { > > > > > .name = "bd71828-rtc", > > > > > .resources = bd71828_rtc_irqs, > > > > > .num_resources = ARRAY_SIZE(bd71828_rtc_irqs), > > > > > - }, { > > > > > - .name = "gpio-keys", > > > > > - .platform_data = &bd71828_powerkey_data, > > > > > - .pdata_size = sizeof(bd71828_powerkey_data), > > > > > }, > > > > > + /* Power button is registered separately */ > > > > > > > > This happens a lot in MFD - no need to call it out. > > > > > > OK. > > > > > > > > > > > > }; > > > > > > > > > > static const struct resource bd72720_power_irqs[] = { > > > > > @@ -242,11 +228,8 @@ static const struct mfd_cell bd72720_mfd_cells[] = { > > > > > .name = "bd72720-rtc", > > > > > .resources = bd72720_rtc_irqs, > > > > > .num_resources = ARRAY_SIZE(bd72720_rtc_irqs), > > > > > - }, { > > > > > - .name = "gpio-keys", > > > > > - .platform_data = &bd71828_powerkey_data, > > > > > - .pdata_size = sizeof(bd71828_powerkey_data), > > > > > }, > > > > > + /* Power button is registered separately */ > > > > > }; > > > > > > > > > > static const struct regmap_range bd71815_volatile_ranges[] = { > > > > > @@ -877,6 +860,80 @@ static int set_clk_mode(struct device *dev, struct regmap *regmap, > > > > > OUT32K_MODE_CMOS); > > > > > } > > > > > > > > > > +static int bd71828_i2c_register_swnodes(const struct software_node *nodes) > > > > > +{ > > > > > + const struct software_node * const node_group[] = { > > > > > + &nodes[0], &nodes[1], NULL > > > > > + }; > > > > > > > > I only see handling like this in the testing infra. > > > > > > > > This is all very opaque and fiddly. > > > > > > > > Are you sure we can't do better with statically declared arrays? > > > > > > The nodes represent per-device data, so they can't be static/shared if > > > we want to continue using the non-singleton approach in the driver. > > > > If the handling has to stay the same, then we need to at least present > > it in a nicer way. Manually playing with nameless array indexes looks > > super hacky. > > I am all ears as to how you want it be presented. Let me go back to the original patch and make slightly different recommendations. -- Lee Jones