From patchwork Thu Sep 26 00:05:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13812664 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 0353DCCFA0A for ; Thu, 26 Sep 2024 00:05:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A8AA10EA8D; Thu, 26 Sep 2024 00:05:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="C/1rakAq"; dkim-atps=neutral Received: from OS0P286CU010.outbound.protection.outlook.com (mail-japanwestazon11011061.outbound.protection.outlook.com [40.107.74.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C39410E876 for ; Thu, 26 Sep 2024 00:05:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g/ndsCikwmn6pCGj0t9ge8gKVrT2zkXABx7cd/ycPDxAoRU6o/kHSztfVN+1zL24TB5Ht3ctpeuTB8NcpirHYTI+3C2DF0bbKzqibxTxHjcy1X1l7UxGfl9yKSBorL+xigq8f970ro0YlT1ZOgB9UA3jNxuXPUjWYnast9LVD+ytYzBuH2vNjPpwmQJryVdhXPsZW6WjRve9E1qJB9xZkDJBQ23xvGPw623UHh7ouNvQWOs2eTKeg2OI5bq6Hazof+d0lBWcRporTwkImh4f4c9MPVJAqlkkhVnFg3qA8xUzN5wPHcsCSk2ctHWioQ8CZBu8jpDv6Mrh4g8s3G95nA== 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=a5aiON9TQYg54VbsotdDjHS6GOwJCn/hyoSGolmFQ3k=; b=JQcieiYJIhwu6nvKyMX3AXhyl0yu7cbMcDeRv9WPDSxK3OJrDsXK0cJ9CV7WeNtEmcSAVHMO1M0SR8/HzqVPno9k7kCDpxLj7I2pHnNvN4qWzP0CIBvh0dWpcm3JFqEOqeN6+bFeoJ7w8GokeTbkEV1pFH3qTua0hx3NrkUnHTx3xFW9+qEKAos8rd7g/+brc/Ia/9hrAXmw0yAaAns1QlTIpslbIQ+aHNQBSih0zVn+hvMT70CQ9ZgaFkORw6oyTowcKRmPcbGgPPFwW/Z26ZOpZvrES7lXf2dO3kg2wgA3w0GDhYt6O+VsE1YeYuhpQKwo5vjUO8l34vSQjwGxew== 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=a5aiON9TQYg54VbsotdDjHS6GOwJCn/hyoSGolmFQ3k=; b=C/1rakAq43AhRh+NPIpfOqhzTylcwS0/fXCpDZ0IpOIK79f12nK70z6MgXvjU/AvI60aJp+/P51S/GdCfEaINpAEiU0oKEYywzJ4NG6M+Ez11pW3roRGuKrK7GOOji6i0t6KYRKa0xwb9hfUra2qtFrGdPwGlwq69SGvuWsxscA= 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 OSZPR01MB9281.jpnprd01.prod.outlook.com (2603:1096:604:1d3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Thu, 26 Sep 2024 00:05:42 +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.8005.017; Thu, 26 Sep 2024 00:05:42 +0000 Message-ID: <87setn8eju.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Rob Herring , Thomas Zimmermann , Laurent Pinchart , Thierry Reding , Simona Vetter , Neil Armstrong , Maxime Ripard , Maarten Lankhorst , Jessica Zhang , Florian Fainelli , David Airlie , Daniel Vetter , Alexey Brodkin , dri-devel@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 ] gpu: drm: replace of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Thu, 26 Sep 2024 00:05:42 +0000 X-ClientProxiedBy: TYCP301CA0003.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB9281:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ffeedf4-57c3-49b8-94e9-08dcddbef620 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|1800799024|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: UMWE52D747JWm8+46BW5q8id8pRINuF4jvuZ9kTeJBIQsXeb+WNz6nhPv8Tx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y9sOkrFs7gVRvnAGtO7EKpqNW+59PtYgiTf6Xo6NirkAeYJdYoUgZ79GNuWN9iWOSjAKppDdK9JDz4tMVLgT75OKAv6lBejEnKDhuDjGM2r4DjANjeslvkRyryDLhpF3AHeifhwU4YO4ryBQBPApom3Zkrk6A8ukC66v54Kty9wZ7BbY+bkNIcIkLE48ElonljvWeGch76nx7b4WChKdGFrOm1uSJQGScAKHjxOBXO96F8HIHZj2HQ= 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)(52116014)(1800799024)(376014)(7416014)(366016)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fB1P3PHeEMwJ5s2+0J1vg5wxzZn06sLpKj1kCyNbVShAVOUgFYp5fRNSNoR8AsMGHethn1tRPbGMfvXpKnTx+148QMOanenbEbAvD49RmZTNdTZenmp+bkvFePPOy7QyhXezHCu9WrOXYPjTSjpsi1oMFS3pm1gUxuTZaHDVS1Ycd+yGlZ70X1oLmBeoNTJDJkS36hcHNJNdgN9mUOaJUEWBW4IBBzEr9VoB2IDSn5FcVI70ShKRxgudCS3NGO14o1G/R00CXNn1iOEIJb1qGL7gc3wKclTplcvqG3iFSCrvEcEV20jQDvbKJeen5Yl0F9N+Bsxb3MNMHkkrpq22y0mXhaBdr57j6/3avj0I5eEDcW0N78GLb1F+6tP1dqRcCsZCRoAH+7aDwcXq12IMUTwwDY++/4cXc4XCxpxInqfoTBwPyKF/MfYBFdLMZDlTlrxpQn3M0v6k3C4HACCrjZjoTl3L+747w7UfyQzXR87DYF+3IKpAqZoX4uZidk4Kq4C6V2Bl7/v2DL4Z0pGga3q0ASke5Z+LD068sJiwq+D8XLzzgium1gp1JlTDjljTT43SdStWojfL9tqJzwmuAKFdnKk/8J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Message-Id: 2ffeedf4-57c3-49b8-94e9-08dcddbef620 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2024 00:05:42.3549 (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: hAxNfI/34IJZf82oDlQJ+Z1iEOjq/6Sq+ma1GqPmTYzXht27+5nvNOi3K6tBTMsmODQ0E+Luf+QmmI1zKCVtrtIKN4k2afJuDoPWy6izC7fMh0BRfRSKz3ui2DezmCuQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9281 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 --- v3 -> v4 - based on latest linus/master branch v2 -> v3 - based on latest linux-next/master - Add someone to "To" who is thought to be Maintainer 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);