From patchwork Mon Jun 3 01:17:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13683173 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11011008.outbound.protection.outlook.com [52.101.228.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AABB23A6; Mon, 3 Jun 2024 01:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717377477; cv=fail; b=BawFnXeK3GASoqhK92+J5CIXnaQj5Jsnjb4/Mi1UlBwdJeuwlFgMJTnfK1q8r04BVCqGzhG9JP5ySvXdLidWUQZVyKaLFZa9FOf3VAvnaH6cFGnul/gib2+G9KzwyMKWXj7YjyoT0ihaUX1wT8UjZ7tBLgtMwNZQfifut7ox5qo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717377477; c=relaxed/simple; bh=S6dJ7xhH+U9pk6RTyvZWqXTNA+HQQ9OemzxUzBuzvD8=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=WrEwMOskbjZVDbBezc0eAy99HDFoNsZsfJUsTBVRj/M3ixF6KaHK48WjAO2vkdMGItHFpK4keDzNMlUeKlroPYisSaNOeaOyY+K0msxcs/lzutWJslZARCCMehJ2qNzJkj5BMXQfOcCd5aa1qYFYYSZ5vp+06tx35EXq+SDhQq4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=EAW+MQlu; arc=fail smtp.client-ip=52.101.228.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="EAW+MQlu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HtISULIaVVgNEGhyngCyvwirk8+vRcKvcold51WoZcDylRoMvgp61PvK8aoujThWgK+V8YH3TDwWwKwg2P2fw/FBLi/+cWQyNqTsD9mNEmAxZPiif89FonzIvWoL4r4eFS/vQJ7O94WevNit+Ip/S9w2TwbU2qx3+DeFXJEKRfQvG0kBe0+sxKFZDGWR8dbv1kMgg7+wgn9Se56RARsLwGmbFgnc7X11Fv6JxzQg93yYv/vcs3un29qMdGrh4bm/IYMB6tlYlZ4wmIhV5btVqPZkzSMtGNO9aJ9oekHGA91egLr/o4GyroYLB8PBcugilrS+TKG+hFFOThtoo8e0zQ== 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=A/FtDKW85nzf/eICMqhAJgVtGeEW9Hdk37kEaJo11AdAqXyiXv78/pGMcGBCd1c1uMq2K9ttmce9Jmq5Onyt/cwOjMZpspGjnOOYjQ222WaqTHBIYW8ykrVWNzpdY9pzpTdj7+prDcPytoa94DhRqV7kZ3Loi65zwr22LN7BaPB3RtLJwhg67ghR4PvuMKqy1vup6xBb5CLmoQWTOgbsASi9DGT7WYzrjinoz0sE8ZwpCQU4FzcyihCuLg1nAOQQdrcbl/y6oEjmEkzksHoOp73Riq7dsWfPT885kI85W9ZyuCITL0hM25ak7jBIOvlqYybFS01een/dEvSjeZqLXA== 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=EAW+MQluu0EGbcTRBU2yuNwFcD7e/h0Cjn40PStKVTzcBRfrOJhLjdA4nV7AuFBYVfDZGPqJ7J6u4Db8hwvY3i1NrxL8rA2S+01ft5nEugQqkZdD3Z1akgR37ip7BPWUuYlEOF+z6TsrKtnYxO1aUMv9swg+n9cOrXUNn1xm86Q= 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 TYWPR01MB9479.jpnprd01.prod.outlook.com (2603:1096:400:1a6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.23; Mon, 3 Jun 2024 01:17:50 +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.7633.021; Mon, 3 Jun 2024 01:17:50 +0000 Message-ID: <87ttia4yf6.wl-kuninori.morimoto.gx@renesas.com> 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 In-Reply-To: <87v82q4yg0.wl-kuninori.morimoto.gx@renesas.com> References: <87v82q4yg0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 1/9] gpu: drm: replace of_graph_get_next_endpoint() Date: Mon, 3 Jun 2024 01:17:49 +0000 X-ClientProxiedBy: TYBP286CA0010.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::22) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB9479:EE_ X-MS-Office365-Filtering-Correlation-Id: 950035ae-a759-4f7a-87b9-08dc836afc5b 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:13230031|376005|7416005|1800799015|366007|52116005|921011|38350700005; X-Microsoft-Antispam-Message-Info: WE5FxTYP7NdKHaIYi0hA7gBxikA+nS0m1+8xY3togSW0yrvI4qTV3Oc9gF52ZripW214+ByqHrhk02FVT8qU6e4H5vbEakAiUHM90c7Z+xHoNuw7RHrOyLG9OypbIFyOlPiV9jLc2xPWo8+1Dfs5gOjc1LGTzkRUIxVyoULwCvdIBe78kNRho5FVJD9VPMf2wVY64wi72xTE2fpRPZTyY9kA97qZ/89Wdf3GbeL9KOwHj0nC3t98tZGrSamg+OIciaDtbfj7ymwpZw2FAdL4PzeuoR756wN/gUb/9ws0TVS9ooBJJNyd7vsl5P+ouMAqX5FmGmBeG9t7jQ2XGesrkva23j0QglgZPzWHYR9MylYDOIqtxjxqsW2WocA6q3q/ZgGe5fJjNix9KopGbVZHmCIrbVi+/7GpGRSX/3WWzP20fQH52ZmNrSgVqEzdixyGCg8yasCrxfPP4jYgvPzcVTWCdte3/MUwi0km3d+kMMMB6/RZxdoZ2wMYHvPq4u487ZR2zhDoacFWDa/cvW9l8N+i6f5iQ2tOxxvvlL1cByzWNfpmfQpXznnmTLaektIaESWN+9dVAFJsxWFbp83IhIp/CHM/optemvdgWyGzdcr9JpZg1pQKjprzIbsgomv32bzkNiDUQO+QDKRCr0ovBJUK4Cx1C2IYJK1Er7bqHOXthIkO67GXn01GIJe/LU3+q/HDqxubIbXT+Apx4Gq4ozJMFz38Duc1DlBGB3mflUoSm0Mjj804Jn/htBlqrca24dD4WWB/4Tk7laRnQBK59wXjqqLUliGln4WATVm+ak/bslZuL63CVXk72inszjTSTM4awzIeEKlHo8OZK0XRElefaQgxqBSf0WisENa/yCkwWo1bjKgGkSJzcy1owD7E6nnn6LMDLbbzjfyvoQqp73OSUH6WiQkBw/fzydUWiiwWFUnj7BKuXvx/+Q+dZW5NKFn8I4ON54MvgdIPmcQf//hLTOVq90NO1ahZka+y5AXoUAHTQljgVefYW38k8gxyGBfo7+VjctESr6z1LvCXv/U6a2MqnzSEZ29y+Inj7Y3i8GhofPDF9qW0WCfUYIUCmjTsigFaaJZM+i0zDtjzvhxh9IIlxJqYKQdtx54geUlh4GAlLeoRNmSauqTurvNFXao3VwzX5htbZrjqwuZeobHuO9kVeah7u/xQCbRA0JqWM5+kPeiJzRsa35ioqVriOVuBIhyy3M928pQykgVEqLOrb9dKS9tlCt6PgZUf/Lqr2q2wOogMPBAxPC8e6Ye6lbrKhFi2e1UyBjhemIRwFO8ziaYNY2lkJztXLHcRPJg= 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:(13230031)(376005)(7416005)(1800799015)(366007)(52116005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8dk8MWfxOgQdTRxfitijeB/XoswINEav/2TnTvryVaDTQVdCSZGrEkpnMcJespNbXJagImEpd+jEymLe63JshW1uk8eAYGFwLHZP4HB/UA4CpYWFpA7FLzKBq/RvDyb4oIGXdJrA+6Ie9XdAgASaQ76Pz8TzxDPK1TMHPsm7OCRUu4ftpp2x7oXMOh3a6WFDDPETpM36R/nae0n2e7r6FPBx/cYIcOBCdmNSn47InNakI3JTd4IE6ZF40whC+t1x70CY+We1TNsNJZbunYdde3xac5vBCF7ulPgiDa3MGQ7EvlJscLn59jT2lzn+T/Z17PjMr5CMKqMykkApAde9G/uJnpi8qhRHQoUnVdpU9+/3wGv7O3AzsyGvc3m7R1QMnmQdLKbL2mnRFTmtk+vnyhPjXakiAl+VCX+0/6z2ViP10eoQQ6aomzOw3AnYfynZye7ZS9bTOZeg+Tsy5eLUMqVRnXJsdHb/Ww/YC111086X2kW+kAhDt3C+TquciBmBKmXjJn291hvSIynOEudPb+zoYnDGlH87maVLbokj/oTzul31ugGIm2Rm67HTfHXaJBPRFkpkvGUjYChAcLT0nxE37ib79EBWc2ZNrdU8qV27zg6PxWRreqq528UDt0SJ33gE1Np/9DlNYGlY7a3Gs9iZ4/1WbKX9+yTyxFb+2vzxun8CLgOhczs2keDm73WFK0dmlC/BjYlfXZLwwaswUl1kRilC0yDWL5nStY9aW1rgQbGgY9zcM11GoAzXhzCIBQv4aLWaaf4do+5CwuLkZuQmcOEBIJMu/AFDajQ4LIeAZqkurkpXZPyO67sFHQ9M+HS1BLYIneE6RkOgUk4OIclZ0EhL9o/aHKM1sHRN+36ifCMMNrTgo4F1DPNjhs8pG2TJqa0f1oTepFqwXqd77XdWeB1+X2jtFmp6ySC0K/ottfm0iWO3hMpxv9OXqt4G/xnUoT/ZAdbboKJipjIIwT8sUefgbKypP1nl1nDaEXkJzS9iSd/2/tgfyXk012dSHdN0d1Zo2z7rf2eAmbiQ94vI9P3ETmVuIj8XgcSb0pFcfDhwCQTGPRmEk3uQ1P+b12bZdMbmy2iKLDF6Qi7WCpupKhz7ydnkBHWlbMZxfgvkR6jIlQQy0K6JLrn28IF6jGKFvM0Py4KfE3ph7DvZmBrkxHYDurZ7AtkWYbPVrbEtAgty9YloimpvnoXUk1g+A8FD00WQ/Y3FJFg6klg0pL/+G2xlXkS9t4BdAQiBOQW43tBoCjK71mWbOkXo5WtkoWOmGTc3naiNdDmfn8cWd+1VqQQ32/upte+x7J51uvecWy6HzNyH+RixUNh5lbAKGTitYZaKy9+706LJNAFQFgwf5bluHypHgXWTctRvSzp16nhXGdNIyLbV3cuXUSj/G+ZD4lke7gUClKZuXMpuW7I2dDbSpw0oPPekT7vCCkKwi5oi+EsKBW25ImUlSRNQW++HANqWx9B7wlf2BwDc9VAbQF+L6KCSkrfb9as3OC1OAG31CBy//fii7zYOg1TGoVPX/RPv9/kEZ8m+3/ZBcb9eX5T6VvZlCWKqziC2otEpiMI820XxDvr/9Yv45LmmvUKC6w9vYcqHyL1hIIhIPjmbDtoj9xnsY8TBUetuX6I= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 950035ae-a759-4f7a-87b9-08dc836afc5b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 01:17:50.4575 (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: n50NAU+zvHo2DUgpbihxT+3R23+JOPQ7jJg/lVZNsqwsEcr86b35ixOZ2q0NSTcz01gAwySmjJvSgne/40iieOgND+iV2etsI5wIzbA3XZ9+8kQxfniEuVxiUzdnW3oO X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9479 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);