From patchwork Mon Mar 4 05:15: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: 13580050 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2062.outbound.protection.outlook.com [40.107.113.62]) (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 C0F6079EF; Mon, 4 Mar 2024 05:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529353; cv=fail; b=i5FggTdgu5rPuZbV68A11XOyWDC75oyap/P57jRmRtANGREPmUN6sU+eiMR/qgdE2uAaFSUXaFADbAE5HJCq2xuxjgT9JEyVvjSngBEJBMIP8gRS8SaHxIxbNabGQrKs8Sy30rri/cVUOKpR/ZwH2WPkf4kPelwG/dUAKUeZp8Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529353; c=relaxed/simple; bh=PBx3L/n694IQdZjtag+8/+Ruoe7fNeo2Ye6oAKrPhtc=; h=Message-ID:In-Reply-To:References:To:From:Subject:Content-Type: Date:MIME-Version; b=IVI21fYqOsCic53XVAuDjHiuKZaTyG6VaE1No9SRHE94Fl7DDJvaVpj1l3iQ1J7Lr4q5jhAV7Du5bydt0I5xhJlI8UfkR2tgrp3GFgnCvdkUF2OXvpAP3bJ2bZ1b2J9phC+8pLShhVVNVKMY9xBK2Qz1CM7gb+2I1UYE8flHvVc= 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=GpgFSVBA; arc=fail smtp.client-ip=40.107.113.62 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="GpgFSVBA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QUuQFx+d9dsn1xbMfkGPeP3zqDXn6+gJF5MNdanwjp43BtBRebtTJrR3T3m4SdRttZna9TqocCcIxe4eKghJPduwzYzhD4JYekPeRVr3BY1Kn5wP2GprHw0UyrNLIHMujl2zHkNqZG6WIqnM4B75EezzP8rbw/NcBGQ/wJyuwrZZF7w+vwkuqhVRdIl199Wdg4ayKTAvaqRbLeL17MEISpOrUVI1TPC+d3ubx9ffQ3Ojy+u+Inoxp5GIPPl9InBFvHwBAgNc/D4Ub3ypn7axRL1+Xff3Nrt6DVpweiAukv1pPT6agSfPe/knDyW8WZ+41DTTwjZllq9zMP620mGLUQ== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=Az2wD6v576Ct5UYpDvDQMaW7Z2X9kaUZhppFYrgk5TUHRUDPme5ozMbeBMcHEC0fgepdKWy7bxyQN4LoyeVokTZeV3Sau78fBVBLw9jSRIyGypLPDjxQx4ntnNH/ZZhwxqjPF5vbLP6+vH0SnTrJcYfXWxBvayPiB17w8G76Katd0Bx7ONQ8KoYX/SeT7vA+0lqCEDtdUa1knwbsa8LWmpAQanCvs6dZQsL0CdsD7lIA7cYsBmdsw8gAzyhj1+2MxYJ6rXLM46ASIFRApJlsXLJy5Dew7Or0auyaaAHUc1nYBhof3tr8yKxknrAuHTBgMmCxVABd6DgBG6i0kEv2xw== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=GpgFSVBAPRajKFu9zDNUK/5G+4GqfBUuIgwYWMfSO7I8GiJnQoabbXhC103EBZMtuXrJNLTF0TwQsEAdE+IlYOFc/aedkIN3/4s9/kIpI8AhgoJHTju8sp2vEXBZwEfGF44TqJHZdsa2Fnl87+GM9bGlFVcvppCEExhQ/qWjrE8= 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 OSZPR01MB6616.jpnprd01.prod.outlook.com (2603:1096:604:fe::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Mon, 4 Mar 2024 05:15:47 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::1934:4a38:d599:33a2]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::1934:4a38:d599:33a2%5]) with mapi id 15.20.7339.035; Mon, 4 Mar 2024 05:15:47 +0000 Message-ID: <87o7buh919.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87plwah92n.wl-kuninori.morimoto.gx@renesas.com> References: <87plwah92n.wl-kuninori.morimoto.gx@renesas.com> To: Rob Herring , "Lad Prabhakar" , =?iso-8859-1?q?=22Uwe_Kleine-?= =?iso-8859-1?q?K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , Broadcom internal kernel review list , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Eugen Hristev , Florian Fainelli , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jessica Zhang , Krzysztof Kozlowski , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Neil Armstrong , Nicolas Ferre , Sakari Ailus , Sam Ravnborg , Sylwester Nawrocki , Thomas Zimmermann , Tim Harvey , 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-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com From: Kuninori Morimoto Subject: [PATCH v2 1/4] gpu: drm: replace of_graph_get_next_endpoint() Date: Mon, 4 Mar 2024 05:15:46 +0000 X-ClientProxiedBy: TYWP286CA0015.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::13) 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_|OSZPR01MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: a0306d5b-1051-422c-a1a3-08dc3c0a2660 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; X-Microsoft-Antispam-Message-Info: Gelbs0U0e8n5M7glvrCs7WP8seUmE2yyuSeXKy4fzdnsOsMrvLOaLEWar/RpRSkAE879y9VpvK3J3mdgb2h41tljsdaC0tSq5xHq8u/ZsJQIILaJoIsqAoq86Jyn2AUyFJ3gQLeQ2PB30iuwbbSceUkwc5b7mD6X+8SwnNXklX+bAng62m5dk7aA649+6JveMh/5qDtTrrTgWpXwpHvAG9PL30kUM7y99QYEuflBDqySAu1kQSbsPBBJgJydLtX3KxCrfMSCQqy+71d/MA/H51/xqfGYJm4rKqX1HX/p+nYsZE5HhtF3YFSzsxhEhLA4I12tt8eIuJl0Dg5KxFfDuQ3g2uav2ud8bZogsYiELxW+dA7lwwNLV/83z4pO8YR9qDOELA9yw+472Vjg1n1Ms6m2J4vfuVaukZDmV35Bk0lU1VaBMqhUXpzHqf9SalaY4hBOfoZOGO00w+AoCx78PIjDEEb+O5tV/V9Tus2nkaO2aOH+UUOu62rFa6DYPYlW81CHoq4wdpOfwUmVR+VsaCuTrxOHFIhFpW7W/AXUQ176fB+JIeDMHW5wgVlnzCdJ0fsIZiGuLuFfKbgdxmrac107T0puigid/GLlN5nvT5dQDogF0E3oPU5Pf1eOY5+RCloW7FkjxVcP9U6ZK29midoHcYupkELKe4/skJLYvLzEGXsMEtgaq74JOSy5JKNa 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:(13230031)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WonskMxYEqfGDHPcO/oyG4jSCVcAtaLFl5gull6P6urDc/vI/U3xNqWtiCJHZ1Nj+dMnvhK3r4OSABRx9YFswp+4dbFFobgeCTFHgOEFq5igxW64aj1pQYRlqkLtQIaQBje8s8dVzIX2ymrTjKAFrhTla9jTAlPoNwc2MtG+e8MMMyfgXNztBPYjKr7fyeFLvLwH62CmfBlk6wahdFwaPCIh8Y4OeXLBfDwe1rDN3SgIlicm+xpHu0OsdeL+++qvQ23LsL2/OtOnbhKpD+M5ZwYzKphMwIU0KdhXbUbwMZSnB3rdh5eyUsx2m2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XLEUD6OXVFn9f3Zc5MOzIIOuVwLurTk9PAWmbfydRsXYfLYFQYMqepI+PY0yZxjuT3U5qChpPd2Mp9opd/0Y+e+41PNDJ+V65lA3SU3ZEm1wyl6F7WojoVKCzoJA2LKigPykaJk09eSXRba7RkFXvkyj+mMLjXye4AxgrP4tQEegeolbCSoUV5xnfLiX9B+EG4QN6BlXglY8WI6wVrIgqoO2SRAiWA4GkcQQhH4+qByIbUM7eykQyRDqslF2qBZIaFAFxeZUYo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0306d5b-1051-422c-a1a3-08dc3c0a2660 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2024 05:15:47.2389 (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: Xr/UyTOcksQEwMT+pvwMtyOLy9rbICTLFfNj5KW7fdqoJI2T/W2bxTD6V1aWLECOBSB2kyNwQucPVgmjrUbmgVaUSnIBN5jqlx1/K353r7btrIHoTf/Yl7SIaS70vgIL X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6616 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);