From patchwork Mon Jun 17 00:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13699806 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 5213DC27C53 for ; Mon, 17 Jun 2024 00:59:17 +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-Transfer-Encoding:Content-Type:References:In-Reply-To:To:Subject:From :Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Cbb0dRK+5iDbyv2Y/MVH4j/HgoQMnUdnZRnxe2rrKFw=; b=pU4c2aT/V3c4+A6U+NqFJSkmv3 Naf74+CE6mKTEGAf0bLJC3ZxKhneYSp5GAqokD7HjlKBAMwU1uomRQB7mTKcx49g3PY7ZkotJTZPN sICSNKFt2a2KA2cJpYk4l+RHksHVacoo5vuTyaS/YbB+MEfpdvsLlfMYyyOVaAUFsAxzAowGfZiKf 4UPuaQlyhLgf9aj0J5WnFtKjBn3tvApR4i1D58h+FUlZf3Cw0D3yk4Zt/xTv285qzZNA0lJfZuHeo XKaH0UEFcezu1lS3fmhhAzeEC2sDQk5GNh9+rEI0l/0+HXJtncmulFFHEV6tL43yknwUGGea/MXFu eD6aMTVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ0iA-00000008d8W-2cA3; Mon, 17 Jun 2024 00:59:06 +0000 Received: from mail-os0jpn01on20615.outbound.protection.outlook.com ([2a01:111:f403:201a::615] helo=JPN01-OS0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ0i3-00000008d2C-1Yb0 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 00:59:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UJuOGIjDWHEKBX/LfTqwDu4CipKtOHz9B7KNv7D0QVIkk0QAlwIwQ7+IGLKigDMvcgeQ2l/5J852H7l/uRXE30uoi/9EoWk2tSwoz6eQi083cmYjEWKUbO8glO+gf/SFp0DMU7BaSE/3tzft1zU5oQ2mVSnwSGGApq74XzlJmYMZkBjwdYZxiXwaYuON7UJ7G3AgWeNQCESqWZE9vQ99XbTiNRg+4pzXSDLOtlOsoiCVrEOAPposKYdzWd3lYYruDF9fnQnlvjMqz5cx96pSfIWMZ5kjn/wjStIRqXX0kaJ/pCm6TVpRaNsz5hu8IEi9yds6+yq02oA/9Vvh2wxUpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Cbb0dRK+5iDbyv2Y/MVH4j/HgoQMnUdnZRnxe2rrKFw=; b=OR1a1aK1IOR0VybfHH4vItwEIKoAZwqnN8AE3V6u6LYxidaxQufyHxDF+iL3nEcthW49yUa+k6El1FVCiBXBv0k6yI9UWphrY4RenniT3g1xp08uf/3V1DckqGrOO12j95/83LwinBalsJgOaZbeIbcXlPcvKdRzgIKXtwObV3exIfDAc1lj2ng02VzqnVTR7+BcstcaRnWp82ceY7zXC9yotOb52H0/+nc3NgCzqoxEheWnX7kxNsPwQ75uBLkja1rGdj4EtVoNg4Dbe86+Y4zgpseJ5giSRJXXCXHq2yxw1Wat1sQlNLgr7UOuErSdYp3ufH44V0MSTaFg1gS1QA== 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=Cbb0dRK+5iDbyv2Y/MVH4j/HgoQMnUdnZRnxe2rrKFw=; b=YdQV5IvOTvYKMPRV3AdlgBuiYD1mrd0SpPmz+VCjyqxAknbMihFCvwdhsBc7tqqdUfmmV1jM8dkGj/5XITzqzuLxtqmZgZen0KwW9dp1pqz1K+FvQnfFjJiPZx0TUQsmGLQIk4qBDjCi71gRc3QAnQ7/Wc1YfR8KEr9nrDgwrtk= 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 TYWPR01MB8560.jpnprd01.prod.outlook.com (2603:1096:400:13f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 00:58:46 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7677.030; Mon, 17 Jun 2024 00:58:46 +0000 Message-ID: <87tthss7ui.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 resend 1/9] gpu: drm: replace of_graph_get_next_endpoint() To: "Lad Prabhakar" , Alexander Shishkin , Alexandre Belloni , Claudiu Beznea , Daniel Vetter , David Airlie , Eugen Hristev , Greg Kroah-Hartman , Helge Deller , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Nicolas Ferre , Rob Herring , Suzuki K Poulose , Thomas Zimmermann , Tomi Valkeinen , coresight@lists.linaro.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-staging@lists.linux.dev, Sakari Ailus , Hans Verkuil In-Reply-To: <87v828s7v0.wl-kuninori.morimoto.gx@renesas.com> References: <87v828s7v0.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 17 Jun 2024 00:58:46 +0000 X-ClientProxiedBy: TY2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:404:56::14) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8560:EE_ X-MS-Office365-Filtering-Correlation-Id: 21ac385c-b5c7-4787-60af-08dc8e68a469 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|52116011|7416011|376011|1800799021|38350700011|921017; X-Microsoft-Antispam-Message-Info: q5mlfhINr4msdM+JyyqBfQB3jpag9DPjV7zQ4dQUynAqPPxAG+g8cZUnWqSLFSkcyLik3iau3KUDwlatNEe6wTrS1dQQy7qlYXJIcSMeD3WCjtDzbHFV2X+cfHfvXckU27oPr+v4Yh6lbqh0Fu8s9LEI8icw9CTQskT2yxJr001VkoZy4LXMkoUuFlqYikzQJIsLVYSwPlFrnMrw34pvxrTj1uE/2eq6fLQmju61K7sPbkg0lOweVlJeErklvgS0sCgliwlQ2tc/YnD2GjPXgoWz8uJbkWAmEvwxisP2Kd4+bh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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:(13230037)(366013)(52116011)(7416011)(376011)(1800799021)(38350700011)(921017);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gHdvkfI6nuVyX0PBcLZyIyqIwlDf6ewQnWKUi4bgCCPfVgMgBSoaI71a5CvYWl6hWnvV9370n0gORGc1lbDDam2mpQL2drfMGksiZu59XFdzXNYHn5Nd9Xr7oSm7CdddiTUy+U1QtEuQkgsDsdxpZSwkGsWRSa/577+9VCQgeepmWsVdKnJTNDnLUeca4zs2gqFjnVOhUcU6kao3DcWxifQptHMaoOgJqs+YuuEIMwhc+fY22cYoqiOqwcLRMlEAH4MBJorvC/mM4yBLRH7qF3BzwKyR/caz64ueEE97IWrCnmOv4GdHUCkZYiTQ7QRnYtTHbXKj+MOfAjuqPZlMlcqoO3YP1j2NmwQ7HvXYQotI872hT/4wGUEPqVO4fp3PLOeAcWtY1fLwkpab0cV3EDlqzuBJ+BOh8nhfNlVRBCErjGym9Q1KKe0bMV5ARBOe5ATk5ph4GrEjwHKsFjnc6aoaYQ2ZQHZpo40gj/H1WdbHaddJHm+LHbPfv0BkFQvO9Wy1hxwkgFAg4Hsf5MOmDn/2uFTv3bDE1Xv2CHFMPXhqz3Gk+TGj0ITCsx7PbdN5LJ3fhPexwWuHz+oUUFdNsVsFyQY/DHB1XwD4pzPqOX4pMa+Vf5kAJ8YhRf1D0ww/RBACrawaxv6g68Bar4VSsFtLtng++qbm0KGRj+D1SFiMpmzbOp9+4xG+mKTK0AIkJlJqdW5A/kUM7PF+ETV19TU31wW4+TisjX6izbN9uOxyGsA31ATD9isaC/yVx4AD+8QxZ7NPPKEIf7nN57KDaWR1cKNMxTCqzbPccnxmJJMFyCkoGfj8B4kX0RhoQTj/XqIFX2LKRDQvt9tCInB2hsdHMk9oVpwv+jfRPQr1dUHHoBAsusIedCOMhesqo6ttB/At9tFIvcKom+tCSDqe/OMO/NVjE8YvugXEDzbr8/+n20wfLaph+VJXF1hWJKPUmA1J7Qye+VR/rv9tovHURE28niI8uBk1OKn2TdXFUx4W1mCwXakQQEfXQQt06DEtqR5403AcCmqsvJ58BSnE2OxxdsCLR+7nB40GkkjKPZxrsgCtrzm1oZ6cCEYfiCeOHyL94AVsddyPSEth3KvPk6o1fP+5tkSQjJGKvZnmILCiBIBWsJ62OejUEklAfL5JaDS9Sg+DLRny+yfiAmfNmTBnOHbol0k2PJDVJH7/hMOdbUQZ1kFj9I2AmhVRwM0JKY8LOZdjI345lEpj1mlVcEQMj1pnpiKlJ6Nr3Ltv0HGbeYRqRiBIYa5DhtSKvkOiX6Om5asoKj397bxSIU0h2ZBhqIgTT13mXIwwzIX+K92LD625WH9I6/Nvi613KCE9bvR8mc6xOjE+S6gS3UwRoFkcMKynOb5Uf/+rC/23r3E/U5/aUOfGynbM1QEttDK2SLcY8C1fBRaCRjDzPaHGi0xFIOtXtbfZ4BI5bJ42jYV20FDaH1yyy2ZE94Ur5DZIPfug+CwXvYi+IisyfN/K6Cjr0ZVxXxtxjb67dkuadR/I9G61oIoDTnJ8NBwee2IdwRiFawi/NBWJaauOv6O5NQyDa7q/l9stZ8L2rY6jI3t1i7p0wzqmqkV9rBPJxrXl1CWuMT54pXqPdVWgMOJEiWAA4G/LMdZhMli/Fi2yTJs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21ac385c-b5c7-4787-60af-08dc8e68a469 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 00:58:46.7357 (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: TDMMriImhV8icW+oO3TmaRuEtnA8WQJpDiUZR2sGiFDicJCvCQS/BS9rD6Oh32iX3lYRnO2FDU//1zggnHai1O4aYRiRMsOdQEZUNPy/rDzkzgMtR+WO0LkkYUp5SjDg X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8560 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240616_175859_433233_AE9FF316 X-CRM114-Status: GOOD ( 16.19 ) 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 From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org Signed-off-by: Kuninori Morimoto Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_of.c | 4 +++- drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 177b600895d3c..b6b2cade69aeb 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -504,6 +504,8 @@ EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count_ep); * Gets parent DSI bus for a DSI device controlled through a bus other * than MIPI-DCS (SPI, I2C, etc.) using the Device Tree. * + * This function assumes that the device's port@0 is the DSI input. + * * Returns pointer to mipi_dsi_host if successful, -EINVAL if the * request is unsupported, -EPROBE_DEFER if the DSI host is found but * not available, or -ENODEV otherwise. @@ -516,7 +518,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev) /* * Get first endpoint child from device. */ - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) return ERR_PTR(-ENODEV); diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 4618c892cdd65..e10e469aa7a6c 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c) rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); /* Look up the DSI host. It needs to probe before we do. */ - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) return -ENODEV; diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 4f8f3172379e3..8c29b719ea626 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -288,7 +288,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu) * There is only one output port inside each device. It is linked with * encoder endpoint. */ - endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL); + endpoint_node = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1); if (endpoint_node) { encoder_node = of_graph_get_remote_port_parent(endpoint_node); of_node_put(endpoint_node);