From patchwork Tue Jul 30 00:34:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13745943 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 84FB4C3DA4A for ; Tue, 30 Jul 2024 00:34:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B61BB10E116; Tue, 30 Jul 2024 00:34:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="ldmLHM7a"; dkim-atps=neutral Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011021.outbound.protection.outlook.com [52.101.125.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id D5B5A10E116 for ; Tue, 30 Jul 2024 00:34:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xL3TzyCOcOs3A6vBWx/Dk+2tLynSJ6PFD3GGf80dB9lcwmz7e95pEGGCXQqmZRNntQFV2OnCxbzvQH9ttU+ZuKGv42Aq1GonWu68fBhdp8d/q72OWeSmx8tD3k/zdvCD3UoKERRaOj1PHkfWuPeXKYK1RudPtKrmJJ5/9U2JaZpWowN2dtUzJYwSdpFu2zdX/S45uDXDqUnVQjkXga0zD+35VTLYjNWKV/DIdlsjFeLRIojNwtQxK25D3f2+XGPIzlEZc3tXsfLHEa6wAKmrASbsVRAgqaN3BXwduZM4K3XZ/A8tRiACW6T3vv1DZ9NBDo56gQSgRr0zrkbCkTNj+g== 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=Cbb0dRK+5iDbyv2Y/MVH4j/HgoQMnUdnZRnxe2rrKFw=; b=KO9xkd98JOGxXKVPxpwJjeV6VnuDjIw7bdYNDQqvL+mK7DM43UO0PDoX7JfsrrbFRvZ2kRWdCdt92Z6jWugf+iutYrWH2DigElJfR3Pxr9ccYU5J6MiXpbjZVD9ircw8qRgThCXES8HFRERgDeGGaMZiPGUsTiMAjB9unIxrQuQwrwaIHUOx+XmVJcV4dF7c9dgxn8XcLkQ5uw6XXUroVwN5XoRRfbziL8ZVxxFMyuJg3yYdPtGe7laPlnv7wf8paNn38G7tWFuSKGzKqz/FtsSwXZLhk5JFuuTRWX78ih4W2xIb/kQPHd1bb/ApQ6kjeYBAlSUeb+gY0ck5jmeujw== 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=ldmLHM7aV3Kqt+CMe2Vp3H/xTEEJbj6HZm8lgZp/babblfxbpkq+dAbdLrxrCgkXwaElqdvnDSfolVEnUr9GKG7AGKVwNKXS+98W04bKfdMwKQcuRY7b2ex9RDn313erH8fBBLnfYsoRcrGvHqWh7K13NQBPCG06rP9MhYK5wVk= 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 TYYPR01MB12227.jpnprd01.prod.outlook.com (2603:1096:405:f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 30 Jul 2024 00:34:20 +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.7807.026; Tue, 30 Jul 2024 00:34:19 +0000 Message-ID: <87le1jlnui.wl-kuninori.morimoto.gx@renesas.com> To: Alexey Brodkin , Daniel Vetter , David Airlie , Florian Fainelli , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org From: Kuninori Morimoto Subject: [PATCH] gpu: drm: replace of_graph_get_next_endpoint() Date: Tue, 30 Jul 2024 00:34:19 +0000 X-ClientProxiedBy: TYAPR01CA0027.jpnprd01.prod.outlook.com (2603:1096:404:28::15) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYYPR01MB12227:EE_ X-MS-Office365-Filtering-Correlation-Id: 00a33425-413f-41dc-bd88-08dcb02f59d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: gdmzPZ6MmTrFST4CSO7HpHnjW1rX0oJfePy7FCOsywEPhijeRm2KK92clf7bUSCrTSI5juVRFojTgQFIIKJy6N8aruS1DPuEBgscCax9EOCQldePXDmkwKQlOh9oGvGuoCm6AJRXZ9ZzPb8Mi6LzmxYofewM74i++/JwRiC06N6ePIySxYm0OR4JinKwx0JNLN7BT7PzmlP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O7c1r7tZcpWa9wwru4jWr/cWHwtIvF4kcv30AhQHuVmMJRraM5LSHbvbv9TVbuUSTQ/Pp5OvFM9gyJi4+iAOdYMAWr+eHLUGRN75E6qnUsTYULtpSXmiAij 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)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IiRE07TB6XWNq4SHx2c+MSspshbcLmIaenMSh7Q0IaWroYBCiTP6x+O3M+P99nYdCDMbFZ9ws3kX7YVWF5nMOZzWuVecXlrrbTKya7bDuRaftw+2nQKLITyLSJCdda7WworZxFQwI4oMVXFBe2iTJTqi3JpWGruLoooSQ2REldYgF+3SyFqdReIfsSu6eXECXFEXk2Z6ZwSP5ptex4THPRD4p8ps8N1d0F2/RcxCWUu/IF7c+XSUi+2L2Ugij/WJrYhmg+hzVb7THGZbjVwq5VO7gQjnT6Wk+VpKwvB9ocZeYgjAyA6nLkei6lA46r2itPJZ6NVCo960tK7kU8UfkM3Esr8PX5YMgBpL9dYpEmkvle4V7V6tbHhhawsqU5SQcMkKf98RxtW+Uwq3D7PUq1hgDETHA6EWO/PEVY36Y9eJS7vJEHXogpmo19fDwSxKMz4JOFB6038HKt618mqGihDxvyXquDox+Wt2IMRvQmydPBPhhdw+nRZ0eWicDlcxHak3r6ZUiSquoKv1Db431iafqBF9jYt5r09biEyv9ep6ooYSGWKFVK0MrbIsO5SLF9QsoEYpigt4EK2mg8v2S0qFDISn9Q2YaOakGe32lOt8mfUfrR4fc1AgGaDlzVhFKKtIjm3pQWKDCbmGWMGmhKHQyceqIBzeEAnKnqrUG1pq7Ckab40mqsaXlurGKILxBS21yKQkgj65piTYdLyWkrxufcauwiVBpA5KnxAp1yXLUWxBZydAKsczlzZe4b5FLJHdOAbM1622j6MiZVWTmYMmyvmg093wVezEWf5UiXR3vZ7NObN+cgXCNWS7+jm0D47MRS5KAJKTzdnSv05CWcmPr4tDkHelBVgJKUJursCsH8NCW6cPoeyTgUU2odEcOXYbTDTIldPouWAZFWpAXQ/CMsMPyLkBNqjKF2xhhXiNChwKCpKF266cTb7lR1q03w/AudRYW6WMc9B9wfkoqcu8Ko5JTs7J9So7Vv0sTLnHyh67nRw6+cWjqbxtqLIgKL2aN7cG1lThaPnWQuE0/uJsVJlRBmH07nGmlvLRvaSh2DB3Ww2JdbxFw2PQriSEtxURVPz1Gf/mR5/m9z3FSALWkrh1qqQ0nnkEAfVEwMvHGw19EdSU04+MdLsXXP6xBM+/1LZLEkG6bWwXPeUOkqqVYCZ8KbQTmepZr7jxwsXV8qvtrMrIBY0i66eKh0kQ0kI17PzvdytiarcZgmcjYpU4mJAS4PGwqEo549qeQTWsQyJfxI+6sZ0cX+7IxJEjt/8MmgMKsT1/SMw5JuuEUMKs64dy8QYREt6EXwWuPxtGe3r84VLQBMRgF7G3fD3UmJQZS4rawPcY2TI5t9q22NTsZPum1LuBib91Xfly+rMoAIWKXhnA8XJxSL+v4cjgyLXWtiVJKGUQ4ba4A87qu1ka3CjwTUsxlfpwe2LrwQ34XTX5U2ApciMgqcLu9Db64upkRznvym0mrJ5n9Zcqm7RPolX6jXw8lH3tztNR7Ku/DF8uC4mbcbq4ZheD57EyeUqMdj4T+UtEC+TclhkabdWm49TX8lKguP6rsdf7razBXiPzmM9iEu9n/AXE8TuUWY5z4osCoqc4UZAKxqSNmJ7wGS0zSKa5G/xisc/2c24= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00a33425-413f-41dc-bd88-08dcb02f59d9 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 00:34:19.8345 (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: FYVjrUz/QFhqDgb1EvM8HTobiaMwMqXVPedCIYcNWxEuxgF3cJHl/QciPgaFt4bN5kIoKzy531UekfeGmrqW26xguSwzw6UXXHxMg6GrEAvShFb1ieAYG8kfohdg6eY4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB12227 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 --- 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);