From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDD23606B230 for ; Fri, 20 Nov 2026 18:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=NAhpPjN6; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UyFH1h7A DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=UrHMB13peYLlL8qXh9+BSTskrKicE1ECtAwNSwXe5C4=; b=NAhpPjN6GJkCQCs3uMYHUKFJf2 HafPw3Rv23G8P3zrJvGEv6Guc8X1cVUj/SJWwV0IUG/RdZ4J/RLhJlmoActCt1YVXOLwKWIlsuB+d 3Y16PuorDHxwE33899451XM/KF6YU+MDFFem4Qbk34cc8AaRiGYku2iXskc5YblL9/TClL0pKgxNI Obu8zywOey/VnBoml6b3Ql57JzRTCWDafvVaIZAkTALAISzgntwDnJkSgGpGFP8aEvYormPxssGM4 7gvlqmpS3yyZ95x4Gq1qM+MCmrK+6kthSg7c4oe0EQ8EjXSJGN4ZUyGJk7wu71FmE4NteQlKlUi11 qMARZkfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xUTCm-0000000FtvP-30fa; Fri, 20 Nov 2026 18:19:27 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xUTAa-0000000FtGY-1DXm; Fri, 20 Nov 2026 18:17:08 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 5CCF36346B; Fri, 20 Nov 2026 18:17:07 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795198626; b=xpArLzySyTaG1NXrOx06tA/3m8mEDYMt8Iq/9/PeTyCIlakB4vM4j+nMpQCWpjclkrys kdO9ZqWjxTrosRC99OEzXjlA0A3KYxIsSHAzZWjyGu8L+JIBLI1tC/UB6LazL148HX85X qDPdpZR/NzYIoH89RX7ow111cF531rFygD+dyCCvPg6OYl24NdCA9/BMkKvc1VyFAJa67 cWYJULXsTyga2WNRbs724y+PR9bGWLrbXn026F0YQxt8SCmPABWag7Ion0tTM0Nouxkmq eFpWRz+12qt7k0J//19JEYnKDr7/uhJHdr9/F+39Kq1GOIm/0aSWvP59ebO6DMvzEdQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795198626; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=jnPu9C8U78zwh2haTTxt6kMsYkBetNfurHLTgZHI+MM=; b=MGGYSlGDr8rGVh88MM/wc5Ougt3z+pqsFXpGu6ZnDhsLQCfNCRAdr8BnvYeN+G81z95W WJFBfGrUNXQc70+j5fHny1LQKXn8cfJWT2JdmHUC2Z/rK7d6eKPGucb534c1hYqbPQdJF g7TNpW84zcsC7QmoDmHEjFb3vkQ6PtTGmM1K6PfhfHpB+tCV5ObsrGQJ4PZA0cRloyeg2 4aF/Qhiy0HhJSraPTfnMJA4LfTtShb8TgNuxoGT5TPxsGzIEmwCVnyJTu5jJK4UpDC4Vo UtT1yjEmq0/E6655H5ADwxbrEILgzc+u3ViUSnKgiXxYt9NPxNa8x58uXfXmhN5M7SQ== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 0F2AE1F0180D; Fri, 20 Nov 2026 18:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795198626; bh=jnPu9C8U78zwh2haTTxt6kMsYkBetNfurHLTgZHI+MM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=UyFH1h7AMsU/rlhNZIbyXYpbVeDEz8F1zZ7feEfjRfuXUxVQ2paRudDaqpqtXb8en 7kIYfO8n9ovvnmOyrCQd6BwKHoJNIuhixIWULcG6hC6F19vA5kmuJhyrUCEBWqOClr /xUuzGRJ62gN/bDg9cqohudnTlZhWL81FR9jpd1jTBsouLfP7W1jTX0abnsv2DC4eZ +LgIQxZhGjXGTEUSQdfUeR7FIllXhDwRF+IcLpPaGguIpqjUMk9CQznU5puVkQTHwo AaF+yery04NQ2kJIEtSgmqXkvOMskSBqJHvljLNmpyyZTsfouosSYnyJl4UzqIxcDN u89vo9Z3/S2cA== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 369EB4B935; Fri, 20 Nov 2026 18:16:33 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 20 Nov 2026 19:15:46 +0100 Subject: [PATCH v2 07/11] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup X-Archived-By: MIME-Version: 1.0 Message-Id: <20261120-meson-drm-create-hdmitx-phy-v2-7-93d622d9bb07@aliel.fr> References: <20261120-meson-drm-create-hdmitx-phy-v2-0-93d622d9bb07@aliel.fr> In-Reply-To: <20261120-meson-drm-create-hdmitx-phy-v2-0-93d622d9bb07@aliel.fr> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Vinod Koul , Manivannan Sadhasivam , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Ulf Hansson Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, dri-devel@lists.freedesktop.org, Ronald Claveau , linux-pm@vger.kernel.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4251; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=Va7r71zAoY5+1f1lapvKRBrSntc7NXGNh523dnCyfas=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQzZDX4GZjNy7xIJ/H7Xe3WBc8u2oglNt/veMTOfiemZ/r Q+bnOZ0lLIwiHExyIopsvTPtTzx7vLRM1/3qKfAzGFlAhnCwMUpABNJ6GX477i2lk/sTIjI0ZxF 4iXO8a8mXHe/vNNiU9cTlqomseNMnYwMkzUfeofIZiXGz+cNVDjwgW2db19U1t9PMX6unqnTDXa zAgA= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: linux-kernel-dev@aliel.fr Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Ronald Claveau meson_dw_hdmi_init() programs two HHI registers by hand: the HDMI clock mux/divider/gate (HHI_HDMI_CLK_CNTL) and the HDMITX memory power-down bits (HHI_MEM_PD_REG0). Both are already covered by resources described in the DT: - the HDMI clock is selected and rated through assigned-clocks (CLKID_HDMI_SEL parented to xtal, CLKID_HDMI at 24 MHz), and gated through the "isfr" clock, which the driver already enables at bind time; - the memory power-down bits are handled by the VPU power domain referenced by "power-domains". Remove the open-coded register writes. Take an explicit runtime PM reference in probe and release it on removal, so that the domain is guaranteed to be on for the lifetime of the device. The driver now relies on runtime PM to power the HDMITX memory, so make it depend on PM. Those properties are optional in the binding and were only added to the in-tree DTs in v6.11, so DTs without them would no longer get the registers programmed by the kernel. This is not a concern in practice: - the DT used by the kernel often comes from U-Boot, which used a DT based on Linux v6.2 before v2024.07 and has used the DT synchronized with Linux since then, matching the v6.11 DT with the clock changes; - U-Boot already sets HHI_HDMI_CLK_CNTL and HHI_MEM_PD_REG0 when probing dw_hdmi, since v2019.04, so both registers are already in the expected state when Linux boots, even with an older U-Boot and DT. The risk of regression is therefore very low. Signed-off-by: Ronald Claveau --- drivers/gpu/drm/meson/Kconfig | 1 + drivers/gpu/drm/meson/meson_dw_hdmi.c | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig index 417f79829cf8..6645665f6038 100644 --- a/drivers/gpu/drm/meson/Kconfig +++ b/drivers/gpu/drm/meson/Kconfig @@ -17,6 +17,7 @@ config DRM_MESON config DRM_MESON_DW_HDMI tristate "HDMI Synopsys Controller support for Amlogic Meson Display" depends on DRM_MESON + depends on PM default y if DRM_MESON select DRM_DW_HDMI imply DRM_DW_HDMI_I2S_AUDIO diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index eb33c70f29c3..20a821936b3a 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -102,8 +103,6 @@ #define HDMITX_DWC_CTRL_REG 0x18 /* HHI Registers */ -#define HHI_MEM_PD_REG0 0x100 /* 0x40 */ -#define HHI_HDMI_CLK_CNTL 0x1cc /* 0x73 */ #define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 */ #define HHI_HDMI_PHY_CNTL1 0x3a4 /* 0xe9 */ #define PHY_CNTL1_INIT 0x03900000 @@ -599,12 +598,6 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi) { struct meson_drm *priv = meson_dw_hdmi->priv; - /* Enable clocks */ - regmap_update_bits(priv->hhi, HHI_HDMI_CLK_CNTL, 0xffff, 0x100); - - /* Bring HDMITX MEM output of power down */ - regmap_update_bits(priv->hhi, HHI_MEM_PD_REG0, 0xff << 8, 0); - /* Reset HDMITX APB & TX & PHY */ reset_control_reset(meson_dw_hdmi->hdmitx_apb); reset_control_reset(meson_dw_hdmi->hdmitx_ctrl); @@ -829,9 +822,29 @@ static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev) return 0; } +static void meson_dw_hdmi_pm_put(void *dev) +{ + pm_runtime_put_sync(dev); +} + static int meson_dw_hdmi_probe(struct platform_device *pdev) { - return component_add(&pdev->dev, &meson_dw_hdmi_ops); + struct device *dev = &pdev->dev; + int ret; + + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret) + return dev_err_probe(dev, ret, "Failed to power on HDMI TX\n"); + + ret = devm_add_action_or_reset(dev, meson_dw_hdmi_pm_put, dev); + if (ret) + return ret; + + return component_add(dev, &meson_dw_hdmi_ops); } static void meson_dw_hdmi_remove(struct platform_device *pdev) -- 2.56.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic