From patchwork Tue Oct 15 01:28:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13835643 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 82B98CFC501 for ; Tue, 15 Oct 2024 01:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To:Message-ID:Reply-To :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=wh/L1bAIdslP4DMMoq6VB2uhENE/TfWDMUfeLShKnWg=; b=JbmO6lqbOnhmERUDO7SZWO6NaG kJnFN289S+QxslxUi50Eas9CMLjpdFojUio9PY1vc3xZrkFHmTTU7u1Xk74RWs1ZVhmxhxlJkhoku kBHyB/pABksRbFHY/rbIGDJ3PbQxbP9IUVgCQxgOCcCK1WortOThvIJrWLSrXRhyg3kCyISECrOQx yuVUWaRATRFcVYq9WvR1DMAzrivSBdHzff2yq0lAWtf5OemPk13lmlUTXddw5hPiQA052HyEHp1gO zf95Fxxe55D47RE8xGnbFysrNZRU6O1BDkbmsITYIQm/DU1BhDgXAGOb6C8vB6JLz7YigGjlaAsEo h4QdZFCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0WO0-00000006m4S-21Dw; Tue, 15 Oct 2024 01:30:08 +0000 Received: from mail-japaneastazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c405::1] helo=TY3P286CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0WMZ-00000006liX-1woz; Tue, 15 Oct 2024 01:28:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hTRM5jl+fV0ULQjF+J/JSAuueAh4UStccJ1a0iLnB24Kp3+lW4wrjWt3jy0vyjXF+wAeDq1cbuz1Q24KttEWXCjRw+ZkLyRHTPEuWhL/lvsmQ82PkIO440qBw0trx6koDINmTNqkFSAwWFZv7YayB/EeeyUQI70Ute3mo3F/dUA/wQuUnq6fMXAPChCc31MKx2r5XMFMNAKrX6WNzJdOVwDd28kzzsy/+D+TuW8Lq/SIoBByTw+Nge4FEeZABF5eQIksj8VlvoDKrFGcTXiiWnZIm6K23aiind2iIPAdJ2KVgjSorY3t/83igdfUO2bCPxCunNakUsiyGoV18mjbHw== 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=wh/L1bAIdslP4DMMoq6VB2uhENE/TfWDMUfeLShKnWg=; b=FUwPaxHCWrR6gAg1vvHXzjJp8W6zorZfmDbzTxg2mml1e2+QW2p315D1hdpE+NZ7j0k/toRtBxtxfW49dUJYXp5ZsKEgko3fTUkjMZSEYf/ypl065/p5vmNzIlZk0/bXMhxhxQ5GeFSGe3sjJZEyB2/aq5SDajQHBQ4uQbJ09zB/2yCjalgvWlrMLBJkMfZYykYPHr8IftRwQ1R5M0wQtJroL0Glr9JtR37OIx6U2w5I221uYPd04hdgt+qBJK5ZBVuGSA8zxWAUXMa5aHVtV1AxGw7/PHuCiPoK8EgD/Ig1/Uyc7hS1eq/3Dv2GOgmIx5g1WZ1mvCUls/zJxTQGZg== 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=wh/L1bAIdslP4DMMoq6VB2uhENE/TfWDMUfeLShKnWg=; b=lG20H/D7vW5j+T60akxxgAaXRVf8E/61i5iMKU3+ofFtscpP1lAGsO1rmsfJKfiUNAHpUu18v6Ct6cxIRA/N4ruoWIVFGi71gqFN8NkTM+dBBk7eeEwpQARb1BfsnkZnY2LfRTtkBmUdC7cz3XqARb1gne64VyTVXfVuv4stO+Q= 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 TYWPR01MB11377.jpnprd01.prod.outlook.com (2603:1096:400:3f6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Tue, 15 Oct 2024 01:28:29 +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.8048.020; Tue, 15 Oct 2024 01:28:29 +0000 Message-ID: <8734kyqhmq.wl-kuninori.morimoto.gx@renesas.com> 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 From: Kuninori Morimoto Subject: [PATCH v5] gpu: drm: replace of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Tue, 15 Oct 2024 01:28:29 +0000 X-ClientProxiedBy: TYCP286CA0224.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c5::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB11377:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e588275-3de6-4bd3-3ffd-08dcecb8acbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: 1DZLAwPY+JPzglLiK3M42Y9Z2aUs8rCZQRIJpmLa1fnnsuqfGzCbsZ8WF+0Zt4SlyxAydXIa+q4DANkdmoAKXB6K0zgIN1kGlbjzhxD8kal9w9IUXWTC5GZ87niA4oFpJPdvAkMGmuT7UxjBOYMu5oiMRMPsRrifKXqHEj/diVJGh5lqXJxly1rJO328o25fzUYhh07Njq2o8UrNXurqWcO6xi/E5pGqwSZ4uRQTwDMf6bL/DfWkbY8RibG+dcn3u2fZDg54vkFIQJkdT4bYhXzpqQJVCHuIsrUEDCF1nEA42XLOW7p4BqSt3U/WxvenJS8Cnkl74Si88Y7m+Q/0kp+neufyEX4s0GEQOVZv6hmyIy3rm0i3qrpp4DlSWahrFa41S1rCX0oxXLS+2gXO7lvIXmNdyDD1Venj4MGXoNnbE5FpYAlSMDsy1vCv56nMTgWglTux78TVFO7quvooWWicPn4oqCJ+rlNuSQD7K2Zsnu5LUdnu4pWPB4dD2gqJB5L5mmu6El5u9ccJUnr0aeqBfy+MGuLdmEAszYTuJmKAm4brMvuaQ973ZOjjmgi5BXYEGasPGgIAzK+VM4otlO6ftRSCOw1XVt2W8BLjaPL07uvpRxZotcSx0XJqYbpn2ipngWPKQRuilY0uA510LwrhaGQYez2ax207XFEltdCLyc9S+7piJ4kGj0ZPm31wcdDTWuWFafEJAnis4g1kQvgh/JHjtvyFVP80AxFeRB2BZT0OBZDDQCCfKnSRl3ce+5qhpvZAWV3RAdlp9ig5vkKwptn4QYJY/rW/lCNccCaV7u759mJbgZM7vTmwDai758k1G0bI143ShdAd3wZk3JaWJt8sCe7z56Bz3HU5NegiAnpYGjBicyMzP++Sd1vxdFUYqjNqTHNJ/T4+njC9GuxxUpd09/M9SvazS12anWm01K+sVuhl06Ety4gQoO3aezYAUpyNUHIAOHXBx/IdMRZor5rgIEh3THsWs3bLnVxrj0dpoKgJicJ2nWFzRGRmHSk7cnAgEg3X85B8pejjQG75rwW4mfYRMp8houeAheWrT8YYtBvIu9uREQqbKPlP1lVeUoUHQm9HRL7JFsElUAwmpiTBqSoGL8UwTBekRyJ5e/DVu4rABRtko88S2+LjQLJCNA7xttnuFAW3Jj5OmLp3UWnAgSyXMCjvBqQ3u364yQ602xr3SrK2pHmKN2b9L2HbUpoAFJBUiieC+EXjpdO+Td/M86Ppnc/Hg1w84plfKvBEGyaxmiSZapn3GF6a1r5lk6Smtr2qwTLSdBkOFPRVRPygGGpy13EzYIvPX7bRtuCP5m+Q+jNy8TDtXENPpIfcuJW+DeRDJqAwk28GRIBISSEQERDn/DR9Knv9ulU= 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)(1800799024)(366016)(376014)(7416014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kqAhFcXXNxJRk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O/aL6SE+exF6fPBjZahlXujvJBVppryvmsMPblgpljMNgV9r6901H/26EeNqsrUe9SbInYS9pWYzTbySDCSUYi4wWC6OiYOh3l/obCzByNscG9BcbfN1W/lHQAcLmftUOOFZ1muELBmfZwj+AYMMbRtGorGHptr2rD2hhJ65jawDEgBdbr6OqcTcpIYdS70dpT2p4jZRuV/1SF9p7+5X+tNpqamJUbFcUSM0LCfZWug+VHhjCxpFcP1kSQW4+hKGhzRwf2wFybITQt+5//LN4iZLrHvcnUfXZOZZhSkmNcvPKZPPs3HP+HB7+NtKWE0d2QZegH1u/Zjb0++MP6TM6xHd45cR2RH+KPe32ccq6r0+FxKNNnGsB0fCvFlnSHN87ColclJzIE8zJxcTuYEsYCmgWlXYeXFnky1+hbpBA1mLLB/QTYUZsMmukb3Z+ko3xnvUhl4vQ0PF2Zzi2UtPttrdpBHxNuUa4EO8/40QDTHO6DA9eQjDKQWpSO2xnASDSNoPG/YOFBCChrXu5lFvvl5V/BCA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e588275-3de6-4bd3-3ffd-08dcecb8acbd X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 01:28:29.7186 (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: l+p/exHOaasbob93rQzju28r/rUApeAUYWYSp+mKHKS3qtMN+bptAH3oyn8C4IcbZRO0/BkJNNb6uvXjKDj+rTMYkY1mWCTHhgQ030+zKANG+ZHy4HnHTANTkmQMW0Jh X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11377 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_182839_514876_FC120BE1 X-CRM114-Status: GOOD ( 15.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- - 1 month passed, but nothing happened. - rebased on latest linus branch - add Dmitry Reviewed-by 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);