From nobody Tue Dec 16 22:12:20 2025 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 6F98F1DFE02 for ; Sun, 9 Feb 2025 12:11:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739103070; cv=none; b=FrtYr4FxathYXhjzeq4ANMpfqeIYaBD2NK8ZNeuuSddES8nVYzuJN2wsQh8GPOcnyfaZ6XkuCUslhlPjY7/zxO33y1+s+eGtf5+KAgsNgwh8YdC+ybtRQemOOuNSEoSz73RWqEH16wgNFZ8DlphcDIjbWIvjohLZyCVhzwNUqm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739103070; c=relaxed/simple; bh=qeCaEKcGUDVikb0PWYTDwb0iaobuPGbHW8XjOCgX1Lk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Cdf6xNggqD7FGFkuqAhQGCCWts8doSB9X01BuyQ+C0EgxPZj3tFpc2i9UgXxA/8M0duiDw7ql3x6enkEmhFPy8t5YPJvPXTlKaAlybPKvoYk+ouNnTOtsBh19FIhju/zUVDc11uosWF/r61zZHLq2kEYg6knP1/hUEBUM1DW8FQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Hi09YZIz; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Hi09YZIz" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1739103066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AN7JB7Cg+gBv3L+erE+eeh7+gQ4NZV9djINY+4ELNbw=; b=Hi09YZIz4sdxyMoDSaC9Z4vW3AMD3+a+8xHWHdaTE+do4q6wu2+7P+UGbYH5A2pnbRxwtF nyNYde4Pej9TV7/qzNhbOaVWItjh/KTx0MoQQ9RkQRtAtL751TaYLcmB2C5sx0q5kNqHNQ N/kI2L4u108FI0lnrhXUycwYQxJT6po= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v9 06/13] drm/bridge: cdns-dsi: Move to devm_drm_of_get_bridge() Date: Sun, 9 Feb 2025 17:40:25 +0530 Message-Id: <20250209121032.32655-7-aradhya.bhatia@linux.dev> In-Reply-To: <20250209121032.32655-1-aradhya.bhatia@linux.dev> References: <20250209121032.32655-1-aradhya.bhatia@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Instead of manually finding the next bridge/panel, and maintaining the panel-bridge (in-case the next entity is a panel), switch to using the automatically managing devm_drm_of_get_bridge() API. Drop the drm_panel support completely from the driver while at it. Reviewed-by: Tomi Valkeinen Reviewed-by: Dmitry Baryshkov Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 28 ++----------------- .../gpu/drm/bridge/cadence/cdns-dsi-core.h | 2 -- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 6a77ca36cb9d..c2512342139c 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -941,8 +941,6 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, struct cdns_dsi_output *output =3D &dsi->output; struct cdns_dsi_input *input =3D &dsi->input; struct drm_bridge *bridge; - struct drm_panel *panel; - struct device_node *np; int ret; =20 /* @@ -960,26 +958,10 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, /* * The host <-> device link might be described using an OF-graph * representation, in this case we extract the device of_node from - * this representation, otherwise we use dsidev->dev.of_node which - * should have been filled by the core. + * this representation. */ - np =3D of_graph_get_remote_node(dsi->base.dev->of_node, DSI_OUTPUT_PORT, - dev->channel); - if (!np) - np =3D of_node_get(dev->dev.of_node); - - panel =3D of_drm_find_panel(np); - if (!IS_ERR(panel)) { - bridge =3D drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - } else { - bridge =3D of_drm_find_bridge(np); - if (!bridge) - bridge =3D ERR_PTR(-EINVAL); - } - - of_node_put(np); - + bridge =3D devm_drm_of_get_bridge(dsi->base.dev, dsi->base.dev->of_node, + DSI_OUTPUT_PORT, dev->channel); if (IS_ERR(bridge)) { ret =3D PTR_ERR(bridge); dev_err(host->dev, "failed to add DSI device %s (err =3D %d)", @@ -989,7 +971,6 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, =20 output->dev =3D dev; output->bridge =3D bridge; - output->panel =3D panel; =20 /* * The DSI output has been properly configured, we can now safely @@ -1005,12 +986,9 @@ static int cdns_dsi_detach(struct mipi_dsi_host *host, struct mipi_dsi_device *dev) { struct cdns_dsi *dsi =3D to_cdns_dsi(host); - struct cdns_dsi_output *output =3D &dsi->output; struct cdns_dsi_input *input =3D &dsi->input; =20 drm_bridge_remove(&input->bridge); - if (output->panel) - drm_panel_bridge_remove(output->bridge); =20 return 0; } diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.h index ca7ea2da635c..5db5dbbbcaad 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h @@ -10,7 +10,6 @@ =20 #include #include -#include =20 #include #include @@ -21,7 +20,6 @@ struct reset_control; =20 struct cdns_dsi_output { struct mipi_dsi_device *dev; - struct drm_panel *panel; struct drm_bridge *bridge; union phy_configure_opts phy_opts; }; --=20 2.34.1