From patchwork Fri Aug 9 04:22:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758385 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 ADB2FC3DA4A for ; Fri, 9 Aug 2024 04:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yxYZARE5YIAVlLCOn5vCZq4OcG85LHMVzjMRxhWqpK8=; b=EQSeOrKb9qf5DwP6vFsjZgscGn I9ObnuyNqWeKBbxOBDSAGH3BL+JlJLPWr1yd8qpk43AFC4/50J8IVJBo4guV1RjGWAsBpu//y/ErB ri0gBv0tFdZI6GCSStPXmSkmGZ1KrvfAJtK3yYGFvGzneLXWRqrIrttP4rQckSIcwdgG6fuIaediT uxuF3gUT1JlyqigCf+lBfk9QU8hgsuQy6jcBcDFh3VSJ838VmPQmDrpW8MOPwPv05qi/ca3g3iRdx chMx1tEUy65ZpKIyDzSyUMLQ8matEvFmeB3mKzaMeC2qwaf7F0OHnhHaepTr9JY34Izk+JxWyJ1O1 HX5UdCOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9v-0000000ACjQ-2g6u; Fri, 09 Aug 2024 04:23:23 +0000 Received: from mail-japanwestazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c406::1] helo=OS0P286CU011.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH93-0000000ACTf-06MD for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:22:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dhIFhOwskAwoFI+qrERNqHSlNtW3nNf6GovlmC7GIFE7rxDZ39XWznUADsia9K22bFRyiBKuHBOyhU6X0Uko6cTcNRz3PLDanvAEG6GogwuQ992VVWkPgwrPedWAmHgCzE7SrNk1I+NLmXK3L2oNWf3Zvy47RX47M0aOer7FrE7v+nvhqOaAqrn+fUWAidIh+rr3nQ055XZW62KozNu4lzlW6wZDU0BA2sFOfbmYfWVeTPJUd7eL4YUZNlb2unxI+BxPFSIEj+vnUa60mxMFGZ8w4BtBnqVgYJptHXulIoC1nmbjrw+1EHwKo4uW5BwcrV/3II+8hCDdLPcZ/Y6Znw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yxYZARE5YIAVlLCOn5vCZq4OcG85LHMVzjMRxhWqpK8=; b=sUTKHb2OIJEQreRaxN8bXQ8b6CU2H/H7kK7qlyVg0p388Gl8DLbSTypYy9f6NkFS0KACBXZ7GexmqAZjBUeVpvrCWzIfuQecO9gSTQs/LjzYzkcKDupqXumrLNosTxjQztO+WT3BJBpAhoF7Ff3g4HuacKV56/bDhwwP4HHjE5ELI5iPC7zcDNDTek3sPFHB9BItKmQc7INRFKCzBPdfuUZtkhjoYIX14+FEJac9rSTpdtUqF+k/7MRZmz1bMn9SI4Ceu86LD9hGh35RMPV+BdssGfmYFLCVQ84VgtS5vyqI9mTfyd9s6WHG0k19jImdbnXqQ9fdmznWaiZn6rCucw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yxYZARE5YIAVlLCOn5vCZq4OcG85LHMVzjMRxhWqpK8=; b=LgLLO/yc3VW00kqYwaP/LJs/nirzvao+wbb+QkC5Eq7iwTr4HOU6WunDKlniO1zDiDSeZOYQ/09dS/gApg5BY/CZm8VlsPMvDPj3bb6ahxuX2dW7CnPCkA4T7tTD9lQlfdRSKud40CqDdSkCOVwMDGouepxREC1bOJQvmZGI8ek= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:22:22 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:22:22 +0000 Message-ID: <874j7u8gw2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 1/9] of: property: add of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:22:22 +0000 X-ClientProxiedBy: TYCP286CA0045.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::19) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: d1cbeb3d-e069-4c01-c282-08dcb82add7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|1800799024|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: dLxi3Cb3W5HPd15o+MIW/6BgnAf3EfNbAOqwlNZbL3udeKrvjXJvrbdnou2CWPl82D7dwxjttQIeYzLKXhb3ZlWE6o2Ok7KNYeESgZvCSEhhNCzNk5kevZ7U80b+p999T6bB9snwTl6yjsAbzqcctVAObHTrldRv6qHWgz/Sj0S+TLd9KKmv1os02BJR62BiiMElAsJrDpIFH9X3hoPw3VrnDVexccl1MgMlEsnsgZA3YEf62Sgy/W3+90Hg8EKcMBS5BQw8aoMrt2+lZhxUZjjLCa7zP+/cJAb6yUvx2d9RqDtb+e6ENu95j9ue1ZBfS2edJT57djCxnxwjuJ7/PsVKwvh/GHMXWRTuB58ZjmMoqRl+jxWPhNvs+zlLv4w4hnXPiYFUK+VQqsPw2DGnThd9ltsKIjkf3aPZK5a9j9xkTyT732ZVkXdtPnzWGOqeZdbru4HtqSDVuZUbb8YM99BxEta6r0QJRc8W1NrnkBX93ALXhmbFASFmQ5MrtF/o5TYWi7JeYLPIvNkBMnKKtUXKQMWHBnHTr0KP1yMUwjISC0tI2Vz/d+TrwpDguC6amgF8S7RdIbpFPFeEnk7s7cxfF7y3sf1nu+CoXbbk1VSe5WkF8cw2eoFdGwac/BIfgghce3Jvtqvp2CibzXaGu10EhIBGpnNL681ta4w1RHcJJZuZ0gGyEr09Sz9jujct1LMPKv8ZcIJWaCsFnwTVAAwnDe+FImcVRSmsge45JeUnHp2GJ8C9LB8+1zqKpn4wi750hMCNcAshVgMIOfxylR2V+MZVr4zuUsS7MlYGpfnaM7Ia4psMOdwTaD5NKZRgUk3MRWo44PlAzGE1QiIrpqww4wUyIY7pfrCqCfudj7cjqqFHzuZOO4Dk05Xgt1qSb1PCpTetAOB+KrI9T5GUug1l4dRNXtHaTMuCU7kCcithvjsWF/2ItogmrJOnFCCfvoGSwqg0XEyGpzh2uTpRA6TStsDGa4D6d7ecWkdWeAYYGcmF3fPkVOJQnqm0uRUHhMddifnLoVPE7xBz035jMncxTzVLgnPGvEqycJJxUCb5uQ/9it+URjqWHcfawjo1c9CUv8vLCsl/jfXQ9Yl1eHUPIkAC31MAhOcCLfIIgzJFnD+qac5mRUjK1p330Ytf0Ze7AiF2rEqQnLERYtGTHs4LfiUVxN4wky0iM5NheRPnDFdsfELRlK1LBNix5fwcF7ruR0k4NhscwSKBhplqo52dPeIlBsazRt7EmSYwKZPDblrz2YF5NM3825IR1A+m3lrUEmCzO/KJFwuAZJKmvm8QqCAg7flDyoYWvTQw3uuDDHDJJNGNDT1kXpjxM3/2zIlThmFnnt2rzUnaRef8sPUODyXAu3SCcBcAPVgteG3xqykd+2FEwfAc+Zh63PK7c7A02AeNjiaYslEZOjABS3xXqz1wPS/cXxRTOHkk5Pg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TJ05b5OnsEvmj8cofx8DxYLA1eGTsvPvpcv9pZk0OOn/HEsCvfZZeN70b4EsTgnkU0ucMpjVFQJQzswXhxH3xiOhk/9g5dBYuntP2wHJJCxhFEyLMLfl+utb1taQIqkj4ikN5qJ4TD6jmDvuCaeWCbS60ppclDTBCMgmM/a4+s0aZNY3Cmp3gGV3fKQQk4WnWRCqlfcUbO4qwOx1HPkl8EP5gJLypr/DC3MClCeMsml8SGiSBBb2wYHnOrmz3rB25IaQZfH+hAgBgcGHM1CBqjRqk4ZV4mOxVwf8/+9Q/YQ9AZgUEn2u5l2zub2R2O7rjo+O+SQ/jv43WxCC93rHzdhGu9UsGvTwwrC8r3pfx7cMAPnOUVAGKuZWXV4kI5BrLgJu5uKAMgPlVgTNjEoEzOB01jAOIS0ATACfqtC04JtTVSuCP7vdxAfefiwydz9lMYiNcSjpVx/JMqq4OqeVdPgzsLXaCayuoeDlvUl+pg7ljyXmH/1UUyO5uKF7r3scHLpW4w1OOWL/hVWVQrMJdUfyz0yfgW1W2XU+pYCVL2KUd0wbsW0B+2YpJAM7FJKTco0AxxfzFM4eptZV1TKTuwaSLKYcIbznzJmTq4T2uSR4C03KmLbmJyjKOy8mOOuaqsQUISj3/zluSYxm2WokJa69DSjwZzFQSMciufqYkBE32emVYayw/ndBeUSkdHHsdIKBmXtRjstma7ASeklvr0jYd6vhay/v1vr8pDowa+ZMDQmM4vJeW+byc/ZzE1O7T7WheO277JWccJcEXSWAlBhDuVxwILttoO1lsItPGAjBO919eB7W6uGq0vLhVevM/QDqaElRiTGYIf2dUuIhZLi3tw0jd6yYqD0n4kUze8PuK2axGCcIA+Kwb3QggXGELGzG9XiV20B+Z5CSlt0VJqm9zdkWMluyWyL4LcYVOkdYp0/pYBQvLpDGFu1nqwB70mrX0c4cXq4Ehbj63BjFSbAw1VvcyxCsU45cuCEc9hL5LQtmuy9oCJpH1FBuxc7ngNy4sXtKIMwKEW7LCOfhc9qDmhLm2tlH/umrkwVU+fpULzl3vIcnRW3V3nxa9fNhpxl3HutpGyhC792DIV9eyc1CautMF/aYyuYPcom/OKeKrZ8tdZL8GUFlxIZQWO1iFIBA/uwC7OjCB13YIkIANK4ZbqKL3rkMDXtysbZBPEdptKG57nq90bvBFYTA43T2PFtjYUiIVIpQbVRr0gM2aKnqjchjVop7rLDBfzTBANfLsXDRBAt3VCUkoSPwZfZ8QfN2dHwPtbBmwJTdunQpKNjZQj/RVoS1AcOxbjoFWD/c1A9fIe9Z9OeWB1h7STDKlgDz4yeSUbxVXw3C7nE9reNbsbnwYToHmqfq2co7ledW+6KMRu0A1wwJTwGm215jGmOCq+h8ojm+9HwSNoVMjk6SAfyknG+OfFn+hELy3HxVHteKC0fck9o2krExR+dgqxGOwaVi1wVm4IvoRjFUQt0up72UQnfU6nChNqaYWL98LzdpdL4uO3kLdt1OCY89nHyfwfovuL5/2at6kqwrSyR64wEoBs9wyANyxHzkZL/DJkUXobNvBztLQAg8HVyYxq0CCCkaMDQVQxvdDwUlWAZnLFfaIaQIZ+e4zjpNkyU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1cbeb3d-e069-4c01-c282-08dcb82add7b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:22:22.5227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j2HmD28QVV9bFjfEEcg/WK0T96T2XXqKvKGv8/E9dlYWIE/hgLOIv/8N9iGJ4uD9Q3AMnxGHW0ghcpDZeJJUR9f8uzDhXA7ZCeXBPFrB3NKj3FAagoSrj2fhCDt+DXHX X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212229_193179_C2A36573 X-CRM114-Status: GOOD ( 22.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We have endpoint base functions - of_graph_get_next_device_endpoint() - of_graph_get_device_endpoint_count() - for_each_of_graph_device_endpoint() Here, for_each_of_graph_device_endpoint() loop finds each endpoints ports { port@0 { (1) endpoint {...}; }; port@1 { (2) endpoint {...}; }; ... }; In above case, it finds endpoint as (1) -> (2) -> ... Basically, user/driver knows which port is used for what, but not in all cases. For example on flexible/generic driver case, how many ports are used is not fixed. For example Sound Generic Card driver which is used from many venders can't know how many ports are used. Because the driver is very flexible/generic, it is impossible to know how many ports are used, it depends on each vender SoC and/or its used board. And more, the port can have multi endpoints. For example Generic Sound Card case, it supports many type of connection between CPU / Codec, and some of them uses multi endpoint in one port. Then, Generic Sound Card want to handle each connection via "port" instead of "endpoint". But, it is very difficult to handle each "port" via for_each_of_graph_device_endpoint(). Getting "port" by using of_get_parent() from "endpoint" doesn't work. see below. ports { port@0 { (1) endpoint@0 {...}; (2) endpoint@1 {...}; }; port@1 { (3) endpoint {...}; }; ... }; In the same time, same reason, we want to handle "ports" same as "port". node { => ports@0 { port@0 { endpoint@0 {...}; endpoint@1 {...}; ... }; port@1 { endpoint@0 {...}; endpoint@1 {...}; ... }; ... }; => ports@1 { ... }; }; Add "ports" / "port" base functions. For above case, we can use for_each_of_graph_ports(node, ports) { for_each_of_graph_port(ports, port) { ... } } This loop works in case of "node" doesn't have "ports" also. Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 88 ++++++++++++++++++++++++++++++++++++++++ include/linux/of_graph.h | 46 +++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index 164d77cb9445..e4d5dfe70104 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -625,6 +625,76 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id) } EXPORT_SYMBOL(of_graph_get_port_by_id); +/** + * of_graph_get_next_ports() - get next ports node. + * @parent: pointer to the parent device node + * @prev: previous ports node, or NULL to get first + * + * If "parent" node doesn't have "ports" node, it returns "parent" node itself as "ports" node. + * + * Return: A 'ports' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_ports(struct device_node *parent, + struct device_node *prev) +{ + if (!parent) + return NULL; + + if (!prev) { + prev = of_get_child_by_name(parent, "ports"); + + /* use parent as its ports of this device if it not exist */ + if (!prev) + prev = of_node_get(parent); + + return prev; + } + + do { + prev = of_get_next_child(parent, prev); + if (!prev) + break; + } while (!of_node_name_eq(prev, "ports")); + + return prev; +} +EXPORT_SYMBOL(of_graph_get_next_ports); + +/** + * of_graph_get_next_port() - get next port node. + * @parent: pointer to the parent device node, or parent ports node + * @prev: previous port node, or NULL to get first + * + * Parent device node can be used as @parent whether device node has ports node or not. + * It will work same as ports@0 node. + * + * Return: A 'port' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_port(struct device_node *parent, + struct device_node *prev) +{ + if (!parent) + return NULL; + + if (!prev) { + struct device_node *ports __free(device_node) = + of_graph_get_next_ports(parent, NULL); + + return of_get_child_by_name(ports, "port"); + } + + do { + prev = of_get_next_child(parent, prev); + if (!prev) + break; + } while (!of_node_name_eq(prev, "port")); + + return prev; +} +EXPORT_SYMBOL(of_graph_get_next_port); + /** * of_graph_get_next_endpoint() - get next endpoint node * @parent: pointer to the parent device node @@ -823,6 +893,24 @@ unsigned int of_graph_get_endpoint_count(const struct device_node *np) } EXPORT_SYMBOL(of_graph_get_endpoint_count); +/** + * of_graph_get_port_count() - get the number of port in a device node + * @np: pointer to the parent device node + * + * Return: count of port of this device node + */ +unsigned int of_graph_get_port_count(struct device_node *np) +{ + struct device_node *port = NULL; + int num = 0; + + for_each_of_graph_port(np, port) + num++; + + return num; +} +EXPORT_SYMBOL(of_graph_get_port_count); + /** * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint * @node: pointer to parent device_node containing graph port/endpoint diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index a4bea62bfa29..a6b91577700a 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -37,14 +37,41 @@ struct of_endpoint { for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ child = of_graph_get_next_endpoint(parent, child)) +/** + * for_each_of_graph_ports - iterate over every ports in a device node + * @parent: parent device node containing ports + * @child: loop variable pointing to the current ports node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_ports(parent, child) \ + for (child = of_graph_get_next_ports(parent, NULL); child != NULL; \ + child = of_graph_get_next_ports(parent, child)) + +/** + * for_each_of_graph_port - iterate over every port in a device or ports node + * @parent: parent device or ports node containing port + * @child: loop variable pointing to the current port node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_port(parent, child) \ + for (child = of_graph_get_next_port(parent, NULL); child != NULL; \ + child = of_graph_get_next_port(parent, child)) + #ifdef CONFIG_OF bool of_graph_is_present(const struct device_node *node); int of_graph_parse_endpoint(const struct device_node *node, struct of_endpoint *endpoint); unsigned int of_graph_get_endpoint_count(const struct device_node *np); +unsigned int of_graph_get_port_count(struct device_node *np); struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id); struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *previous); +struct device_node *of_graph_get_next_ports(struct device_node *parent, + struct device_node *ports); +struct device_node *of_graph_get_next_port(struct device_node *parent, + struct device_node *port); struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg); struct device_node *of_graph_get_remote_endpoint( @@ -73,6 +100,11 @@ static inline unsigned int of_graph_get_endpoint_count(const struct device_node return 0; } +static inline unsigned int of_graph_get_port_count(struct device_node *np) +{ + return 0; +} + static inline struct device_node *of_graph_get_port_by_id( struct device_node *node, u32 id) { @@ -86,6 +118,20 @@ static inline struct device_node *of_graph_get_next_endpoint( return NULL; } +static inline struct device_node *of_graph_get_next_ports( + struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + +static inline struct device_node *of_graph_get_next_port( + struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + static inline struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg) {