From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 F07273DA5B3 for ; Fri, 27 Mar 2026 10:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774609085; cv=none; b=GnwDVTG7F+SgfUW4hAJPCGnfRwgEp5vRJ2E3M2nfDhp1e/5ULNcjQUrHX6dD+XrgIbmJ0o4M6bQsoAvwF73LYZHBh6Q60DARhe5OOtNBzRnsDvHX559v0dcCupxU1SbnJ+dKsxVIEDCtfAWcD0e3bco+c0qyxGLSArgx95fxnlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774609085; c=relaxed/simple; bh=CqUq0hXQzj7uAo2W+P6A3rcnmEdNJI5qAmQosdbJT7A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WUqBIJnwkwKhR4eX0yt1hMg7sDql87ltqMU87K0FVzmEOySDmOnQvkmsSXrX69AIFY/x/aJNFoKKTvRhfek/AuEdl+Ej0rIKz/0pwq24sWehExARPk+K0Dy+USS9lzhTSAQrM/SZuIdCIyjTcOqrfZLtZB1zg0Flp4KKD+jLjLs= 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=smveY90l; arc=none smtp.client-ip=209.85.167.42 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="smveY90l" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5a0faa0d15cso1947300e87.0 for ; Fri, 27 Mar 2026 03:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774609082; x=1775213882; 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=A97C+HGltpZg0nFAbm7q7+A710tcGO9QjNJNTBhxsiY=; b=smveY90lGTW52yoUWiBzQFcKvU9GZls0Erq3EsOojjnOqjPhkBgyiic100Jyt1iSMj GvwcdIjWIBY6c8JRUNwnZoLGmVWbdGo4RQ/ghTOLJQoeKDECIfiGFSCFBo0fdAj9xovc bSBYlgJfqJ3JfNgMq5Yxq26ET4NPfusdeiATDQf1gZleGcCjsXQD9a+6pZooLnLkoNZP oGmgTM2xRqUJThXcs/cOVxmw1wBG9TnoMDCTsxIiPXAozYLpkEnQPkkCiOaPi7PD8XcD dgfk0OtgJOoDfJeeq4tOaFocKIsnAd7y9eJ9fOGsvJxhlZV8AqzPtR6q5NNPYuk0mWKc 5f9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774609082; x=1775213882; 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=A97C+HGltpZg0nFAbm7q7+A710tcGO9QjNJNTBhxsiY=; b=JI3WrU6Kn7C67oR5ogXN6gEJgOBUmnn+ZXW9eGYSuMmLqd1098SJtjtNcrbKAY/qWm BW62FR1yQ7CVGWWOmiQP8QQON8Jfg872gWRZRGi7z9NSbrjFxF6mqdfDW/5/RvHVhLN/ DLtxELxapafS7vjunSDIZtjTlDEdtmH+CMMAQxK8nhn1yvwsAuCLqd20r8BsI8KQcxw3 pfSeUc6NmDkveZsgTbspEHcm699iQYxut+pmDkmBitFfvp6FXg5Jus+5M1VvINbYzXKP d1HcGOmaJlLft2DhynoJPf4BolbyWB1gJE7M1BwSq++/TQzC5F34O6UGKy+Qn0SGcdpA Govg== X-Gm-Message-State: AOJu0YxEPpzIYDqGJvIY1pG7Yg4knr+Aj8sC7a8jhIBK0omIXdnmYu35 50HrhYJCYdqOuhRQE5U2bJOPB3AqkUW6qOoFVjbuYTAD5u/gVdcGRocS1reFxCnc X-Gm-Gg: ATEYQzyJRmuKRn2lR+o24aIaok87GMkAPpYpeSJt88TzLMI+jDkq2bnL8UyL+aQwUxn hiv/cFsmAINZTSKT0LRtm0C8XbYDvLjQKWjXeqpiJyljyU3gwnCF+GikiCFnZPaLqcMdDfCRoe+ TEtb0zMsoszd8J7DXfmpDxmX73SE3CQE/R7H3Zm8486ooRAL+7MiHewSf060UZ/e6ZQ+mQs3hH7 TNDQP3rNV+FbT/6CDxdUrFrjG4ZxG65alGgfU3j24xSVcvZUU1aFO9b2baYU+Bh0/vjIKJ5jeBt olvgisqG24DJDLTOG6lJZ1e8umxeH0ZkfzFfVp7a0D4l0bqC10Ss7JqhwbC1iGV7b6gsfG12nZM l/4a5u57Uu3nFwD0wg1VyOxbnE6XNChBOijp44UXMnzaFCopUeda6S3sEvyLQsV3hdjHRPyneeH 0oh0bJX7URfQKlFwtj8vpGtuRWrZPhMI9DaDdAZ7U9bcVSEyk0ye9EEu+46+QUM3fuSQEm9II/a xYL4OKvpjEtND1Z9KM= X-Received: by 2002:a05:6512:3e0f:b0:5a2:823f:aa3c with SMTP id 2adb3069b0e04-5a2ab7e8f20mr852553e87.1.1774609081688; Fri, 27 Mar 2026 03:58:01 -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-5a2a064e2e1sm1295845e87.37.2026.03.27.03.58.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Mar 2026 03:58:00 -0700 (PDT) Message-ID: Date: Fri, 27 Mar 2026 12:58:00 +0200 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 v3 1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys To: Dmitry Torokhov , Lee Jones Cc: linux-kernel@vger.kernel.org References: <20260324-rohm-software-nodes-v3-0-edde5a0324d5@gmail.com> <20260324-rohm-software-nodes-v3-1-edde5a0324d5@gmail.com> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: <20260324-rohm-software-nodes-v3-1-edde5a0324d5@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25/03/2026 02:54, 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 | 120 +++++++++++++++++++++++++++++++++------------ > 1 file changed, 88 insertions(+), 32 deletions(-) > > diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-bd71828.c > index a79f354bf5cb..e78af75a2115 100644 > --- a/drivers/mfd/rohm-bd71828.c > +++ b/drivers/mfd/rohm-bd71828.c // snip > +static int bd71828_i2c_register_pwrbutton(struct device *dev, int button_irq, > + struct irq_domain *irq_domain) > +{ > + static const struct property_entry bd71828_powerkey_parent_props[] = { > + PROPERTY_ENTRY_STRING("label", "bd71828-pwrkey"), > + { } > + }; > + static const struct property_entry bd71828_powerkey_props[] = { > + PROPERTY_ENTRY_U32("linux,code", KEY_POWER), > + PROPERTY_ENTRY_BOOL("wakeup-source"), > + { } > + }; > + const struct resource res[] = { > + DEFINE_RES_IRQ_NAMED(button_irq, "bd71828-pwrkey"), > + }; > + struct mfd_cell gpio_keys_cell = { > + .name = "gpio-keys", > + .resources = res, > + .num_resources = ARRAY_SIZE(res), > + }; > + const struct software_node * const *node_group; > + struct software_node *nodes; > + int error; > + > + nodes = devm_kcalloc(dev, 2, sizeof(*nodes), GFP_KERNEL); > + if (!nodes) > + return -ENOMEM; > + > + /* Node corresponding to gpio-keys device itself */ > + nodes[0].name = devm_kasprintf(dev, GFP_KERNEL, "%s-power-key", dev_name(dev)); > + if (!nodes[0].name) > + return -ENOMEM; > + > + nodes[0].properties = bd71828_powerkey_parent_props; > + > + /* Node representing power button within gpio-keys device */ > + nodes[1].parent = &nodes[0]; > + nodes[1].properties = bd71828_powerkey_props; > + > + node_group = (const struct software_node *[]){ > + &nodes[0], > + &nodes[1], > + NULL > + }; Here, same as with the 2/2. This construct seems a tad strange to me, but I suppose I can live with it if Lee thinks this is the way to go. Yours, -- Matti -- --- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~