From: Ronald Claveau via B4 Relay <devnull+linux-kernel-dev.aliel.fr@kernel.org>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Vinod Koul <vkoul@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>, Ulf Hansson <ulfh@kernel.org>
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-kernel-dev@aliel.fr>,
linux-pm@vger.kernel.org
Subject: [PATCH v2 07/11] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup
Date: Fri, 20 Nov 2026 19:15:46 +0100 [thread overview]
Message-ID: <20261120-meson-drm-create-hdmitx-phy-v2-7-93d622d9bb07@aliel.fr> (raw)
In-Reply-To: <20261120-meson-drm-create-hdmitx-phy-v2-0-93d622d9bb07@aliel.fr>
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
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 <linux-kernel-dev@aliel.fr>
---
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 <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
@@ -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
next prev parent reply other threads:[~2026-11-20 18:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 18:15 [PATCH v2 00/11] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 01/11] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 02/11] dt-bindings: phy: amlogic: Add Meson HDMI TX PHY binding Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 03/11] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add hdmi-phy child node Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 04/11] phy: amlogic: Add Meson HDMI TX PHY driver Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 05/11] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 06/11] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
2026-11-20 18:58 ` sashiko-bot
2026-11-21 18:57 ` Ronald Claveau
2026-11-20 18:15 ` Ronald Claveau via B4 Relay [this message]
2026-11-20 18:15 ` [PATCH v2 08/11] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
2026-11-20 19:20 ` sashiko-bot
2026-11-21 19:10 ` Ronald Claveau
2026-11-20 18:15 ` [PATCH v2 09/11] arm64: dts: amlogic: Add HDMI TX PHY node for G12 Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 10/11] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
2026-11-20 18:15 ` [PATCH v2 11/11] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120-meson-drm-create-hdmitx-phy-v2-7-93d622d9bb07@aliel.fr \
--to=devnull+linux-kernel-dev.aliel.fr@kernel.org \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel-dev@aliel.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mani@kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=ulfh@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®