From patchwork Mon Jun 17 00:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13699776 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2075.outbound.protection.outlook.com [40.107.113.75]) (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 586086125; Mon, 17 Jun 2024 00:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718585931; cv=fail; b=Jk5pxDsUgAUcxA7AWCb1jGFXQoRE2/pZe4ZwkUt9G5KCYzZGu1RK8WpncEfahxzSMvwq7aWmj1IH9zKp4puTFPC3sXMIB4STzQPMBtnljgRRqo+23KryjU31TUPrMINjD4Bc0X/LTNdGO+tkcbXDYJQGcL65uvSzbHnAIIEt03Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718585931; c=relaxed/simple; bh=S6dJ7xhH+U9pk6RTyvZWqXTNA+HQQ9OemzxUzBuzvD8=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=B1PeG1VmOGyyb3B5v6/ihYHuL2FXq4/zHM2OOjvmTcGBsTNpr9nwK07rPWO/83PV+4afR4X9PJZM74UePF+CIOV+I2yICtqYCJYGLsN8T8EwX4adDzmvKBJOzJz5uis5aqW9Jig9K+1I0Mknwd+nZLajBfp/I7wDZqyeiUQ6XY0= 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=YdQV5IvO; arc=fail smtp.client-ip=40.107.113.75 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="YdQV5IvO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UJuOGIjDWHEKBX/LfTqwDu4CipKtOHz9B7KNv7D0QVIkk0QAlwIwQ7+IGLKigDMvcgeQ2l/5J852H7l/uRXE30uoi/9EoWk2tSwoz6eQi083cmYjEWKUbO8glO+gf/SFp0DMU7BaSE/3tzft1zU5oQ2mVSnwSGGApq74XzlJmYMZkBjwdYZxiXwaYuON7UJ7G3AgWeNQCESqWZE9vQ99XbTiNRg+4pzXSDLOtlOsoiCVrEOAPposKYdzWd3lYYruDF9fnQnlvjMqz5cx96pSfIWMZ5kjn/wjStIRqXX0kaJ/pCm6TVpRaNsz5hu8IEi9yds6+yq02oA/9Vvh2wxUpA== 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=OR1a1aK1IOR0VybfHH4vItwEIKoAZwqnN8AE3V6u6LYxidaxQufyHxDF+iL3nEcthW49yUa+k6El1FVCiBXBv0k6yI9UWphrY4RenniT3g1xp08uf/3V1DckqGrOO12j95/83LwinBalsJgOaZbeIbcXlPcvKdRzgIKXtwObV3exIfDAc1lj2ng02VzqnVTR7+BcstcaRnWp82ceY7zXC9yotOb52H0/+nc3NgCzqoxEheWnX7kxNsPwQ75uBLkja1rGdj4EtVoNg4Dbe86+Y4zgpseJ5giSRJXXCXHq2yxw1Wat1sQlNLgr7UOuErSdYp3ufH44V0MSTaFg1gS1QA== 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=YdQV5IvOTvYKMPRV3AdlgBuiYD1mrd0SpPmz+VCjyqxAknbMihFCvwdhsBc7tqqdUfmmV1jM8dkGj/5XITzqzuLxtqmZgZen0KwW9dp1pqz1K+FvQnfFjJiPZx0TUQsmGLQIk4qBDjCi71gRc3QAnQ7/Wc1YfR8KEr9nrDgwrtk= 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 TYWPR01MB8560.jpnprd01.prod.outlook.com (2603:1096:400:13f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 00:58:46 +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.7677.030; Mon, 17 Jun 2024 00:58:46 +0000 Message-ID: <87tthss7ui.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 resend 1/9] gpu: drm: replace of_graph_get_next_endpoint() 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, Sakari Ailus , Hans Verkuil In-Reply-To: <87v828s7v0.wl-kuninori.morimoto.gx@renesas.com> References: <87v828s7v0.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 17 Jun 2024 00:58:46 +0000 X-ClientProxiedBy: TY2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:404:56::14) 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_|TYWPR01MB8560:EE_ X-MS-Office365-Filtering-Correlation-Id: 21ac385c-b5c7-4787-60af-08dc8e68a469 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:13230037|366013|52116011|7416011|376011|1800799021|38350700011|921017; X-Microsoft-Antispam-Message-Info: q5mlfhINr4msdM+JyyqBfQB3jpag9DPjV7zQ4dQUynAqPPxAG+g8cZUnWqSLFSkcyLik3iau3KUDwlatNEe6wTrS1dQQy7qlYXJIcSMeD3WCjtDzbHFV2X+cfHfvXckU27oPr+v4Yh6lbqh0Fu8s9LEI8icw9CTQskT2yxJr001VkoZy4LXMkoUuFlqYikzQJIsLVYSwPlFrnMrw34pvxrTj1uE/2eq6fLQmju61K7sPbkg0lOweVlJeErklvgS0sCgliwlQ2tc/YnD2GjPXgoWz8uJbkWAmEvwxisP2Kd4+bhJin46qpQVSHocGPb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255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(366013)(52116011)(7416011)(376011)(1800799021)(38350700011)(921017);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gHdvkfI6nuVyX0PBcLZyIyqIwlDf6ewQnWKUi4bgCCPfVgMgBSoaI71a5CvYWl6hWnvV9370n0gORGc1lbDDam2mpQL2drfMGksiZu59XFdzXNYHn5Nd9Xr7oSm7CdddiTUy+U1QtEuQkgsDsdxpZSwkGsWRSa/577+9VCQgeepmWsVdKnJTNDnLUeca4zs2gqFjnVOhUcU6kao3DcWxifQptHMaoOgJqs+YuuEIMwhc+fY22cYoqiOqwcLRMlEAH4MBJorvC/mM4yBLRH7qF3BzwKyR/caz64ueEE97IWrCnmOv4GdHUCkZYiTQ7QRnYtTHbXKj+MOfAjuqPZlMlcqoO3YP1j2NmwQ7HvXYQotI872hT/4wGUEPqVO4fp3PLOeAcWtY1fLwkpab0cV3EDlqzuBJ+BOh8nhfNlVRBCErjGym9Q1KKe0bMV5ARBOe5ATk5ph4GrEjwHKsFjnc6aoaYQ2ZQHZpo40gj/H1WdbHaddJHm+LHbPfv0BkFQvO9Wy1hxwkgFAg4Hsf5MOmDn/2uFTv3bDE1Xv2CHFMPXhqz3Gk+TGj0ITCsx7PbdN5LJ3fhPexwWuHz+oUUFdNsVsFyQY/DHB1XwD4pzPqOX4pMa+Vf5kAJ8YhRf1D0ww/RBACrawaxv6g68Bar4VSsFtLtng++qbm0KGRj+D1SFiMpmzbOp9+4xG+mKTK0AIkJlJqdW5A/kUM7PF+ETV19TU31wW4+TisjX6izbN9uOxyGsA31ATD9isaC/yVx4AD+8QxZ7NPPKEIf7nN57KDaWR1cKNMxTCqzbPccnxmJJMFyCkoGfj8B4kX0RhoQTj/XqIFX2LKRDQvt9tCInB2hsdHMk9oVpwv+jfRPQr1dUHHoBAsusIedCOMhesqo6ttB/At9tFIvcKom+tCSDqe/OMO/NVjE8YvugXEDzbr8/+n20wfLaph+VJXF1hWJKPUmA1J7Qye+VR/rv9tovHURE28niI8uBk1OKn2TdXFUx4W1mCwXakQQEfXQQt06DEtqR5403AcCmqsvJ58BSnE2OxxdsCLR+7nB40GkkjKPZxrsgCtrzm1oZ6cCEYfiCeOHyL94AVsddyPSEth3KvPk6o1fP+5tkSQjJGKvZnmILCiBIBWsJ62OejUEklAfL5JaDS9Sg+DLRny+yfiAmfNmTBnOHbol0k2PJDVJH7/hMOdbUQZ1kFj9I2AmhVRwM0JKY8LOZdjI345lEpj1mlVcEQMj1pnpiKlJ6Nr3Ltv0HGbeYRqRiBIYa5DhtSKvkOiX6Om5asoKj397bxSIU0h2ZBhqIgTT13mXIwwzIX+K92LD625WH9I6/Nvi613KCE9bvR8mc6xOjE+S6gS3UwRoFkcMKynOb5Uf/+rC/23r3E/U5/aUOfGynbM1QEttDK2SLcY8C1fBRaCRjDzPaHGi0xFIOtXtbfZ4BI5bJ42jYV20FDaH1yyy2ZE94Ur5DZIPfug+CwXvYi+IisyfN/K6Cjr0ZVxXxtxjb67dkuadR/I9G61oIoDTnJ8NBwee2IdwRiFawi/NBWJaauOv6O5NQyDa7q/l9stZ8L2rY6jI3t1i7p0wzqmqkV9rBPJxrXl1CWuMT54pXqPdVWgMOJEiWAA4G/LMdZhMli/Fi2yTJs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21ac385c-b5c7-4787-60af-08dc8e68a469 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 00:58:46.7357 (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: TDMMriImhV8icW+oO3TmaRuEtnA8WQJpDiUZR2sGiFDicJCvCQS/BS9rD6Oh32iX3lYRnO2FDU//1zggnHai1O4aYRiRMsOdQEZUNPy/rDzkzgMtR+WO0LkkYUp5SjDg X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8560 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);