From patchwork Thu May 30 02:05:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13679645 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2065.outbound.protection.outlook.com [40.107.113.65]) (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 CF07B1CD11; Thu, 30 May 2024 02:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717034740; cv=fail; b=Ehsq0JbuVZ6WPNEdJ9V5dZXYCsyZ5/+Sv8mj4vscR6qbsWWAHd28eBLt3iITNx2AMhoGyTX0ShDQQHYfMuIRIleVI9+2eP7RWN3gc7YAfUn2kQ7wY7hfsSNeDLrpORR/uJOdBzQJyKs7Ie0xWbQFKyvqMolCNst9NOtlBYo1Rgc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717034740; c=relaxed/simple; bh=S6dJ7xhH+U9pk6RTyvZWqXTNA+HQQ9OemzxUzBuzvD8=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=rJpIZY8lCUPWV0cdz9ie9yGrB4ttbptRjQC6DruHx9m/NlEamJcK9VXHq0Y/nxGFVTkz3XokrRPfhOSKNDuhrLPsnP+a2B6wTHyEv9bfSH30VMQCpJMOmlXnhUmGiG7+Inuzg45tcIrtbUB0RC0UlNdYYVwC8leyuB3EaKlD724= 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=NjzeO+tA; arc=fail smtp.client-ip=40.107.113.65 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="NjzeO+tA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJBO49e7IlkBWL9n4UX7VYDqaKUSXFnZ0ErHdSKR9dad6HRqkUdV505r4NaZcbAbvci5YvNLaTBL83XYc1rCvY3UUWDRqJ9PD8I2xnUW4eTymJTH5H1VOnAaL14YVxTeuk6GForeV7yblT2GTs5+XpRQ9upK3sa8BSI2CIJyqwOIuoV8NpFbLL66VxwJEtBmiLlxKKV2+gGmbRp4wH9nOQ9xnQn3vi0Yo9PkM5wKTdkzkxTd5F8JTwT47+lqI6UUGruydkpoYFh/OeQYI4z/DCxFNOlEtGwTnR8C6ov0IrRwgTH9lFxW4wBvSeCOoshvLwCfylROajuSW5SJsy0SVA== 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=afdA4gJO/3Vw4z2aPBR6NBUBB9WkgNTYd/T3EbjF+ctF0U6objA+agfi3ujlCClxWfd7Yvrj+PANa4ZSNrkeSp4ED1Y5rM5W9oLhK6xZNlK04Ak1vjOfrkdF7GGFkmjM2q8lthud56N+n7RZSFPowUSFhMLYe80hs6/M0DE+joTzR648FrIKEPsLDL6DSds6qgMFRIF9l1/HM7nnXS6zo3CPyt5vx/OZwJlTdPaIBzI6uH6DVLcXJe/7FivTSnhyEVKuPz1fVqHxGgYUDwsI5KgT9vT8FKa5vojo2jw1rSkwpnJzhaheh9gCn1cIGCCjth4mxBQGsWaS89DqC3inog== 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=NjzeO+tAY/ObVZZ4vP6VjJ9l+uI+XSrYI5MPKaL5Hxw9J6ynsHNkv9xnnQW0ERdhfcyJBNXg8dskO5ION0x1C/xz2b3Ui53CjI++qX1bugxX3G79TnUCyRhvFBNH+vsISdr+TmhqW+RQQS0mpt7LrjfWbLBrhXMdO9nblLZt2cE= 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 TY3PR01MB9900.jpnprd01.prod.outlook.com (2603:1096:400:223::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 02:05:33 +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.018; Thu, 30 May 2024 02:05:33 +0000 Message-ID: <87jzjcoxzn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 1/9] gpu: drm: replace of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 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: <87le3soy08.wl-kuninori.morimoto.gx@renesas.com> References: <87le3soy08.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 30 May 2024 02:05:33 +0000 X-ClientProxiedBy: TYCPR01CA0016.jpnprd01.prod.outlook.com (2603:1096:405::28) 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_|TY3PR01MB9900:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c268af2-f4a3-4dc4-21bb-08dc804cfd46 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|7416005|52116005|1800799015|376005|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: /jwFiSwBXFKM6YrAscq4bRMKd0j+KLgZvyrAKn1su1Q4Nzc2amVmtZlx3DC+LFXlBTrXZgDyHzv2jUlDB9rzYzlJtvwAXsZ/itqKaoriGzthFQymLCKedcd8QSc2AzRzd59lGBhDX0J3NBYDTf6a841wuLYM+AIIFrhfvVNgaApvEjZxOM54GOYEYRhUgeMU+KRuywutiNJzZazK6ZMv7UCPwU2TaeRmzn/XK4NXYxPlRQ+cG7Caipaa4jkAs0FcxFO6vwlkux4LWNBNtemIwXrR4Ty/w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CL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(52116005)(1800799015)(376005)(366007)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2MdVKXqJ4/9DVGGuwCKdDYUDhxoJVaEEBy50o0Z2bRNbgUDrHLCpAfeFuss3D/Z/nniFyAWym0d7+CfktN9l5zrmkzAVaCAKKNMxJbYe5pVPxx4dXY+AlHz/cUKfr5lXj59aTekpJIvSee7b0vgevaNnxSXnU5KqlHMG4v1PQRtvTfPuJqH+99z/yUG7GMMWGMOpgIzzr4cwDAPjKL2m+22u06zJq9kPXffnUnjXQtDhNrn1c7hbO3F7DJkJWImXxgHY9nJyPe1xZkEYVjG1QvSXHi5vqXMJDE9zL7Y9cE1l0NOYt+fl+/opIod0RhXA8dxHYJo+KdNW6vMEE9GVhtSyXS+0v9po8b8RaHY4ca9CIfEr6p7lJ7OSNLEubVSo4CecD8Zsxf7DhVyCsGsiiE6cWmlQtZZVPPHlBCMaayzUy4Zrc5myXXrDihASSEPM43MatpnDqpxfRQawdUFv+m3TAzQh8KhTNw3JHrRTpdXagzmZRMJSFKvD5VP/NxHGx3H75UY173/UfCoeGCfJ8YJYCRVX0P3XWZ6+jA9+aw2tqOWKvv5boNSH4ga6FnRCr8ElMCQ1hxbgPZDM0VGwrqpDwehhuKMD2qgdnRyeyVUSMHTYfMhbwWzaG6gZxKsKoWQAAgkr6vwEJi+xDUH6euNJvva0Cl5VXgmzf2Lh0eh5jEmXKACGybg4rXtVaq9Aar4e6Mi0+oboWAyZTGRbvURKQqdmhIMlaDe15CwgYKmxkHkEyLcTomvGd7Al+Gj2NWLajcMC2hwzeptmsHCG6F92Du8G+Zyxkypfg20d2mFup81UxEPlw67BCeomqbny2BMewxGrlFXSvdLgkrKg/q1l88vTUBhzNgcUivLndVeby9iR2V9D7AjEMBE5vh9THcmwgvXr16+mQyGN3PYXVEUw76PXRFIgkUBQx1Fqq54vNT7wmve6WZ/fdZE/yf9gxZBAg7FZz7K+coR4INdAPj92Mv2jx8/nm1ly7hgGtK2tVjVNyWATQ0QcQ6LOQEj3SQR1IsEIalDbGhtrIeI/E/fu925qTTQiUd7DegQX0pR7vmhUiURiuR6aojckrqdZl+i1oV36TCKT7JtW0RcwMohqqxsoy6re06ULZhQeIyjI36bomXDbi+yGjE11yv5yDFvbRa/cPSJGIUDgCt1fFqQ84a6d74dOzWiGd9e5A61p5qyGGPaWBKzzJ9RlmTcrXGWElcB+ZXRzqA3jlD5l2xCu9L8AFbp/7a0HThF/sicSp1abVpkm2tmyG6anlTxffd+d+rk2WVdq23IUk5Xo+LQZXS941raK/z6RVqGRl99g8Ww1ICzXD4gu6EyMk2RP7LHXj9keKe57jWavMxn6gS50IiV9e390GGquazDh7MyngGRZAlc/pdmtYqj1+7+cd8WthXHcjBK7209c+ny2o1YJvB1TGpsbHlzz0C9umOUVyQmkad9F1DrBs4wrOIUDjByzyShmJeXhNsAvTJozo/XLi/KeO8ga+LyVElg2Qg3k53vXwHlNxXkYESS21v8hX4KwBQ7XV5EJCKZBfN8SREUM/8/AA1zFMCZYKjRNlH/aFTm22mfPWaN8Wx3LHFVutQHvXGZleMTeGDAhW7fTUfckDnnuF/Y+Deb6iKH0zpg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c268af2-f4a3-4dc4-21bb-08dc804cfd46 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 02:05:33.6044 (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: RyrpirYUjuCAIwySfnRCdgbi6N1ptRGNHABvldiUvulFl2ebYLoypSxZBTf4ZwoQe2453Brg0WEXkcspWSbc4YXBumBtivWlJGN5ieCLDxAhbgGGtonFezSjFFF7Haxn X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9900 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);