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 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 14BCCCEF17A for ; Tue, 8 Oct 2024 14:20:14 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uMgvMcSkniy6e0bVZLYn4oOVfCB07BCIvVovxgTTMww=; b=3ZbmYolkHTEB7pkiUqaZkmTjYj ltDQAs9hzhuanBO28az29C/DwIFYAy7h8/lZUYO5g9O+PvRmgIZzCN65afvEsV8x2NGKdt6mYVu+b cMBcS+dnsJiHAWseMlK1Xm+fa7/1UPK0l17i6QcXhCI6kU8FlI963T2pQAn4HxIoss2xNRbiDZPrZ AR1KSxqiC4sMQ4LqVCaP3BrfqJ24y5ivUGZhvi7jQU4j8cvXnXXKb81UdaTwkJreXBT5/a3yh6aOx jmRr3rLAwHQ1hMFqff3Y2O2DLIORqS3Wlyj69/IKd1KeZJDReJZRRsxkPd3qFneNK5JB/46/qBWMf flXWXf8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syB4A-000000068fO-0pio; Tue, 08 Oct 2024 14:19:58 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syB2r-000000068SE-10zm for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2024 14:18:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 106E2A41DFD; Tue, 8 Oct 2024 14:18:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05F90C4CEC7; Tue, 8 Oct 2024 14:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728397115; bh=hKT3uBzYhOP99Yta4PjZvjRY3LiXCkom9Bm+7Of9+gI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mEtIdfI7JAqwO+FUf1BWd1bU1y9Sk2P/3tLe9klSmsW0GiR3kbwP/+4U9bbkeuAd3 20zEX1w/6yjKtYay5o3uOe85GcP/dH+NVfCpW768ADFq0ZgzLi3t+kq6BOowGrqAOw BI875t7uwCXrZnfyQSSvBb/z7ANUoKkMLZnNXYylHa7kHpfX3W97m9jSAuL8KaMwip ucZR2qizcc/rV/8uesKV4O7e7MH6ohIR+dd37r3REUSDazekYgBhRgvNdxYdDSw8vK Ppet5P3dV/5Ula183x5vYrScCsi7/Nw6Yai8mQlughcajgZhqdI16bNCvBwx+6fZVC IFpKVV/xQdcfA== Date: Tue, 8 Oct 2024 09:18:34 -0500 From: Rob Herring To: Kuninori Morimoto Cc: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , 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, Sakari Ailus Subject: Re: [PATCH v6 1/9] of: property: add of_graph_get_next_port() Message-ID: <20241008141834.GA1254664-robh@kernel.org> References: <877caz9tdw.wl-kuninori.morimoto.gx@renesas.com> <875xqj9tdf.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875xqj9tdf.wl-kuninori.morimoto.gx@renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241008_071837_526808_E91BED36 X-CRM114-Status: GOOD ( 18.29 ) 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 On Thu, Sep 26, 2024 at 12:00:12AM +0000, Kuninori Morimoto wrote: > 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 existing > for_each_of_graph_device_endpoint(). Getting "port" via of_get_parent() > from "endpoint" doesn't work. see below. > > ports { > port@0 { > (1) endpoint@0 {...}; > (2) endpoint@1 {...}; > }; > port@1 { > (3) endpoint {...}; > }; > ... > }; > > In other case, we want to handle "ports" same as "port" for some reasons. > > node { > => ports@0 { > port@0 { ... }; > port@1 { ... }; > ... > }; > => ports@1 { As I said before. No where is this documented. We're not going to add common helpers for something undocumented and non-standard. Plus, this patch is doing a lot more than $subject says. Rob