From patchwork Thu Oct 31 22:42:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13858415 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E3677E6748A for ; Thu, 31 Oct 2024 22:42:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ABE210E18D; Thu, 31 Oct 2024 22:42:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="PThU9YB+"; dkim-atps=neutral Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010060.outbound.protection.outlook.com [52.101.229.60]) by gabe.freedesktop.org (Postfix) with ESMTPS id 444E610E119 for ; Thu, 31 Oct 2024 22:42:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jD0lodGX/f6HSwyxMOptVWIfY5vgh38sC7zg0WOQ5LjlFcp7gKU14iU7Y7x5cw/mKbp5v8g4zuyX+AuUpM/6VQ9KATyI/2Oa95dIlGL/5eZ2Jqwz/KULG8p/4IYRTA0FUHRXXlGfu2mjaoqdMWtdzOZ/sqgnmfxLlrqMiTeXL8SYubd76TTIRsMnmgEtcOJREw1xdDrDQawNiXohhi5vjeLDDF8RyiSCLPouBk5V3qZs9ddFSNfokcMSNslADwmJ7bLoNgkdUoLOAopFU6W60jvQIDdCdsgO8S2sHOgFuGOa2DY8hmWcjZNTmT6jj1KgNBz3QW135PIDZba3Rrswgw== 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=ZnXy/TrXXZ/7OyH0wCOOF0RSj1r1kTICGhTmNrMpzGg=; b=BA8Q9GPAZ8DXuZYjI5Qm8RBYwRexVO7VhwO2TxI0fXVXmuE5PFxKSzUCZSFV/89WEJxXuea8X1RsXcTZXdCaWjlopXOWg0/+7rdnDrDzk0CtyB5AJuY6tzo4u2uhKZDFSk98Ctx67EserTAmJEfaZs6IijbMBgvYNGsOXIvaFgtJVWyM6iW83A+QmP1wLpJmjE9LmO+c/vfFwU0+FqLWWXOHX4gGVYoqLchzmXjF0oE8u9yJFghTwgtZyey2HabOwM2Geu5+dHl7lAbUR9/WjrZrAEtczFDeuRML0XlFQxDTC2AY0omI2d7aRbX9JdjCYEaAlCQcQApQki+XNxPC5w== 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=ZnXy/TrXXZ/7OyH0wCOOF0RSj1r1kTICGhTmNrMpzGg=; b=PThU9YB+RBh8umTko3p7Brq1DZBPPJd5/aCrT7vRtpOQfmWFWhevl2XtJVSLHou1I/hleMhG8OUza6idnyQMtVQ2lZI7OkEBg7eIEPWcdxorGmhNWB2EJvr9rLhgYZCa5dEY2vBsBmnU4KSXWsmkRf+nrdR5Dmhnq2g0hBdaZuk= 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 OS3PR01MB9851.jpnprd01.prod.outlook.com (2603:1096:604:1ee::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 22:42:07 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%6]) with mapi id 15.20.8114.015; Thu, 31 Oct 2024 22:42:07 +0000 Message-ID: <87frob3neo.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Rob Herring , Laurent Pinchart , Thierry Reding , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Neil Armstrong , Jessica Zhang , Florian Fainelli , Alexey Brodkin Cc: dri-devel@lists.freedesktop.org, Broadcom internal kernel review list , linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6] gpu: drm: replace of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Thu, 31 Oct 2024 22:42:07 +0000 X-ClientProxiedBy: TY2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:404:42::27) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9851:EE_ X-MS-Office365-Filtering-Correlation-Id: 22238998-226f-4cb6-ba7d-08dcf9fd3fde X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|366016|7416014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: xRuUFOA+9Q/EPMCyRgh3bxJNyPDUIL6WkHutQN0cCQI7XLi2pOD7CNKUCSyurX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nYXkhLQtncwWIW6qSWa/4CYBzVTTeMHzjjjtjdpn4mXEDUKoihTPmSgOcSJHBmusrsDBZjkf96lDuFTeCfb4vTtaKQyvF4kyYpjjd7kKrzguRYLboMj9lQ+Q6xbwEAD+DTpqOrwWBpqxAqSSGiDUKvgcrLTt6Hl9tlsPi0ASyZP+8bPy2j0dndP8f/hw4nKhictZyA4vBnc2BXvNRpEtnmwVYPLHKVKuwfzqUAWpMjYa3BVvAJuze4b8oG51ujTuuUwjohFF8JYLqKgfBDtN7Wobl 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)(1800799024)(52116014)(366016)(7416014)(376014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TlsTKOFTouX+Kbc2d/ncwkd6pY1M9cz9DTvF6g2/pzmQjMuhC6x/dO0h5nC2HIjh88ETZXOeXnn7t7eizWklc/MqG8kN/cmXHYZZ/kKVmgKHysewLVaYlYg4+fEZF7zWdqgqP0mz8YQGVq0CZw0mwjMQxG4L74m9sSMHHb0ttEFBaN6xIrvh/6XcllWjCf9wL2023EjDPZR8vIMw8klLiH/gO64PdskRmzZCl+ZtI+kKKnRzIAobzGqKc4XViGdP3l9rpXpB+xcbYQoZNkUVvSlVfC7bI/mF58fqFLYKFsFiaVsB0NDe1d2IFDqYrFm5zmBhi6daGEIWH/Dhn3NkL7Z9ifhYTPH9L+Y5jDgIlSOPSJmndV22+tN3Okx+yeIwMFPmGUxJMAoJN23sb0+xDoWYpVDOGE3cq1xTjG35UHTZhuWVYUVhg2ij2LbbdAEcIUq+/6MGBNB+4QWkXKhLQ9BHyb099OKgJubp2XikYw2mi1icC+Xd9S4YXpuHA19t7NFBNFmbLYNZ61lMWhCxbgtjK37ANd7e72btbqz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LWehd+8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22238998-226f-4cb6-ba7d-08dcf9fd3fde X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 22:42:07.4261 (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: PDDkt9NbccdjwWlCgS6LBzfCcGnVeVlOhy60B6cXnB0nqVBYEXoYJYTX1leGwWZj5TZCfyCS/AsAurvOU168cuqqECO/IVIbDEUVO8AVGGNqecQQtTGiRy3gX5HWYbnm X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9851 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Dmitry Baryshkov --- v5 ->v6 - based on latest kernel branch 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);