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 9236C606A689 for ; Tue, 1 Dec 2026 20:14:11 +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=4GjiWZIz; 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=RXPNsQ+/ 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=4GjiWZIzq+V+clcVWK0Rrr9uyu lVUx/zFRiGhyL4GRpKhChw18mfJlxq7YT419w88nEarmOPZGjglos/3nuU1SVJJUfPFhD6qajC/Xo ZYKsroGQKvTGWJybUvUIS/5X5wazeVs0roYnMlUi++8VP2xqqPCQQ24S6BrvBXeqZ+TDHdZ5TkKin i7C3gXE9RBgepGhWjAVJ28QsCvOODwj+8Y41X+dVcbyhpL9ee2nc99bFHMRHIWZO6tI25XuLARAOs IyNet4yv2JJfQ7C9Ttk00Vo3yRXMWgdSSFNZ2mQ7jMx1fcljPt29/eQ1dZfNyILA008HmOkJ9NbjF EHYvfJ2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYUEs-00000009KIw-1caV; Tue, 01 Dec 2026 20:14:10 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYUEo-00000009K82-0jyx; Tue, 01 Dec 2026 20:14:06 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9C8434556E; Tue, 1 Dec 2026 20:14:05 +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=1796156045; b=R25zqiKQ8dJUGKtnEzHZNW5OsOW38LtYmpmfg/hTFElrb7x9OKMkSGJ2gGTOUq6LTMKN DnSSTKdZzcIzOvn7IKjsJg0KvzdaPJQxa5fa++grY13nNJG4lb1HQxoml4SaK/jp1ppe5 Y7mWLFjeY6ds3CfilviJZIYbvL3Ckl2dU3Rl2sffwraiJ7D8jmPnLAm6MO5WFT0ys4jsJ 1i96eVu8YohyjtAhF0y5SdvruN9EI+FUE1jh7hLXJwZZRbXjOcg8cy7ylXSaCU8uwTgWn pbZh82aGGW1YpQvg+RncXUk5wACo+HvYV8muZtbbvxxS8+6II1fxx51EOevqyh+gB5A== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796156045; 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=2sSdRx32cU+ODEtEVdqXY4+gHgzyniPxoSaANpddT88W8CTvbbtGMhT8F58Ki7Zj71Py I8d6xQ42j0BRugLAULhi6XuAUtS79pawdhRvsoDXvRoKYdd73+9O5pP9KfufWJ30ER8aF W5mYCV+btC6TVHHhU7RcVSteucAN9EO066wbFMY+uHMyqhz7j8OsMgShUMx4xv+lqdhT7 p9eYd7BODA7N2oUWGyAge2RhAEA0AZrePiSEvE/9y5VaZKGJeli/FcJjttQseFCQTV/LN IMDetvEMGu5JaBoDTSFZrbWuRLujiFaLqtOaFHX8ZQjBodpVvpxPx+tD9xAQ4U3GAUA== 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 D74AB1F00931; Tue, 1 Dec 2026 20:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796156045; bh=jnPu9C8U78zwh2haTTxt6kMsYkBetNfurHLTgZHI+MM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=RXPNsQ+/063g0R/EK9F3tWJPh+J6TmJ6njPgkL4XUKmPVuADaVJnSWqkz94r4WPV9 ZcsP1sbyTHSa79flavBDT1KNTJk94KMq5CV4L0afcfyVidvSCHL7sNOqD9mOOHBDkz xH6jttLNYDp4gC/PXYyGxjdc+BtusKDqn36arNEU5PqayTTPUDHHT5UnokU4r7lvR8 +psJTQzmQISYaPFjmrZqukpjw7XoF66o1ze/DvFGIT/5keihDUa+ljaI+eZnodbxdX vSK73p6YQxjTBcN0naVgZVYINgkIiMkIDEa6n7dVYDnZRBm7WKUAVZjESCtsZn5mgM uao7rKPa7pzZA== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 6EB4E4F087; Tue, 1 Dec 2026 20:13:42 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Tue, 01 Dec 2026 21:12:56 +0100 Subject: [PATCH v6 08/13] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup X-Archived-By: MIME-Version: 1.0 Message-Id: <20261201-meson-drm-create-hdmitx-phy-v6-8-5ccdf57a6cf5@aliel.fr> References: <20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr> In-Reply-To: <20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@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=owGbwMvMwCWm1SvKXP3cUInxtFoSQza/Vlo8H5PRpot9n15+cjnqYMjGsu7Qx6S3Jo6+frpTa oN5bz/uKGVhEONikBVTZOmfa3ni3eWjZ77uUU+BmcPKBDKEgYtTACay5D4jw7c7LZma7/YXxTcl vHB2CV87e15j7cvLO+Rq7CZ2rz3Jm8zwP/824/IMq7NnzeUX6C/jMHl/rtb132bu0zb2B8PZHln /YQUA 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