From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A922D43343 for ; Thu, 11 Dec 2025 19:48:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 50345410EA; Thu, 11 Dec 2025 19:48:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VvLXtfCZn7I8; Thu, 11 Dec 2025 19:48:45 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DF8A040346 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1765482524; bh=rC4mCgkPFY3HeqtRjRPBAr1+nSCr5owbgZaduK5jqJ4=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=zWlxZCn2Ve5OMAp2J8OsN1LtxjOVqwtJPvpxRUSRQ7rX3QOcCVf+OiuyRaJ5p9oBq +CS5vEcazUZ95isHstScm7IYi4QQ24BtwZ2vQHkOHuZY5KIDj7ibTwDIwf/CQeKZzD eyK07fbKHG1v1VY0n+41fP4tRdhi6+E+nYmAG6inHifWUiWKG+qbBjWWfjj9+JcIAO wYdXQ8bQoA57pRV3TYTTviTABd7IAUDY7GNM86xU34m590HLETiwyE8rPCyk93OiAj LiPQE7r2efe/Vd2rkLC8Ft5Qa6YndSkKQWZbC66VX30l1kMCGS42valG+P9PuWP0ud +zRQ62J4qNrzQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id DF8A040346; Thu, 11 Dec 2025 19:48:44 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id D95B32C1 for ; Thu, 11 Dec 2025 19:48:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CAE9F60640 for ; Thu, 11 Dec 2025 19:48:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8cQMxExwAu8x for ; Thu, 11 Dec 2025 19:48:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=ivecera@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org C2B7D6062C DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C2B7D6062C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id C2B7D6062C for ; Thu, 11 Dec 2025 19:48:42 +0000 (UTC) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-x6iNrVO8PDKA5KU51MnQEw-1; Thu, 11 Dec 2025 14:48:38 -0500 X-MC-Unique: x6iNrVO8PDKA5KU51MnQEw-1 X-Mimecast-MFC-AGG-ID: x6iNrVO8PDKA5KU51MnQEw_1765482514 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 64635195606D; Thu, 11 Dec 2025 19:48:34 +0000 (UTC) Received: from p16v.luc.cera.cz (unknown [10.45.224.252]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CE5161953984; Thu, 11 Dec 2025 19:48:25 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vadim Fedorenko , Arkadiusz Kubalewski , Grzegorz Nitka , Jiri Pirko , Petr Oros , Michal Schmidt , Prathosh Satish , Tony Nguyen , Przemek Kitszel , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch , Richard Cochran , Jonathan Lemon , Simon Horman , Alexander Lobakin , Willem de Bruijn , Stefan Wahren , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org Date: Thu, 11 Dec 2025 20:47:46 +0100 Message-ID: <20251211194756.234043-4-ivecera@redhat.com> In-Reply-To: <20251211194756.234043-1-ivecera@redhat.com> References: <20251211194756.234043-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765482521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rC4mCgkPFY3HeqtRjRPBAr1+nSCr5owbgZaduK5jqJ4=; b=ebc28UWEUBkZGsy5o9db14xuF2iILDjl97xV2dwkZhfs47Pa9upkAdk59e3Bwn8hKfMCJD 1P9OB3hHuLbbTrIX/9pndIrQKSdAA47h6C75bXLCTHSB6ZlQl2zJ1tEAv08hPzrY3RgCnb /n0VfDEp2dk41BNM1xgodJmAropoEsY= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ebc28UWE Subject: [Intel-wired-lan] [PATCH RFC net-next 03/13] net: eth: Add helpers to find DPLL pin firmware node X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Add helper functions to retrieve a DPLL pin's firmware node handle based on the "dpll-pins" and "dpll-pin-names" device tree properties. * fwnode_get_dpll_pin_node(): matches the given name against the "dpll-pin-names" property to find the correct index, then retrieves the reference from "dpll-pins". * device_get_dpll_pin_node(): a wrapper around the fwnode helper for convenience when using a `struct device`. These helpers simplify the process for Ethernet drivers to look up their associated DPLL pins defined in the Device Tree, which can then be passed to the DPLL subsystem to acquire the pin object. Signed-off-by: Ivan Vecera --- include/linux/etherdevice.h | 4 ++++ net/ethernet/eth.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 9a1eacf35d370..e342e522ea0e8 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -35,6 +35,10 @@ int nvmem_get_mac_address(struct device *dev, void *addrbuf); int device_get_mac_address(struct device *dev, char *addr); int device_get_ethdev_address(struct device *dev, struct net_device *netdev); int fwnode_get_mac_address(struct fwnode_handle *fwnode, char *addr); +struct fwnode_handle *fwnode_get_dpll_pin_node(struct fwnode_handle *fwnode, + const char *name); +struct fwnode_handle *device_get_dpll_pin_node(struct device *dev, + const char *name); u32 eth_get_headlen(const struct net_device *dev, const void *data, u32 len); __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 13a63b48b7eeb..9081dc02ba91e 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -639,3 +639,23 @@ int device_get_ethdev_address(struct device *dev, struct net_device *netdev) return ret; } EXPORT_SYMBOL(device_get_ethdev_address); + +struct fwnode_handle *fwnode_get_dpll_pin_node(struct fwnode_handle *fwnode, + const char *name) +{ + int index = 0; + + if (name) + index = fwnode_property_match_string(fwnode, "dpll-pin-names", + name); + + return fwnode_find_reference(fwnode, "dpll-pins", index); +} +EXPORT_SYMBOL(fwnode_get_dpll_pin_node); + +struct fwnode_handle *device_get_dpll_pin_node(struct device *dev, + const char *name) +{ + return fwnode_get_dpll_pin_node(dev_fwnode(dev), name); +} +EXPORT_SYMBOL(device_get_dpll_pin_node); -- 2.51.2