From patchwork Tue Feb 20 01:16:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13563246 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 1DC77C48BF8 for ; Tue, 20 Feb 2024 01:16:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 522C410E033; Tue, 20 Feb 2024 01:16:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="iRJK4Snc"; dkim-atps=neutral Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2050.outbound.protection.outlook.com [40.107.113.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 350BF10E02E for ; Tue, 20 Feb 2024 01:16:07 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b5DmcTJp5NkBv1wohjc+aaWMGCqqZHg7j5gxGc3G8takDrCg4Ybwrop5I7QUXhf3EHd58dC1O7G6YUcvjOQHStQ05ALzo0EgYaas4+8EmGuRNK6dk7QVKpt4ELniMCSN9+oFVqnZ7GCBAcOukKsbL3V+DbHGEtB4mRqxQtdbmu6ZOEHIOOcDzOp56DKSI/ifEEWSi8bHfLdlF4pxtSuWW+Q9ZdWB4X74UbNrcDTo6pCUrFKgLse/U1pkwwFjFTMaYg2ZC50WolRo7CbBr4w56miEMwwVU1PH27QirJN/Av6KrUJ/HEXSuBPsTSwhajEkhN6MsTepO41TibTse0cjnQ== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=bOphjlt/HKYZdCXr34UzKPMPPUJcMgh3yZynjECB6L8n43qWbJ/Suh2bgXPCxwqL2D4tsToWCf7YJXO8kNgJuYgGEl+wIIIl4zgTYNqkkY4yMEYAgLSHDrgR55GJKfaqUWnOMwq6MIkFmoJSMPhUwJ6bXTeHWxwyixyxeI6Np6Hr6tBYcI/kT2M3sxWnPsnCQpf0okW2nmD0rZwM6g+6tmE/5PRHKnzOtkF5YwdBuGMXHiyd/q7UiQO07+BL78X1W1Z0QYU6lRz6aAh9R+S9VKbuaJsW2s4qc8gvqJeiAUcnsx3vjcRfGOpIAHt+TQakJw+EKvoEqcJEUEUIkIWAUw== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=iRJK4Snc5SYwo400Zi78xXlBy3VUOtyyVbWJVyyEoOcHOo8CClj7SKrA7RSWpow4vhCNCIrOelVm4qgRLRBY0O+NVjtJ1ujZvYEDpwNF4oSYtaIA2w8ePgn9cA34gE/rlAiy6rdKWJ3bHUCQh+WCevU9FCcGZpzDk2fb/NKM7Eo= 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 TYCPR01MB10730.jpnprd01.prod.outlook.com (2603:1096:400:296::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 01:16:02 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::4d0b:6738:dc2b:51c8]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::4d0b:6738:dc2b:51c8%6]) with mapi id 15.20.7292.029; Tue, 20 Feb 2024 01:16:02 +0000 Message-ID: <8734tokka5.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , Broadcom internal kernel review list , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Eugen Hristev , Florian Fainelli , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jessica Zhang , Krzysztof Kozlowski , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Neil Armstrong , Nicolas Ferre , Sakari Ailus , Sam Ravnborg , Sylwester Nawrocki , Thomas Zimmermann , Tim Harvey , 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-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com In-Reply-To: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> References: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 resend 1/4] gpu: drm: replace of_graph_get_next_endpoint() Date: Tue, 20 Feb 2024 01:16:02 +0000 X-ClientProxiedBy: TYCP286CA0034.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::11) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB10730:EE_ X-MS-Office365-Filtering-Correlation-Id: 94f87b4d-115c-4c58-64ba-08dc31b18132 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; X-Microsoft-Antispam-Message-Info: 67tGbR+XhqbX6F4DY4HIf4xavfmDkCJ3IJIMfod5FpTPyGvScz/SERz6X+xUisA8nKt2LGP9rCHNMUA50YGuyx/dhIw2KK7m1APskpZzJI2M7T5mB6GECaXlg/aNeH3tSJMuY4vqZ9ptiu0bVS8cG3zhxCg8R6jB+Vwqd5kasBqvHVSbvJ2Du8El9HhMRFREI1Wpg8pKBv5nB784KT/9CVA+fEULjq9P6P9vRSUyPKW7zQZSJz0aAuVMSu0bZLXmckD6LqQgAkdP0ETcF6wr096MtPbAFo5jCn/vhGZmFO9Errqwb2VIjMbPcfi3dA/lnoJAqZ0gL7Yp0uawf0BjwS+YLgG8MZMe54V00CyVAPX0OOpl7D4EoFA/o1yBYgIDuLz3TTwsaKB5jbYdN1ZprrVmfOQGLyr29O45abjzVnOhkVizqyB80SLIxth/xnr1BgjmMRZvTT6GJ95yA3SX7CD47+JOWgENjvJZCiPtYImSp4xdMBrEgYTL0s0WdDVyQHBjZi1nZKjX+HFmLmha8Csa514cR/qxEzSEY2FPQlzQDg7twPbISQaU/ZZcJYEx9h1isyUlE1K94u5CPZA+EaGr0DfxxG1f2LClkCV3+FyY5wo8CsCWINaLNEFPUY6Q 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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J1li3H1EVsDUDoK0r+rIoaHUVAWc0IJg8gpSMyBVR30ec1KYcFyZe1baLU0Xcui6RnyfBMvhrIxaRGNtJPoXtuYQ9gvUimk39fKB44U2B5nY39/crnOMJHIAAiMJIdfQ/1lrDUJwjss2leAzTVAYu6/L7A7DR5ciiPFOfckZM35I8618j9SniZ8BNqHf/yO8sTcoE+HuQqjtDvPHxbl6n1bKH3+FBmwzybFxzkdgDXacuSLgUD3wexQxc4hSrjE6g6zk8H5BEgWsebK309p8TRKpQoJBcm+1QB+GHDdAbwDZLzABVrW3TKG1wWCpUyVaZtWPE6rfgG8Gq2mx7t81nQoMKutb5ya7y5//P+95OOVuqvOX8yHg/8br6D8kqF+0tg0TFad8AiR29OVrP19YOdoF9BKTxCiZXT33zQ7pCRAMAaH2A9k8F6u47DT7r6FLBHk2/pTqEJChJxYotmTS4AzwgWQLr7zgg0938farZgFePV9pne+J+3VUwNrFX5MI7EY+txGHY3OgZ5r6a3tFoNCyfVMlcwqd2TFXlEsGl4CPzojw1ltm+Yr4xs7xtKAu4F3mglQuO8dHuC0+n/fPzuj3YlVnGWd2bm7ygDFa1UC1csYfZu04IUfe6d32ZqGmK/y/sbiMklSEYzRFC/QoCoXldEfmQM6F9SciQ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94f87b4d-115c-4c58-64ba-08dc31b18132 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 01:16:02.7478 (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: lWHHQlxn2px78pSgjaEOKVG27BRHh847O3QuSpJR7wgPwB/k3n3j6cqNeAzNbVmbA24O+e7Tem180MhAt9k7KZqNAT5Iq1KqACdTVrbayHw9d0mDMRG2MuViCpdUBICW X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10730 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 177b600895d3..b6b2cade69ae 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 4618c892cdd6..e10e469aa7a6 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 4f8f3172379e..8c29b719ea62 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);