From patchwork Mon Aug 26 01:38:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13776946 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 1171AC5320E for ; Mon, 26 Aug 2024 01:38:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2A9410E023; Mon, 26 Aug 2024 01:38:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="LFenaC1/"; dkim-atps=neutral Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010047.outbound.protection.outlook.com [52.101.228.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70C2D10E023 for ; Mon, 26 Aug 2024 01:38:49 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X0p+K9uSrkaYmyd5sl2Cy3fquZw6YJ2Ctgd3dT4z79X4CvRGqG/5cbpBVR8gqsWQFzhEZu6af7aQb8ZJHzFdz5ua7b3MoTTsHIVPC33qRkSwEJLCGIVIvHCO0/WIL01bKmDuMQRHugrb+RoR3RWdeOMbB4pbve5j/O3+0zp0aWMpAMP5+D0+9eAh95mckQi6LjG6nyoZs4KFAL4Sr0BlqVd9bbS1Zo7DGWFvPlx31w99E9iNMzXerk0ZTbCiWblx27o7JVRJWGO/32ZD41ELso7yV+h+fjdxZ2F/fBp8NbGBQUROicGwY0XvvdMJ56ODHlKmqjXSKR/9rUFTqLJmHg== 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=nSyhOyc2OV8lk5c9oGXR0C4gBwoM3PMTQrZLofPt3G4=; b=cFn3qkpqgoo1+twl0fhI1PgZlcNb7HFpgr3bs2ukXxTgDYNJhxE/zWwre6dhTYRz8i1lrcH57HLCcmBlwOFzQ5ImvhqU4k2gpQL/i/QAVP2i4usES75vM+HTQpKV46qi6dy6MWbDwMeaCtMxxMwAdVkEM+3XkyjooCIEe3aV1dSPTQecJJTGCSraiT/WY0W96gs2rm37XSk8bisXrcE+PLPsaKfiPx7UJKtScZ8J2izJFg929RS2oUIoWXf/ZjrZcYHrnarhSVuyDRv3R2X7Ku6lHzY9wVFr04/d9p5l0j/2bWVWiTnokaZb+cE8qtTgLiy1LnCIg0l3O6wm6DjVSg== 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=nSyhOyc2OV8lk5c9oGXR0C4gBwoM3PMTQrZLofPt3G4=; b=LFenaC1/2EqJ8l+03OUVchm+cyBGkVxX0iP//lnncl4lk7ENyeBQNrezKqqcLwFpY4ilnSZScpiQkehDl1YtiYsNBZgCDZrD6x+xY4tSf/Acb3kGNL9p4t4RZmhtF6WfTufHq5DJJOCvr/tQwPjZB9PUjftUUdJhPtBkc+Mp7C4= 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 OS0PR01MB6116.jpnprd01.prod.outlook.com (2603:1096:604:c8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 01:38:44 +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.7875.016; Mon, 26 Aug 2024 01:38:44 +0000 Date: Mon, 26 Aug 2024 10:38:43 +0900 Message-ID: <87ed6cqd0c.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 From: Kuninori Morimoto Subject: [PATCH v2] gpu: drm: replace of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 X-ClientProxiedBy: TYCP286CA0059.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b5::16) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS0PR01MB6116:EE_ X-MS-Office365-Filtering-Correlation-Id: b2d50003-01aa-4466-cc86-08dcc56fd267 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: Y51AQYxr8yLexsuq18bHhnEkaOItpCHO+YU8mP+l2Y2PH+/W5eTGvauQqEWRj8JKcM1+RvWixiJ2ZoEGMyptehgUrctBZqpvzWcXdvdtUIlU9xOXLA0XZJKCOv42qVk/3xgvZ2h3pJcC2b4s0zvWrvcmWUgQ6N+F3E35QMwQOTyyX+OgzjkD8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1vOaGENTrhbKL9mCNP6d5chcT1sKnnXACHmDIONtboGLd+Y5DSkzmPHcDG8IF/MEk+wMvJoXJrnhXN8uNPqybITGcRzDQvB5/e9yY8Zelj+FWyB1PgJ8XhzJQShpntma+v+NNDq16WV+YKR3wPsmm9YFbrQ5Yc07qQg== 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)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rfaFbi01Q4+cSx0LmvvSMLZlUdtaiTduDjC/YSc5mYRL3MrZQRvDR3yhVPzSFKP6qMeDoNt3sqb6rEZQV7w1rFJphIg1lLNAVRGzmKlb2HzlQWQstZ7J+AE4dSZ2R1Ou7SaZM1gs9a6S3FlzY8wn+p2oPJXPzq46mAYD/zKgl8UtiAf/umn2iZ2wL4H2EgtXMONHz6cNqYfdS/xxBEZd27Wt281L7UbEegJt441HOZ6LjrARU4Nel+fXx+xmTe1U8z4d3ReRKTmGZRFGBbdQVvHPYUgD/wiRtWymoYAPylJSmh/d4yxxATai5sZo+2MSiI2bmsb5aXco4N3+zJz1XfWYGURyxEAjiOKEV+OCtvOFscKXNq17/FZYPI3xJ/3XOOr1O6Etl77R571YhwqpMpRUe6U3kyp6z8tbrdx1ICfZLq7UutngKqUGaa4Kl0Pm8zWZnHaH86/DRVRu4Zl2rEMtKWkfyeeaxmbcAeH2nq16h9f1VRaZn7GixJfdig/bRrJkS9UkHfga6kZV7UeHvdH+/VvYzp5YxycjNeGmLNMGMyMwqr6iydaM3DcZ4l67VDuGF8NQivQThf0f/hIBLGB85aTdX1xmUKb+IQl/r8isL5ezD93aMet29aLdIBHDyfGUvO782+wBSm2Bm735GhXDxeQtIYeRYIu/FoBa66LKQxtkYRxt+SVd/pPqnUZFBEh8/YLgmxtrb41U0f5a6IcjwQg2nXG84DJvMPcwoXUOC+U1Nc9xlCCmLNfwrAuiqaUrEH8A01GEjICmArBklYvheGDe4WABIvLEy939DVRTE7KKmWhGH0nP/jf/tGhMCyZvS518310t9Ix4u3Pf9Lk+g2IXTjKEJdtdY4RZUZFUsQwF9h6Z4r0GTfR11EvTonw2dskfr+oWhXQ6zpUz1WZDqspPxwhhgyBldD4IGKR5QGsDd9OtaxYi4TyeBluWDe/4dZUbZ3ttn2yir8kNbPByzfuI4pXZ0LgDCOwkxq62NT+u7i9hkurcPZPkdFSMtxrUqO19s4Oja4e5gWMq4AvOcRfenvrz4LgwSh8zIQGxHDlrTg86sJjb0NxLGgb/gS3hFozxHOyV2xmhdRzh3tQ5khSe/q9MdTp1DoumMH+bv2N1jmyNXyRfmjdHTNZzOU2HxMEFdeWVQ1LLDKvrt2SiMuFTcZ9gbPoYx9a0C6XdyU67gyo7BI1K6Mbkj/VwvNWmjYuxscHVoAs/y9RyVR/KuszYi3/wsfUB3Q2BUJXTsFGCjfQeq3lHeies0I2eMBNw7VTPGkjAviaRrjxZoufZSGcaAhrV5QBn/68XgsohwZD1AVzC/OneDtl72HVA46WTVcJRmjT5LEi0aeuGrxLloOW8uTSPrFXXwnEF3iud8iblBco0+7soxSRLDyidFam9xi6WtWpK+d1V0RbnLBDegzWqB/coiajsTKVWVEPNVqnSIMTpm6Z2n4YjwHtw2Orft4IUUqAVZ1A6lgX+WZED3VCeNykPXqfxJlIGgnGQHKVK9UaLygb3I8bVwxPfJh0GyjXvcEsgeW9efpk3kMcrRslI+YGdY9N+CKe3sj3MvUR3PTmaFagbgoNvBeBYyQSDM9geAw+Bwc726cXRQ2D4KxdLtCy6IvJEpRf+mEg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2d50003-01aa-4466-cc86-08dcc56fd267 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 01:38:44.2551 (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: ekiGF306Du0y03apOTlwV1ECY7k/p78w/NB/p7VuKJ8E+RC4c4EhqLztFXOdvDhnj8TZoSfQEGEyW9+EHnotg23JZ6dSL2sVPyf1kiu/Vgn5Htq5j4DTGITWJp9w0zuU X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS0PR01MB6116 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 --- v1 -> v2 - based on latest linux-next/master 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);