From nobody Thu Nov 28 19:57:27 2024 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011033.outbound.protection.outlook.com [52.101.70.33]) (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 E331113CFAD; Mon, 30 Sep 2024 05:29:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.33 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727674163; cv=fail; b=nkrcsf1P+eK1yDyeaqHv3Etv0Cr2d0s+K/XEYClkbyRxA38mpO0grwO+DH2y0wrJdHNqa7C0ByzVdTgdtRfw/uuUxjTTA05xAjJJuxJo+puySvoxSAvY7yOLKwp61PnxmgCeX69z8xaDXx4y5CUG0bcphaDa9JAigXGSwEqg7CI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727674163; c=relaxed/simple; bh=/jfU+5d95ZrmNkJEOzJYTV9YUhp550hJcKgQWbdFtQ8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=TuvBXkbzoQ5FlzVzajgjaUfvW227WySs4QwbcpkSfB2HaRKpxxlZw7Uko5sIvcmfEkOoOMDUoyyWcPP5foGvk/XJOM4sorGWq52Dzfc2ZUC86T6BZ9keTTMFbI57abgtIodNRgozf3EVD+HhmJxPvvqFM/Hg8aZrI3eJjsSIB0g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=mwyOwt7+; arc=fail smtp.client-ip=52.101.70.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="mwyOwt7+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gE9b2wfaQ2ARL8XN5y/l9sa0m3lmwkcYv+LvD/R6cXOZALNU2jDnJKpaQS17szpblY1UQ4HyVVfTW6MGlh5fGXlioVd/Xgbu2zRx644/hPZ0PR98MRvFKkz9pDrLTllUuoYHct9GzxYa6y2CBQEybRXvN7oTpJFeBkerHu2Tw7BR2V4F2BYYNehiV3jhtq5LemFMNS4ShPW82PUwR0vMq8V7xTrQ6vdrOzLU4LU6A1QrMs77Yb1KkFxzr5zrJdcK3liU9Ian3JcwGzBUcYEMZE2q9roKxcKdKYvBxpYpV/fXbNwIbL33xvpYzr2eU+YfgpvV5Xo+T17NTxY2GhlGCw== 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=f6Oji03SVoTMa3oYkLGr5ybi5qGJHtv1w5u6U78+rm0=; b=waUnPnJVr5m8ef4hLiUkxQz8FmrHzFAvIYz2OOrrXXmYgGsQKLhLme+JmlzNJ5KbpTjxrdCX1t/yI+KnPurtBP5uVOTe3mHpFgB+rxIw+kFDGTrqNRS3rkGccgMq0UygGOluJg3ivTneGvETht0EXDU/axW+cV46psL3g3LGtbvOQfD0IqdOZzcdd4MHXQAJgzJm7fHZaxfb3NiRDmcJ5sQUfXS8WhiYVC3NKgq+F85FEEp+cbqtWJyk7MdGrjDKB0vgGyiUhfF4K8aaRPlr0fo3L2+4mfkSHcFoiYpa6u0ltnG3TRgo5CyxVAS0eGpwjzSa4m9KlQBCQWSDytqCAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f6Oji03SVoTMa3oYkLGr5ybi5qGJHtv1w5u6U78+rm0=; b=mwyOwt7+39galNdwBqZv9V6nA1wjlsHvRltld/cQ3etxClTf6kwxbEvyLKMXnwiZlnCV9rlZPpW7jySviBDNRhV16ydUep5xs5HfjyYSmiYskbNjyYMDkXehr3OEc+qjRK71F5g2Z03EsBQY/gMtChmoKguEgc6B1dqrNZDQAmNfCxQtpzYwocchHXaI/urt+/0/9rgLZxVBpqnVdNcb8VXOkDCwe4SHv7+VhMB7mSjUs4riTArNyE0w0leJizfq6WeSyuzz2/sqXnZi5FXaGJFPu33o2k0XMqnG/8O87E/mcFT1/LW5GTBCcD5nzb6zU/0Gx47ETzCdjWJgILfRrQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by GV1PR04MB10536.eurprd04.prod.outlook.com (2603:10a6:150:208::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 05:29:19 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%4]) with mapi id 15.20.8005.024; Mon, 30 Sep 2024 05:29:19 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, quic_bjorande@quicinc.com, geert+renesas@glider.be, dmitry.baryshkov@linaro.org, arnd@arndb.de, nfraprado@collabora.com, o.rempel@pengutronix.de, y.moog@phytec.de Subject: [PATCH 3/8] drm/bridge: fsl-ldb: Get the next non-panel bridge Date: Mon, 30 Sep 2024 13:28:58 +0800 Message-Id: <20240930052903.168881-4-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240930052903.168881-1-victor.liu@nxp.com> References: <20240930052903.168881-1-victor.liu@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:4:186::7) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|GV1PR04MB10536:EE_ X-MS-Office365-Filtering-Correlation-Id: a3086a82-9146-4f74-c3a3-08dce110d508 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|7416014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?daaSKI0bwNGz6wXcsluKvQ5CHNFzElhbasE76pDKx7yPQfhzmur3zilw6def?= =?us-ascii?Q?q8UPDf/ZrzOhiLQrWl9uRrk+dh2L8nsLw0W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?us-ascii?Q?6JC8WI/rKR1x7AXkOYwAinjexdlrXjygC4QiYI3t1lfWL48mMpr4SeXCrLJB?= =?us-ascii?Q?y4wJ+K3k9gr9gecgJiwDPYxvTpw9yiYbpudT1d4M3H39FqRFvQADi20vsXOD?= =?us-ascii?Q?TaNxUchdOmBCX2xi0yQkBZzomO+M0uRoh5CWdD5lJYkg1r1eKY7EuNLfctIr?= =?us-ascii?Q?Uc4b7zy2ZnSmtSi0d81P8YCS73Shum9Zwm0ljmJLzrF4YKaEGWkN/y2sg49B?= =?us-ascii?Q?oyPUTDurVjK6xX2+FR3bOIXpiT6Xbf1ptOqlPhmNCZmBO+nR/JSafofSOAH8?= =?us-ascii?Q?ehD3Mn2nUOi98X421fDP0EAzEfVqGUk4SV4QGIK88R+xIjh2XEIdkhAAPOom?= =?us-ascii?Q?L/+i0oMGKFcBolNISvyIuCFsUJF3+g/Eg0OwJH+YbzVAgFWyeRpe21iQmBXM?= =?us-ascii?Q?fy5712vdceY5GVw9/B0A3ky3MEuLlmTvzzTUJUZGc+qg+kN0jw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(7416014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?H2rHVBS49sSFI0srMLVyUATsLKbX5ri3GAOu8Qb8WNuU9lKZ7TRwF+qt7jPR?= =?us-ascii?Q?wX7NBpQkftdXSTJQfpFPL4HHyDeW4/W4Sf7yyNnSvoDvr4jGRbl5L4pee49r?= =?us-ascii?Q?eDu8Eevwnjlwchmoak1OvNOrAMdwuiBWC3/mpHk52U0QhfRJ6g5hYTo8asy5?= =?us-ascii?Q?k4vwHKuaf7NhEFhIZjPGJNSbJI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PtvM6F3/wRC4FUslsGU3G8X5RKAp1CyJFeEYNYu3q6nBQY81RoNu5?= =?us-ascii?Q?0TrjfeXFuo8shgGeROVTAD4OIwy+6BOOwhDOfSJCGwUtE3/nl0YLT4uMSybl?= =?us-ascii?Q?0LPhTgR1jD0G9StZhDHpQHprBvi+1einWMbxW01M8t1dTa/rDu6BI945ypyG?= =?us-ascii?Q?7/NkCYgkop6JFZbvXFXc86Evre4OPcYdYxZ+b/r3jlweggtw7nPSBOBYhe56?= =?us-ascii?Q?P0QcbLJcuNa5mlqpdllwS5hjBZbFI9tM/CRvpHkY9xmH9neHPH7lEPX052cL?= =?us-ascii?Q?m+g1F8+C4RmqoeRISFvoDf3t5VEibBOm4tN8Q1mE5Qxo0SmHFIimSN6mzotN?= =?us-ascii?Q?XGIrtnuxg3x6Knbzi8Fjfi4x6m2sLp5latUtLhkVATA81EnFhq+DlOBjL01c?= =?us-ascii?Q?VmBGQ2nopydlmbP5mwsSVQAmuDxXPtAWhRdRAZep7GjK7xrczFdhbL5vUhMr?= =?us-ascii?Q?JOhCXBOJ54bL+lsd4Xuve2dWLizbP6u9s8Q8CnaP?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3086a82-9146-4f74-c3a3-08dce110d508 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 05:29:19.1407 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3hScZlPRph/Tqt2qM6qUMY5uAqgqqzOUwatvHWeNoyjSghEdxxcj7X26bQg7y2wyDHa0ydh2nZ67NEKbG9niMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10536 Content-Type: text/plain; charset="utf-8" The next bridge in bridge chain could be a panel bridge or a non-panel bridge. Use devm_drm_of_get_bridge() to replace the combination function calls of of_drm_find_panel() and devm_drm_panel_bridge_add() to get either a panel bridge or a non-panel bridge, instead of getting a panel bridge only. Signed-off-by: Liu Ying --- drivers/gpu/drm/bridge/fsl-ldb.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/fsl-ldb.c b/drivers/gpu/drm/bridge/fsl-= ldb.c index 0e4bac7dd04f..b559f3e0bef6 100644 --- a/drivers/gpu/drm/bridge/fsl-ldb.c +++ b/drivers/gpu/drm/bridge/fsl-ldb.c @@ -15,7 +15,6 @@ #include #include #include -#include =20 #define LDB_CTRL_CH0_ENABLE BIT(0) #define LDB_CTRL_CH0_DI_SELECT BIT(1) @@ -86,7 +85,7 @@ static const struct fsl_ldb_devdata fsl_ldb_devdata[] =3D= { struct fsl_ldb { struct device *dev; struct drm_bridge bridge; - struct drm_bridge *panel_bridge; + struct drm_bridge *next_bridge; struct clk *clk; struct regmap *regmap; const struct fsl_ldb_devdata *devdata; @@ -117,7 +116,7 @@ static int fsl_ldb_attach(struct drm_bridge *bridge, { struct fsl_ldb *fsl_ldb =3D to_fsl_ldb(bridge); =20 - return drm_bridge_attach(bridge->encoder, fsl_ldb->panel_bridge, + return drm_bridge_attach(bridge->encoder, fsl_ldb->next_bridge, bridge, flags); } =20 @@ -292,9 +291,7 @@ static const struct drm_bridge_funcs funcs =3D { static int fsl_ldb_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct device_node *panel_node; struct device_node *remote1, *remote2; - struct drm_panel *panel; struct fsl_ldb *fsl_ldb; int dual_link; =20 @@ -318,33 +315,27 @@ static int fsl_ldb_probe(struct platform_device *pdev) if (IS_ERR(fsl_ldb->regmap)) return PTR_ERR(fsl_ldb->regmap); =20 - /* Locate the remote ports and the panel node */ + /* Locate the remote ports. */ remote1 =3D of_graph_get_remote_node(dev->of_node, 1, 0); remote2 =3D of_graph_get_remote_node(dev->of_node, 2, 0); fsl_ldb->ch0_enabled =3D (remote1 !=3D NULL); fsl_ldb->ch1_enabled =3D (remote2 !=3D NULL); - panel_node =3D of_node_get(remote1 ? remote1 : remote2); of_node_put(remote1); of_node_put(remote2); =20 - if (!fsl_ldb->ch0_enabled && !fsl_ldb->ch1_enabled) { - of_node_put(panel_node); - return dev_err_probe(dev, -ENXIO, "No panel node found"); - } + if (!fsl_ldb->ch0_enabled && !fsl_ldb->ch1_enabled) + return dev_err_probe(dev, -ENXIO, "No next bridge node found"); =20 dev_dbg(dev, "Using %s\n", fsl_ldb_is_dual(fsl_ldb) ? "dual-link mode" : fsl_ldb->ch0_enabled ? "channel 0" : "channel 1"); =20 - panel =3D of_drm_find_panel(panel_node); - of_node_put(panel_node); - if (IS_ERR(panel)) - return PTR_ERR(panel); - - fsl_ldb->panel_bridge =3D devm_drm_panel_bridge_add(dev, panel); - if (IS_ERR(fsl_ldb->panel_bridge)) - return PTR_ERR(fsl_ldb->panel_bridge); - + fsl_ldb->next_bridge =3D devm_drm_of_get_bridge(dev, dev->of_node, + fsl_ldb->ch0_enabled ? 1 : 2, + 0); + if (IS_ERR(fsl_ldb->next_bridge)) + return dev_err_probe(dev, PTR_ERR(fsl_ldb->next_bridge), + "failed to get next bridge\n"); =20 if (fsl_ldb_is_dual(fsl_ldb)) { struct device_node *port1, *port2; --=20 2.34.1