From nobody Mon Dec 1 23:09:59 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 6591031283A; Wed, 26 Nov 2025 17:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178633; cv=none; b=Hs6YBmkh2XJuWAsgQ3uToFTCUo7aiDACZ9oqQOk4WaJLlRG+fE21N57ApRLi6nftmyUVRS4H+IMklhvVaZtgBX/h1KFaPCmpj06yAcG3V6b3binPk0JK8FtBZ1zNo3jcFGHMN+uANNFi75JGJBZkecXuZB8WmWyMVhUviQ0nsEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178633; c=relaxed/simple; bh=qpvcuW96dT7vr73MxAAFL+V1eAFbWfVsileBo+mKLZg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GZFPzY3lsgJWvJgMD9X10v5p15zYUNoZnG9WMiCWhH5vtZ+mRkduiaqEfkdlfQ93CP9+Ou5baBn0KC3kBFvhQDVOnCeX8uXN/sWveVkHYmY+sI0fWJ2CnJw5arxjlF+a2f0wKPH0EnDZAs4ML8fODHzF6XaM7gjzjOf4sTNAyzs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LGH8c05S; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LGH8c05S" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 2ECA9C16A0E; Wed, 26 Nov 2025 17:36:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id EA9A360721; Wed, 26 Nov 2025 17:37:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CE0ED102F23E6; Wed, 26 Nov 2025 18:37:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1764178628; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ebIEoOFbcxjNammgs1wFdNHVv2oGscjy71gi5++A4y8=; b=LGH8c05SNYhkFYRuok7i0iDh+CHzp2Xi/sndQtaKV0ld0jBYj20bVYOC3voXUIK0HwmHcm EpEtZz1+RQtpWkNemyNYPh9qfbznAwAKuvdIzuIKBg/QR24bA4Wr08q5cIKt2jGKlVcJso E1pmhoJPpB8qj0S3w3bGNnF4h+a3wG9hSVDc20Kl1eegc/BIbXyBhwQxyU9Wl/Akh2jhzh TTAimH+LE6kQN1NztjcTCA9YXcCku6cq2r6fchLgzn7lileME1S0GP8RvDaF0Xf53m/nR3 FZBlNIpGB0N0Kt2MvSYN2/PEtDInKhPYc6dRXxa729jSyq6aoSLQ16t/nzeKSg== From: "Kory Maincent (TI.com)" Date: Wed, 26 Nov 2025 18:35:50 +0100 Subject: [PATCH 08/21] drm/tilcdc: Remove component framework support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251126-feature_tilcdc-v1-8-49b9ef2e3aa0@bootlin.com> References: <20251126-feature_tilcdc-v1-0-49b9ef2e3aa0@bootlin.com> In-Reply-To: <20251126-feature_tilcdc-v1-0-49b9ef2e3aa0@bootlin.com> To: Jyri Sarha , Tomi Valkeinen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Russell King , Bartosz Golaszewski , Tony Lindgren , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: Markus Schneider-Pargmann , Luca Ceresoli , Louis Chauvet , Thomas Petazzoni , Miguel Gazquez , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, "Kory Maincent (TI.com)" X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The tilcdc driver previously used the component framework to bind external encoder subdrivers (specifically the TDA998x HDMI encoder). With the removal of these subdrivers in previous commits, the component framework is no longer needed. This commit removes all component framework infrastructure including: - Component master operations and bind/unbind callbacks - The is_componentized flag and conditional code paths - tilcdc_get_external_components() and tilcdc_add_component_encoder() - TDA998x-specific panel configuration The driver now uses a simplified initialization path that directly attaches external devices via the DRM bridge API, eliminating the complexity of dual code paths for componentized vs non-componentized configurations. This cleanup removes approximately 140 lines of code and makes the driver initialization flow more straightforward. Signed-off-by: Kory Maincent (TI.com) --- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 10 ---- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 80 ++++------------------------= ---- drivers/gpu/drm/tilcdc/tilcdc_drv.h | 1 - drivers/gpu/drm/tilcdc/tilcdc_external.c | 65 -------------------------- drivers/gpu/drm/tilcdc/tilcdc_external.h | 3 -- 5 files changed, 9 insertions(+), 150 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/= tilcdc_crtc.c index 1b5475c48f6ad..a244051ab5163 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -1022,16 +1022,6 @@ int tilcdc_crtc_create(struct drm_device *dev) =20 drm_crtc_helper_add(crtc, &tilcdc_crtc_helper_funcs); =20 - if (priv->is_componentized) { - crtc->port =3D of_graph_get_port_by_id(dev->dev->of_node, 0); - if (!crtc->port) { /* This should never happen */ - dev_err(dev->dev, "Port node not found in %pOF\n", - dev->dev->of_node); - ret =3D -EINVAL; - goto fail; - } - } - priv->crtc =3D crtc; return 0; =20 diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/t= ilcdc_drv.c index 411f0767d112d..2df3957ee0dc1 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -6,7 +6,6 @@ =20 /* LCDC DRM driver, based on da8xx-fb */ =20 -#include #include #include #include @@ -212,9 +211,6 @@ static int tilcdc_init(const struct drm_driver *ddrv, s= truct device *dev) platform_set_drvdata(pdev, ddev); drm_mode_config_init(ddev); =20 - priv->is_componentized =3D - tilcdc_get_external_components(dev, NULL) > 0; - priv->wq =3D alloc_ordered_workqueue("tilcdc", 0); if (!priv->wq) { ret =3D -ENOMEM; @@ -328,42 +324,32 @@ static int tilcdc_init(const struct drm_driver *ddrv,= struct device *dev) } #endif =20 - if (priv->is_componentized) { - ret =3D component_bind_all(dev, ddev); - if (ret < 0) - goto unregister_cpufreq_notif; - - ret =3D tilcdc_add_component_encoder(ddev); - if (ret < 0) - goto unbind_component; - } else { - ret =3D tilcdc_attach_external_device(ddev); - if (ret) - goto unregister_cpufreq_notif; - } + ret =3D tilcdc_attach_external_device(ddev); + if (ret) + goto unregister_cpufreq_notif; =20 if (!priv->external_connector && ((priv->num_encoders =3D=3D 0) || (priv->num_connectors =3D=3D 0))) { dev_err(dev, "no encoders/connectors found\n"); ret =3D -EPROBE_DEFER; - goto unbind_component; + goto unregister_cpufreq_notif; } =20 ret =3D drm_vblank_init(ddev, 1); if (ret < 0) { dev_err(dev, "failed to initialize vblank\n"); - goto unbind_component; + goto unregister_cpufreq_notif; } =20 ret =3D platform_get_irq(pdev, 0); if (ret < 0) - goto unbind_component; + goto unregister_cpufreq_notif; priv->irq =3D ret; =20 ret =3D tilcdc_irq_install(ddev, priv->irq); if (ret < 0) { dev_err(dev, "failed to install IRQ handler\n"); - goto unbind_component; + goto unregister_cpufreq_notif; } =20 drm_mode_config_reset(ddev); @@ -381,9 +367,6 @@ static int tilcdc_init(const struct drm_driver *ddrv, s= truct device *dev) stop_poll: drm_kms_helper_poll_fini(ddev); tilcdc_irq_uninstall(ddev); -unbind_component: - if (priv->is_componentized) - component_unbind_all(dev, ddev); unregister_cpufreq_notif: #ifdef CONFIG_CPU_FREQ cpufreq_unregister_notifier(&priv->freq_transition, @@ -532,65 +515,20 @@ static int tilcdc_pm_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(tilcdc_pm_ops, tilcdc_pm_suspend, tilcdc_pm_resume); =20 -/* - * Platform driver: - */ -static int tilcdc_bind(struct device *dev) -{ - return tilcdc_init(&tilcdc_driver, dev); -} - -static void tilcdc_unbind(struct device *dev) -{ - struct drm_device *ddev =3D dev_get_drvdata(dev); - - /* Check if a subcomponent has already triggered the unloading. */ - if (!ddev->dev_private) - return; - - tilcdc_fini(ddev); - dev_set_drvdata(dev, NULL); -} - -static const struct component_master_ops tilcdc_comp_ops =3D { - .bind =3D tilcdc_bind, - .unbind =3D tilcdc_unbind, -}; - static int tilcdc_pdev_probe(struct platform_device *pdev) { - struct component_match *match =3D NULL; - int ret; - /* bail out early if no DT data: */ if (!pdev->dev.of_node) { dev_err(&pdev->dev, "device-tree data is missing\n"); return -ENXIO; } =20 - ret =3D tilcdc_get_external_components(&pdev->dev, &match); - if (ret < 0) - return ret; - else if (ret =3D=3D 0) - return tilcdc_init(&tilcdc_driver, &pdev->dev); - else - return component_master_add_with_match(&pdev->dev, - &tilcdc_comp_ops, - match); + return tilcdc_init(&tilcdc_driver, &pdev->dev); } =20 static void tilcdc_pdev_remove(struct platform_device *pdev) { - int ret; - - ret =3D tilcdc_get_external_components(&pdev->dev, NULL); - if (ret < 0) - dev_err(&pdev->dev, "tilcdc_get_external_components() failed (%pe)\n", - ERR_PTR(ret)); - else if (ret =3D=3D 0) - tilcdc_fini(platform_get_drvdata(pdev)); - else - component_master_del(&pdev->dev, &tilcdc_comp_ops); + tilcdc_fini(platform_get_drvdata(pdev)); } =20 static void tilcdc_pdev_shutdown(struct platform_device *pdev) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/t= ilcdc_drv.h index 79078b4ae7393..c23b593dc61f6 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h @@ -84,7 +84,6 @@ struct tilcdc_drm_private { struct drm_encoder *external_encoder; struct drm_connector *external_connector; =20 - bool is_componentized; bool irq_enabled; }; =20 diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/til= cdc/tilcdc_external.c index da755a411d9ff..2970c41d9c3eb 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_external.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c @@ -4,7 +4,6 @@ * Author: Jyri Sarha */ =20 -#include #include =20 #include @@ -15,19 +14,6 @@ #include "tilcdc_drv.h" #include "tilcdc_external.h" =20 -static const struct tilcdc_panel_info panel_info_tda998x =3D { - .ac_bias =3D 255, - .ac_bias_intrpt =3D 0, - .dma_burst_sz =3D 16, - .bpp =3D 16, - .fdd =3D 0x80, - .tft_alt_mode =3D 0, - .invert_pxl_clk =3D 1, - .sync_edge =3D 1, - .sync_ctrl =3D 1, - .raster_order =3D 0, -}; - static const struct tilcdc_panel_info panel_info_default =3D { .ac_bias =3D 255, .ac_bias_intrpt =3D 0, @@ -57,34 +43,6 @@ struct drm_connector *tilcdc_encoder_find_connector(stru= ct drm_device *ddev, return NULL; } =20 -int tilcdc_add_component_encoder(struct drm_device *ddev) -{ - struct tilcdc_drm_private *priv =3D ddev->dev_private; - struct drm_encoder *encoder =3D NULL, *iter; - - list_for_each_entry(iter, &ddev->mode_config.encoder_list, head) - if (iter->possible_crtcs & (1 << priv->crtc->index)) { - encoder =3D iter; - break; - } - - if (!encoder) { - dev_err(ddev->dev, "%s: No suitable encoder found\n", __func__); - return -ENODEV; - } - - priv->external_connector =3D - tilcdc_encoder_find_connector(ddev, encoder); - - if (!priv->external_connector) - return -ENODEV; - - /* Only tda998x is supported at the moment. */ - tilcdc_crtc_set_panel_info(priv->crtc, &panel_info_tda998x); - - return 0; -} - static int tilcdc_attach_bridge(struct drm_device *ddev, struct drm_bridge *bridg= e) { @@ -153,26 +111,3 @@ int tilcdc_attach_external_device(struct drm_device *d= dev) drm_encoder_cleanup(priv->external_encoder); return ret; } - -static int dev_match_of(struct device *dev, void *data) -{ - return dev->of_node =3D=3D data; -} - -int tilcdc_get_external_components(struct device *dev, - struct component_match **match) -{ - struct device_node *node; - - node =3D of_graph_get_remote_node(dev->of_node, 0, 0); - - if (!of_device_is_compatible(node, "nxp,tda998x")) { - of_node_put(node); - return 0; - } - - if (match) - drm_of_component_match_add(dev, match, dev_match_of, node); - of_node_put(node); - return 1; -} diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.h b/drivers/gpu/drm/til= cdc/tilcdc_external.h index fb4476694cd89..285a132f3035d 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_external.h +++ b/drivers/gpu/drm/tilcdc/tilcdc_external.h @@ -7,8 +7,5 @@ #ifndef __TILCDC_EXTERNAL_H__ #define __TILCDC_EXTERNAL_H__ =20 -int tilcdc_add_component_encoder(struct drm_device *dev); -int tilcdc_get_external_components(struct device *dev, - struct component_match **match); int tilcdc_attach_external_device(struct drm_device *ddev); #endif /* __TILCDC_SLAVE_H__ */ --=20 2.43.0