From patchwork Mon Jul 1 02:32:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13717496 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010054.outbound.protection.outlook.com [52.101.229.54]) (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 CA033C144 for ; Mon, 1 Jul 2024 02:32:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719801143; cv=fail; b=Y7TJmco4BjhOCNQ+JV40xknPi3aG0alyAtXuQCwdp1CEMO5lBkCAHfNh6GSWKYnEju1vCWeVIZsB29rMHW9kZuDHsvejPCPS4D1Y1AVJo/ab870W3RhYNfVJBCnD7jhRWJFzdVeGHaG7WgzCuAvtb4uW2XIISconVIUhWpwKRj0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719801143; c=relaxed/simple; bh=WEITcrQ/kWE3HqZ0RI5jkI+3IbvSu0kSuhHWQYwp0Nc=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=qshKLTFTQIURMK0Lox/Ns9W3md2TVjf4SNBnIS+0g63wvFp+GjNXn6GYrPH5ptkEX7/7ZT8w2Ct1IlpyppSYGqlprvdSEp9npVEPTN5owRTaQZH0hkAuZpIyWxGQ5ak90+FvRmz/vesBiQuJeDGjTn0IUD0RBQFkH7MgMFm8QJE= 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=WqCw+t3h; arc=fail smtp.client-ip=52.101.229.54 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="WqCw+t3h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jdM7BraiYXSlGOdKNV4otB9LTVa4DVYFDxBjel2vixs3uLPLXs3acrp1Q/Hs0/jijVrBs9YP4YRc8xhuEYa4b8Jgy0rmmLbazNk4ALzTZ2pu7L8t4pmvDy4goPKCWKsnBPi7L/pevXY47riBpuzGE5VC8Y0wVtXLnYOjM9ZVu3a38WlVtcO9z4RrjMFbmA53fNlbB8UxrYUcOM0dMSK5iL6h8x/k0bJHHyeFkXU+schmWtOCVJ+Gzq9Z/ztLh5EoVR/fZjvjtc7trgv8ZaXkEYr0+ZXlxeES/zueBB9wBPjmKoTK2L3YwtqgOKinkak3l4JsmR7Fp7yW0aFyF+Sllw== 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=apLBFbhxk+jqGAuccc7SKowoAWPHLJ/lrLshp2SEEjg=; b=MmjA+OWFCB2XrLVbofV9GG4YILGo8kYvPYFQAAPl9XapY6OW+H7LNrQfXxUuEq9snYr2VJYc0FbYpvScmN+svaoINK73mNwUm2vQrDLVvJNnF/5Cvxp0kXmOATtcg2J+YKcE7Pt/JzNDVhzLIXmKdhaS21i7fidX8KgSR1qG0NIkJvksEpVVxhNBSbJeh97h2+VEnKbQ6ZskZmIgIjAtua98RvXER6LgmOX9Yrk0eowuP1rMxo79vAyXAYH97/VN6O3U8t9F3lxO3ApuIvem3nmIMMGTocN0sZNi+/ZfZQ+zPX0UDG7wwbwZxmmBGK+3RDc3lR1RIDxkWqSpe9j6Lg== 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=apLBFbhxk+jqGAuccc7SKowoAWPHLJ/lrLshp2SEEjg=; b=WqCw+t3hEkMZ+ez1qXhD2dPDZ+UxRoO1lALqBP9q+HLciKglJFY/aJ+CGNVkidnNtg+J6mdK+zzm/ymyXUvDwU6jRHA10WaLHzMxDvc7y8o2uU8hoorZNCxwyK10nA0YAKpCk2DANN6x+H00cTxb6opUObTIgIBSh2Kt9aqiOLY= 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 TYCPR01MB9627.jpnprd01.prod.outlook.com (2603:1096:400:193::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 02:32:18 +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.7719.029; Mon, 1 Jul 2024 02:32:18 +0000 Message-ID: <87bk3h970v.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 1/7] gpu: drm: replace of_graph_get_next_endpoint() To: "Lad, Prabhakar" , Alexander Shishkin , Alexandre Belloni , Alexey Brodkin , Claudiu Beznea , Daniel Vetter , David Airlie , Dmitry Baryshkov , Eugen Hristev , Florian Fainelli , Greg Kroah-Hartman , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Neil Armstrong , Nicolas Ferre , Suzuki K Poulose , Thomas Zimmermann , Tomi Valkeinen , coresight@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-staging@lists.linux.dev In-Reply-To: <87cynx971l.wl-kuninori.morimoto.gx@renesas.com> References: <87cynx971l.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 1 Jul 2024 02:32:17 +0000 X-ClientProxiedBy: TYBP286CA0011.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::23) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9627:EE_ X-MS-Office365-Filtering-Correlation-Id: 69f37b87-c9d3-4b12-8739-08dc997606d2 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:13230040|7416014|376014|52116014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: kYHnzN1SqlFcPJnqxbVoXUfbyibnasg4UKSpLjycsOUmexUBIj1PV86qhzGWMEMsoSZSDns59jsLWK8Kp3wvfnb9y8AaYiO6DLFtXbv7vTVGQwfj7ei8ecYiS2uoagN+M8JfwxXTsTkZr+3Bu4XFHXtdCPuAZD08s2YJlxqWlqAmXIYJ+/eOKPoKVyLHP1vndujE6I7TxGZFvMpPAEcMr2IlKxvS5bwq0TJGKTI9dbXbT3GYl5deIa95lHFnxRG0eFz8rsGZeFrXcxorc0XwgqZVSoWAAKQATYqMEUAxGS64xQ9Ij25K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dbALoj0s1QRWF2f/ 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)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 34rmV5qTuiRmvRzU/Sd1sWI7g5N1jEUYN4pB8H7YKwfa7BozXuBopeXTc2TBKqV/wN3Yl10arg89nSYx0g5/gm5Txfu+Uaw2dZDtYN6f0Cf1eTfFcUYn+kW2Hry9npupA61XWgW8jPbvoL2WpEIPRH9Yhe85Z0VLnYFlmdJjgekXRznwHbVPSBY3OX5dkx0kGv2kU1wGHydWGdc23C2snuvADptXEYL8tCSb82ZamgnijKkVtVRqi+J+lMig+vMxiWkO+ozBYezXAENxDyLHQqqbrKe4gW2ITxhGgmsUMyNdmXnE3asR/AwtZEgyjUk/18HbMkblgGO/vVAkGiuCRR7lDK7BYP449SMoex5UXLdLbcZ1OOhvgds1ZDVrY7wObg9GKi5YF13bqMYmA4OR7B5W4ThBIbjit2lNohpEPa++BjJD/D9iWwrzyjl+G3bJX1yE9gwiPBOyYhLI0ZzRRwbQrissV3F3Phj5VtQ3LYasOPLj+wuJAP3l6prq8PPI+7PRd5OzIlAyWlTeFv6B339YypS34rKpJRwhBxADQAeDiOFMFhogd713F+zlz6KP7q4fg/9nloIgvh33UaAxYiUOv5Oc436ztecZTT8OOKr0L6ThQ92XvMZeo8+11EWVTZ0CDj2DrG8T0tR/v06Q33nw4yzE/aqpdXHVBiscmgXOGVUUxT/Okf5kY+beXLv+f9KyeT2dF2tJRRm12Z6Ko+imF20bVpATrVf33KI6IaQL95CKrqgB7AVH605Ii7tyMK3NsBYLceeQ5WmKXaFN2TwXM8eG8wyRLIMkP/zJHd8p5QoQBmSKpaKT9OaIUWdiSAIorarRDOhUZNZbj8rX/t7TXkENFbvR9G1w6BNL+n2Qu6/ZxoDygo67QSH2dvl6cawxYCfINNtNoAaz5Bc6muTfAo8UD1vy2evVKUYyx2mJIKJcwU0NJDNUk72UNhit8YvPScsrzw96ODDOMmgBvIZAOVOCY7EPX7VkjxTC/Mu6z6hSqGuQ6CLZaEshY11a44IMyEui/wj4irq3M6avJbumggjwv/YuUKSquXtk4cy5kvA/kfwwULZdwYX6mBqFBU9WdSqMKQH9aWpVoNGXQjXYKJxeJPaJn95fXpd8fFkNjRBAGConLWYwzqPMZG64EWc4MtRBl7fr0rXFFMTihNh28SPqD58om+oY6ToucNmof5kexWiSe5zuyu7tF0HMxZHUJX2fH30LKzdU+yrbw3kbHaRBbre7xxdXqyC0h9VuWy0Q/3ZKObLHZgrswTKIVzDwckw2eqyr17w4AtOHQn0QiNqB6GCJ6NyrfKAiYweUvZD79SxGbdqbjqS2oadkBG44tR9W7Ug17+EGhtpSQC9zUvDdmb+r5tfhd0vQAm1piu7ZgOhUPkSgxNOwA0qeyyBtj9MQwnuYAjSsAHA9Dk7uuRcF5bHdl2T9bJQ1TB13OiBLmdMZfTRPp40DVJPD14muI1TYT5+8rQ6RMKFBud16ur5rnzkpa/iMKVgXjpfDtOGwcqrOtF+4/rZxBv4Iztuqr//j+xwTnoLM1YeYDrvfZoIbEHFwokhKgjSAomp0va1msAVcB8UUppvmQWetR4rS58t4L2lgVWR+h/oXkQ0F8y/W7RSs5R/YNn356PQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69f37b87-c9d3-4b12-8739-08dc997606d2 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 02:32:18.0775 (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: gKF3SbnxvgMPdB4xHSZol0CFzvZghR8L7SjrTm6pt/HF4+4K4qa/7X9t8rvtpCYrhb9Bj3M69UPoIoDC0z+5BGz4xlTgd1p4UfPVhHB3/q18+Fk3Xb+GIIH2vJeskk9b X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9627 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 177b600895d3..b6b2cade69ae 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 4618c892cdd6..e10e469aa7a6 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 4f8f3172379e..8c29b719ea62 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);