From patchwork Mon Aug 26 02:44:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 822983 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011058.outbound.protection.outlook.com [52.101.125.58]) (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 640F6101C5; Mon, 26 Aug 2024 02:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724640246; cv=fail; b=MwHZVgzXnajSV5/1Ml9XBaxWOewQbg9l2aDyUAJCZbN84uoUKg1i0eQB988ENzUCKdEkot5O5mzQyeGBbGFyTAvkFfYZBBg0ePhvk6H734tUPuR4R2k9jl3DbdMs8VhyMv4odZuUY9ZU510WKapOMxOC1IL899wNC60+62SgZPo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724640246; c=relaxed/simple; bh=OLL9fmby2VUIfgYJrKXl+ccGzd4GaKtMEheJMHrvnFg=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=iSWXHQx/e21q8NEKptAn3o65GpTQI5TpLDlUpYmkAWR/WN76rCLH9YiqivHw1nvCR/yL4KkiEGp9cpUaQ21fmfYw1YJNsC/bDFdeTWrm0ZpnWi4yaFAgib9zkypGrJud+28plyd06e7JsuQiIU5GAAROpI7bebtvU1zph43SeKg= 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=GkKsSZ82; arc=fail smtp.client-ip=52.101.125.58 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="GkKsSZ82" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SND8JAg7ED/7ukJCIkuaOleAhYgD/G+vIOoURMU5RaGoOb7QSf1rJRbwiHKSzxWElWAQRjWo+lxQw4HiCMIKvcOagYvE9O6U651vs3Aw2TQeyDQmYoVCagozLK8bCcodJdM3qSidCjCLnc0ToMsgdrJtdbwfH3nlQAtK7pqs30vvBHzFZXHFcblx7bpg26+33sf0Cu3Sb+UCLGFERD/kgHAv95q5WZzhIoAdsAiqnhqFF2pd2OBDuXPTdK7DX1tKMpECZAKwtdOFamdOH4F7YOzchjSqJZPAXxaYMKJU+xTz7jLkLKa8AYqK+ceWJ27pd7CUdYGoSupDsq2Pb2XhDg== 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=nqSzD+TIEwJcbIxbpPutR6QFJxPtDwZqrLqSIzc8yHw=; b=SyUcYnQMgv8YSpr93SO3Wy+B/ujWuah+uaTZu27tEitBFbrEovSZ5D9dq2qzNP0VodhVuf+FF6jtCzqS9wcyg6Knev+f99/+j2A8PhL78mvh7iApasC5e51AevT2akQG1E4mPxGppevm7wHhlkAUwf5clcmYW+H5rHsetRAhXskHelQJYuUwwlFsX5uauWLkviaa3OK4905OmIYiCHNvLJKF4CK66rH4SIGsFvr0MufPEQmCOE5EXyRiFeCowKPOh+zci8f4hvcfrE1VSgox472Q2IyZwYlY1DKtvZrG/07ys7VwZcwx7uWr7BpDmCHcQI6W14Kt/sbwnIZ8vZIotQ== 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=nqSzD+TIEwJcbIxbpPutR6QFJxPtDwZqrLqSIzc8yHw=; b=GkKsSZ82VT15gPSob8vDZyZY4IKSTtkLxS0qZtoDJgHX9r8+ZVdswPHj/qTGMGikfijio2sR0wiv1gqgc4s5hBYIVKYMYKiQx48XMAu+NGWN1vgotpPF2wpLKP8SxGRzMU1Y1qcTTWtbwoctPsFuw7lLIROJaYeE1dBZ5gvT2Xc= 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 TYCPR01MB11547.jpnprd01.prod.outlook.com (2603:1096:400:389::5) 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 02:44:01 +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 02:44:01 +0000 Message-ID: <871q2cq9zj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 8/9] fbdev: omapfb: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.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-sound@vger.kernel.org, Sakari Ailus In-Reply-To: <87cylwqa12.wl-kuninori.morimoto.gx@renesas.com> References: <87cylwqa12.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 26 Aug 2024 02:44:01 +0000 X-ClientProxiedBy: TYCP286CA0252.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::10) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB11547:EE_ X-MS-Office365-Filtering-Correlation-Id: b8372222-0182-4479-3209-08dcc578f136 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|7416014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: ki2zNC9xe1z3o+UockJmAMZ0Hdn1rnFW2luojXSC4O221+cdN2LQzviQ6307XO/HYI1SOck62Bnr9unVMyDiOrYTXm2Il6PqxiB/9vpY76S53HlcAP40vGnzVDFZoOXRdKBf6/XGsnoSdoSmJgIguG5elO9ImddRHQWRnzGjL1XGkQZjJqOAP6n6EXNgON3hwADAcDUfuD2eDgtIXSXkuSyf6jNPc9tU058thm0NFfMRb+2608sSeXlJ35HUMFtH6DC8AlJ5rXpUWA0jHC75cXi8jzv/WqLytHtP0NWW1iiW1YRfbiC0V+8oh2asfExU3ix62GO5fRFhrIhHoDSDZhPoI0u4EQ0kRGZEIwl1P/Wuu2lOQQ8g5qkZpHwn978RTIpC2SZdz3xL3L0DhtWVRmdM0padMcwbuP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; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(7416014)(376014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: apQxerIzDBN+xcNmxBoVaHWIfAuIIGbhD9Jo6aTc3NcGDLDAUtKwpJJLzVo+DC3f7j0GgdWpdbcl+EisQiG7TJElVmT2RbSSmsS32ax4b1R2nhGbKrR6KbgqpupbdmDqLQscs0XLqB716EgJAUaNTpaBK1+TC2UpMO2vfRfaXdrq8BEtRSXe2ecwJRafBX55jse8lud8INvnNSnx97x7ruUjAUhh9Qy6adC2JS2zecuEPo/5bM/s993Pz/4mmVGSAwrjAj8jsG0z4N5eyYezl74HSMkPUXDCQyIKCB9eAHl1sS2cp2+RnI1L9MlJF+e8UwrIsskAUXRSIMj79QRPe11HkNpRC8OnKuSPrfBj4uMhBcwtwogcPDVcNOnNCL7NpQfwbTdEnwlzrBxyt9/XPSiUTbggqGqwSsOJn1BANhwGkvBoAbdKvq/s1nRynnWYvwlHMKrhd3lzU0jNjV8fF9IAhDMsP+3PFYu8hVEwYEwRlnY/WIa3WpS/TWzhtUU0PpZHZzeS0WEriAc5Eruu499XpFGhZCMnnnq+f14zLVzi0tPCcl7iWtE8yQW8r26kscxp9XzaEKz2FMuNeKzf7XZsneZmXtXDo2krAh/DVsfYgXJ3H6FR0M5IWQOX05ik68lqVrHBxWwzwX7G4HBUFJzcn5KnWwAGbq7BM8XbGXYCAsd9mLwaH1P0wecgW9gUw4qD6zRt74IMJmIrRY4GRAZkRUkgeBbRQhnayp5TFDoK0zXj/EHo8X4PB1K3Jjws3+81Bm9DU8MJe0x+xruzRHN+5HBfkbRwlRJ7KUqKprKpop1miWldERuZb+F5+I3zKRmogcgPlNJrIa6DUixuHVtxT40t0mPzsDVQr7kl2SxgjArhUyNPYbTa2YiMw++wRBMYBLkNgwcR1EK5xr/e6xEdi9qF59uAuAYYZP2pyhktShi1d/XmoDaqJY0IqU27HXLryvyqJHgCBKZyBdVkFr3hiVQBm+ZkIFK9VAQP3xTcT+2ySBF1zvOFvvU3EdZeBoBJu8DYXy+U3+jcT5mIJmn5ylXELuo6Wy63smwnfeQk6V49uFiOqc3qvhrLs26KDGboIjjHdCtuJ6YNKFp/xlYN7Tqc2lVj3ldCu4bVzEh3xDaYCrwIQ9uddmbVvaK8r7FiD6YxGmxPguixpeRA4wv/HPyEY4sV1pQavL7TqaaVOSp6SkWxBx1c5MwLW7CUFgUosCIoe482pvs5n3stWu98MiicfONHgp4eCfcsQrwPFlCzo0SyGsQcpZCiFern/LZeK+qaDFGpMDoNlZwFRBrAjRkCqet9OG0Yfp/oh/t3+qUrfmpLsfSEEzAJ4kJc2pA8vrYQSKN6FhQgQOazE444uCKiLD6ijxMdKo5q56Fux+MMpdmkA/81OTea+ztzIkssuuDbvLwDTXb4zmak2AN1Odinz+QaYTqhZZdf/FysDm9U5bgCvfFFhFercefJQCw/+G75rkpxHjgXRJYViS50YxeXQaMwo/giWI5wncJDBNJAZLUo5SOS+lLaoSveQ+ikaeFvk4J6nLlWbKlSJGswcrmcLNM0yR0cVUaLDJFXlBVwi7B4wVuLnaDd6sZkAp0JAc/kYsa2qQj1dTy6uEijQz2u55kMbffkFJG2WZ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8372222-0182-4479-3209-08dcc578f136 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 02:44:01.4266 (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: hqpvqowL5cMtPEkBiCoLsc128ViUTClvKIu3F36XyaRp9E1/bxhuAEGt1A95pos9JRXqfBHrzqLrre+2mtN2Z4UHGTViceAJVKxZJuwKTvlsgOn/xiE1oyBVtP0x5Gae X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11547 Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 3 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 66 ------------------- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 9 +-- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 +- include/video/omapfb_dss.h | 8 --- 5 files changed, 9 insertions(+), 80 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 7c1b7d89389aa..395b1139a5ae7 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port) if (!dpi) return -ENOMEM; - ep = omapdss_of_get_next_endpoint(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) return 0; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index 4040e247e026e..efb7d2e4ce85d 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -15,72 +15,6 @@ #include "dss.h" -struct device_node * -omapdss_of_get_next_port(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *port = NULL; - - if (!parent) - return NULL; - - if (!prev) { - struct device_node *ports; - /* - * It's the first call, we have to find a port subnode - * within this node or within an optional 'ports' node. - */ - ports = of_get_child_by_name(parent, "ports"); - if (ports) - parent = ports; - - port = of_get_child_by_name(parent, "port"); - - /* release the 'ports' node */ - of_node_put(ports); - } else { - struct device_node *ports; - - ports = of_get_parent(prev); - if (!ports) - return NULL; - - do { - port = of_get_next_child(ports, prev); - if (!port) { - of_node_put(ports); - return NULL; - } - prev = port; - } while (!of_node_name_eq(port, "port")); - - of_node_put(ports); - } - - return port; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_port); - -struct device_node * -omapdss_of_get_next_endpoint(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *ep = NULL; - - if (!parent) - return NULL; - - do { - ep = of_get_next_child(parent, prev); - if (!ep) - return NULL; - prev = ep; - } while (!of_node_name_eq(ep, "endpoint")); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint); - struct device_node *dss_of_port_get_parent_device(struct device_node *port) { struct device_node *np; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index d814e4baa4b33..5cab317011eeb 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev) if (parent == NULL) return 0; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return 0; @@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev) break; } } while (!ret && - (port = omapdss_of_get_next_port(parent, port)) != NULL); + (port = of_graph_get_next_port(parent, port)) != NULL); if (ret) dss_uninit_ports(pdev); @@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev) if (parent == NULL) return; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return; @@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev) default: break; } - } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); + } while ((port = of_graph_get_next_port(parent, port)) != NULL); } static int dss_video_pll_probe(struct platform_device *pdev) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index d527931b2b165..22a6243d7abfb 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include